]> granicus.if.org Git - postgresql/blobdiff - src/backend/common.mk
Don't apply sortgroupref labels to a tlist that might not match.
[postgresql] / src / backend / common.mk
index f3e48a69fca0e91e02391a154df570e1e55b4516..5d599dbd0ca2519436702a934e2fb666aa53aaf3 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Common make rules for backend
 #
-# $PostgreSQL: pgsql/src/backend/common.mk,v 1.4 2008/02/26 08:23:31 petere Exp $
+# src/backend/common.mk
 #
 
 # When including this file, set OBJS to the object files created in
@@ -26,14 +26,12 @@ 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)
+# Don't rebuild the list if only the OBJS have changed.
+       $(if $(filter-out $(OBJS),$?),( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(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))
+expand_subsys = $(foreach file,$(1),$(if $(filter %/objfiles.txt,$(file)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file)))),$(file)))
 
 # Parallel make trickery
 $(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
@@ -42,9 +40,9 @@ $(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
 $(SUBDIRS:%=%-recursive):
        $(MAKE) -C $(subst -recursive,,$@) all
 
+$(call recurse,clean)
 clean: clean-local
 clean-local:
-ifdef SUBDIRS
-       for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean || exit; done
-endif
        rm -f $(subsysfilename) $(OBJS)
+
+$(call recurse,coverage)