]> granicus.if.org Git - postgresql/commitdiff
Write the objfiles.txt rules in a way that is compatible with GNU make 3.78,
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 29 Feb 2008 10:34:51 +0000 (10:34 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 29 Feb 2008 10:34:51 +0000 (10:34 +0000)
and simpler, too.

src/backend/common.mk

index 56e1f17b535f73cea74660913d4ad556926dd994..c076722a9340fc4db66ae98e1047aee2565f06ac 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Common make rules for backend
 #
-# $PostgreSQL: pgsql/src/backend/common.mk,v 1.5 2008/02/27 20:31:01 petere Exp $
+# $PostgreSQL: pgsql/src/backend/common.mk,v 1.6 2008/02/29 10:34:51 petere Exp $
 #
 
 # When including this file, set OBJS to the object files created in
@@ -26,11 +26,9 @@ endif
 SUBSYS.o: $(SUBDIROBJS) $(OBJS)
        $(LD) $(LDREL) $(LDOUT) $@ $^
 
-objfiles.txt:: $(MAKEFILE_LIST) | $(SUBDIROBJS) $(OBJS)
-       ( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(OBJS)) ) >$@
-
-objfiles.txt:: $(SUBDIROBJS) $(OBJS)
-       touch $@
+objfiles.txt: Makefile $(SUBDIROBJS) $(OBJS)
+# Only rebuild the list if it does not exist or the Makefile has changed.
+       $(if $(filter $<,$?),( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(OBJS)) ) >$@,touch $@)
 
 # make function to expand objfiles.txt contents
 expand_subsys = $(foreach file,$(1),$(if $(filter %/objfiles.txt,$(file)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file)))),$(file)))