mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-11 10:23:14 +02:00
Commit 372728b0d
created some problems for usages like building a
subdirectory without having first done "make all" at the top level,
or for proceeding directly to "make install" without "make all".
The only reasonably clean way to fix this seems to be to force the
submake-generated-headers rule to fire in *any* "make all" or "make
install" command anywhere in the tree. To avoid lots of redundant work,
as well as parallel make jobs possibly clobbering each others' output, we
still need to be sure that the rule fires only once in a recursive build.
For that, adopt the same MAKELEVEL hack previously used for "temp-install".
But try to document it a bit better.
The submake-errcodes mechanism previously used in src/port/ and src/common/
is subsumed by this, so we can get rid of those special cases. It was
inadequate for src/common/ anyway after the aforesaid commit, and it always
risked parallel attempts to build errcodes.h.
Discussion: https://postgr.es/m/E1f5FAB-0006LU-MB@gemulon.postgresql.org
80 lines
1.8 KiB
Makefile
80 lines
1.8 KiB
Makefile
#-------------------------------------------------------------------------
|
|
#
|
|
# Makefile for src
|
|
#
|
|
# Copyright (c) 1994, Regents of the University of California
|
|
#
|
|
# src/Makefile
|
|
#
|
|
#-------------------------------------------------------------------------
|
|
|
|
subdir = src
|
|
top_builddir = ..
|
|
include Makefile.global
|
|
|
|
SUBDIRS = \
|
|
common \
|
|
port \
|
|
timezone \
|
|
backend \
|
|
backend/utils/mb/conversion_procs \
|
|
backend/snowball \
|
|
include \
|
|
interfaces \
|
|
backend/replication/libpqwalreceiver \
|
|
backend/replication/pgoutput \
|
|
fe_utils \
|
|
bin \
|
|
pl \
|
|
makefiles \
|
|
test/regress \
|
|
test/isolation \
|
|
test/perl
|
|
|
|
ifeq ($(with_llvm), yes)
|
|
SUBDIRS += backend/jit/llvm
|
|
endif
|
|
|
|
# There are too many interdependencies between the subdirectories, so
|
|
# don't attempt parallel make here.
|
|
.NOTPARALLEL:
|
|
|
|
$(recurse)
|
|
|
|
install: install-local
|
|
|
|
install-local: installdirs-local
|
|
$(INSTALL_DATA) Makefile.global '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.global'
|
|
$(INSTALL_DATA) Makefile.port '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.port'
|
|
$(INSTALL_DATA) $(srcdir)/Makefile.shlib '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.shlib'
|
|
$(INSTALL_DATA) $(srcdir)/nls-global.mk '$(DESTDIR)$(pgxsdir)/$(subdir)/nls-global.mk'
|
|
|
|
installdirs: installdirs-local
|
|
|
|
installdirs-local:
|
|
$(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(subdir)'
|
|
|
|
uninstall: uninstall-local
|
|
|
|
uninstall-local:
|
|
rm -f $(addprefix '$(DESTDIR)$(pgxsdir)/$(subdir)'/, Makefile.global Makefile.port Makefile.shlib nls-global.mk)
|
|
|
|
distprep:
|
|
$(MAKE) -C test/isolation $@
|
|
|
|
clean:
|
|
$(MAKE) -C test $@
|
|
$(MAKE) -C tutorial NO_PGXS=1 $@
|
|
$(MAKE) -C test/isolation $@
|
|
$(MAKE) -C test/thread $@
|
|
|
|
distclean maintainer-clean:
|
|
$(MAKE) -C test $@
|
|
$(MAKE) -C tutorial NO_PGXS=1 $@
|
|
$(MAKE) -C test/isolation $@
|
|
$(MAKE) -C test/thread $@
|
|
rm -f Makefile.port Makefile.global
|
|
|
|
|
|
.PHONY: install-local installdirs-local uninstall-local
|