I want to know a good way to compile a program that uses many files and I want to avoid to recompile unmodified files.
It is for Linux, and I am looking for something that is different from Makefile.
Makefile has some problems:
It is long to write, and it is verbose to change as long I create new files; C/C++ use header files.
Makefile does not recompile a .c file if it includes a .h file that includes another .h file that was modified. It needs complex syntax.
Makefile uses the tabulation character, it is not good, because I use the tab key to indentation (it inserts 4 space chars instead).
As an example, my original compilation script is:
gcc file1.c -c -flags1
gcc file2.c -c -flags2
gcc file3.c file4.c -c -flags3
gcc file1.o file2.o file3.o file4.o -o a.out
And I want to avoid to recompile what is not needed with easy ways.
Some projects (Doom3, MongoDB and others) use SCons.
It’s written in Python and has many features (like parallel compilation).