C Program Compiles and Library PATHS
Greetings, I have to write a few C programs.
I would like to keep the source code in libaryA, The compiled object code in libraryB (before the Make) the object code after the Make in libraryC and a completed module (program) ready to execute in libraryD. The reason for all of this is for production control purposes. I would like your advise in the best way to do this and would like to know if it's possible to do all of this and how to use The GCC command to do all of this. Is it advisable to add all the libraries listed above to my PATH statement for my initial testing or is there some other recommended way to do this. Your help is appreciated. Thanks Using CentOS 6.3 |
While GCC would be involved, you'd need to do this with a Makefile.
Here's a sample Makefile which comes close; however when I tried to use different object sub-directories, it had problems with the definition strings for those sub-directory references. It however does work to compile in the main directory and then from there in the "make install" you can move files to the locations you wish them to be in. Where it ran into trouble was when I tried to say that the objects would be in a sub-directory. The Makefile is like a shell script, but make has more stringent syntax restrictions; for instance those indentations absolutely MUST be TAB characters, not 8 SPACES. So my assumption is that the notations for sub-directories in the view of make must be different from what a bash script accepts. Hope this helps you to get started. Code:
#!/bin/sh |
Thanks Mistler...Being a newbie at this I'm guess I'll just compile the C code and move the executable to a different production directory.
|
All times are GMT -5. The time now is 10:00 AM. |