1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00
Files
postgres/src/backend/common.mk
Andres Freund 05bf551040 Remove SUBSYS.o rule in common.mk, hasn't been used in a long time
Apparently I missed that this SUBSYS.o rule isn't needed anymore in
a4ebbd2752, likely because there still is a reference to it due to AIX - but
that's self contained in src/backend/Makefile

Discussion: https://postgr.es/m/20220820174213.d574qde4ptwdzoqz@awork3.anarazel.de
2022-08-24 20:38:14 -07:00

45 lines
1.2 KiB
Makefile

#
# Common make rules for backend
#
# src/backend/common.mk
#
# When including this file, set OBJS to the object files created in
# this directory and SUBDIRS to subdirectories containing more things
# to build.
subsysfilename = objfiles.txt
SUBDIROBJS = $(SUBDIRS:%=%/$(subsysfilename))
# top-level backend directory obviously has its own "all" target
ifneq ($(subdir), src/backend)
all: $(subsysfilename)
endif
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 $@)
ifeq ($(with_llvm), yes)
objfiles.txt: $(patsubst %.o,%.bc, $(OBJS))
endif
# make function to expand objfiles.txt contents
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) ;
.PHONY: $(SUBDIRS:%=%-recursive)
$(SUBDIRS:%=%-recursive):
$(MAKE) -C $(subst -recursive,,$@) all
$(call recurse,clean)
clean: clean-local
clean-local:
rm -f $(subsysfilename) $(OBJS) $(patsubst %.o,%.bc, $(OBJS))
$(call recurse,coverage)
$(call recurse,install)