PDA

View Full Version : [ubuntu] using GCC for multiple files



MaWiSo
May 9th, 2013, 09:58 AM
I'm a beginner to using gcc in command line
I have a project with multiple .h and .cpp files.
I want to compile this project and add #defines in the compilation command in gcc.

some of the .h files are paired with .cpp files.
some are just standalone.

each .h file has its own #define that needs to be set

how to do this ??

codemaniac
May 9th, 2013, 10:25 AM
this is where 'make' utility comes into picture and makes life easier.

the documentation is a bit fat but worth a read to master this great utility.

http://www.gnu.org/software/make/manual/make.html