Use order-only prerequisites for include files

This prevents unnecessary recompilations when an include
file gets regenerated.
This commit is contained in:
Andrew Johnson
2015-02-04 16:28:23 -06:00
parent 9316233ba2
commit 971a819446

View File

@@ -215,15 +215,16 @@ $(TESTPRODNAME) $(PRODNAME): %$(EXE):
%.o : %.cc
%.o : %.cpp
%$(OBJ): %.c $(COMMON_INC) $(INSTALL_INC)
# Include files are order-only prerequisites for compilation:
%$(OBJ): %.c | $(COMMON_INC) $(INSTALL_INC)
@$(RM) $@
$(COMPILE.c) -c $<
%$(OBJ): %.cc $(COMMON_INC) $(INSTALL_INC)
%$(OBJ): %.cc | $(COMMON_INC) $(INSTALL_INC)
@$(RM) $@
$(COMPILE.cpp) -c $<
%$(OBJ): %.cpp $(COMMON_INC) $(INSTALL_INC)
%$(OBJ): %.cpp | $(COMMON_INC) $(INSTALL_INC)
@$(RM) $@
$(COMPILE.cpp) -c $<