mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Refactor backend makefiles to remove lots of duplicate code
This commit is contained in:
25
src/backend/common.mk
Normal file
25
src/backend/common.mk
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# Common make rules for backend
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/backend/common.mk,v 1.1 2008/02/19 10:30:06 petere Exp $
|
||||
#
|
||||
|
||||
SUBDIROBJS = $(SUBDIRS:%=%/SUBSYS.o)
|
||||
|
||||
all: SUBSYS.o
|
||||
|
||||
SUBSYS.o: $(SUBDIROBJS) $(OBJS)
|
||||
$(LD) $(LDREL) $(LDOUT) $@ $^
|
||||
|
||||
$(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
|
||||
|
||||
.PHONY: $(SUBDIRS:%=%-recursive)
|
||||
$(SUBDIRS:%=%-recursive):
|
||||
$(MAKE) -C $(subst -recursive,,$@) SUBSYS.o
|
||||
|
||||
clean: clean-local
|
||||
clean-local:
|
||||
ifdef SUBDIRS
|
||||
for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean || exit; done
|
||||
endif
|
||||
rm -f SUBSYS.o $(OBJS)
|
Reference in New Issue
Block a user