Commit 3690019d authored by Peter Eisentraut's avatar Peter Eisentraut

We don't need to rebuild objfiles.txt every time an object file changes.

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.
parent a1d5d857
# #
# Common make rules for backend # Common make rules for backend
# #
# $PostgreSQL: pgsql/src/backend/common.mk,v 1.2 2008/02/25 17:55:42 petere Exp $ # $PostgreSQL: pgsql/src/backend/common.mk,v 1.3 2008/02/26 07:20:38 petere Exp $
# #
# When including this file, set OBJS to the object files created in # When including this file, set OBJS to the object files created in
...@@ -26,9 +26,12 @@ endif ...@@ -26,9 +26,12 @@ endif
SUBSYS.o: $(SUBDIROBJS) $(OBJS) SUBSYS.o: $(SUBDIROBJS) $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^ $(LD) $(LDREL) $(LDOUT) $@ $^
objfiles.txt: $(SUBDIROBJS) $(OBJS) objfiles.txt:: $(MAKEFILE_LIST)
( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(OBJS)) ) >$@ ( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(OBJS)) ) >$@
objfiles.txt:: $(SUBDIROBJS) $(OBJS)
touch $@
# make function to expand objfiles.txt contents # 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,$(filter %/objfiles.txt,$(1)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file))))) $(filter-out %/objfiles.txt,$(1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment