The simplest, in my opinion, would be to do a make clean
and then a make
. This is of course assuming that you want all source files to be recompiled due to the change in compiler flags. But you seem to not like this method.
If you want to modify the makefile, you can add the name of your makefile to every rule for compiling source files, for example:
somefile.o : somefile.cpp <makefile_name>
$(CC) -c $(CFLAGS) somefile.cpp -o somefile.o
or
%.o : %.c <makefile_name>
$(CC) -c $(CFLAGS) somefile.cpp -o somefile.o
Given the size of the project, and the number of rules involved, doing a make clean; make
may be the easiest and fastest method. However, as always, you mileage my vary.
Just my $0.02 worth, hope it helps
T.