The standard approach is to automatically create compilation header dependencies.
For the first compilation, no dependencies are needed, since each source file must be compiled. Subsequent recompilations of the load dependencies generated by the previous compilation to determine what needs to be recompiled.
Your $(MyNotGCCCompiler)
will probably have a command line option to create a dependency file.
When using gcc
it works as follows:
.SUFFIXES: SRC := $(wildard ./src/*.c) OBJ := $(SRC:%.c=%.o) DEP := $(OBJ:%.o=%.d) all: $(OBJ)
source share