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