We don't need to rebuild objfiles.txt every time an object file changes.
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 26 Feb 2008 07:20:38 +0000 (07:20 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 26 Feb 2008 07:20:38 +0000 (07:20 +0000)
So only rebuild when a makefile changes (which presumably defines the
file list somewhere), and only touch the file if an object changed. The
touch is necessary so the parent make knows something changed and
ultimately rebuilds postgres.

src/backend/common.mk

index 46c75bd17ac7782971e6571ed89ea8e56b7bc230..1c4537e1a8e1668b576f22c6ce087370a806e5dd 100644 (file)
@@ -26,9 +26,12 @@ endif
 SUBSYS.o: $(SUBDIROBJS) $(OBJS)
        $(LD) $(LDREL) $(LDOUT) $@ $^
 
-objfiles.txt: $(SUBDIROBJS) $(OBJS)
+objfiles.txt:: $(MAKEFILE_LIST)
        ( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(OBJS)) ) >$@
 
+objfiles.txt:: $(SUBDIROBJS) $(OBJS)
+       touch $@
+
 # make function to expand objfiles.txt contents
 expand_subsys = $(foreach file,$(filter %/objfiles.txt,$(1)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file))))) $(filter-out %/objfiles.txt,$(1))