> Here's a correct, *tested* makefile: > -------- > .PHONY: all clean > > SRC = main.cpp > COMPILE.cpp += -MMD -MP > > all: main.exe > > main.exe : main.o > $(LINK.cpp) $< $(LOADLIBES) $(LDLIBS) -o $@ > > -include $(SRC:.cpp=.d) > > clean: > @$(RM) *.o *.exe *.d > --------
This works. But I want to understand how this works. 'main.d' is the following. ------------------------------------------------- main.o: main.cpp print.hpp nothing1.hpp nothing3.hpp print.hpp: nothing1.hpp: nothing3.hpp: --------------------------------------------- How do the last three rules come into play? Suppose I nothing1.cpp so that it includes nothing2.hpp, and I rename nothing3.hpp to nothing2.hpp. Why remake would be success? Thanks, Peng _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
