]> granicus.if.org Git - postgresql/blob - src/backend/common.mk
Refactor backend makefiles to remove lots of duplicate code
[postgresql] / src / backend / common.mk
1 #
2 # Common make rules for backend
3 #
4 # $PostgreSQL: pgsql/src/backend/common.mk,v 1.1 2008/02/19 10:30:06 petere Exp $
5 #
6
7 SUBDIROBJS = $(SUBDIRS:%=%/SUBSYS.o)
8
9 all: SUBSYS.o
10
11 SUBSYS.o: $(SUBDIROBJS) $(OBJS)
12         $(LD) $(LDREL) $(LDOUT) $@ $^
13
14 $(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
15
16 .PHONY: $(SUBDIRS:%=%-recursive)
17 $(SUBDIRS:%=%-recursive):
18         $(MAKE) -C $(subst -recursive,,$@) SUBSYS.o
19
20 clean: clean-local
21 clean-local:
22 ifdef SUBDIRS
23         for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean || exit; done
24 endif
25         rm -f SUBSYS.o $(OBJS)