ifeq ($(with_openssl),yes)
SUBDIRS += sslinfo
+else
+ALWAYS_SUBDIRS += sslinfo
endif
ifeq ($(with_ossp_uuid),yes)
SUBDIRS += uuid-ossp
+else
+ALWAYS_SUBDIRS += uuid-ossp
endif
ifeq ($(with_libxml),yes)
SUBDIRS += xml2
+else
+ALWAYS_SUBDIRS += xml2
endif
ifeq ($(with_selinux),yes)
SUBDIRS += sepgsql
+else
+ALWAYS_SUBDIRS += sepgsql
endif
# Missing:
$(recurse)
+$(recurse_always)
# Meta configuration
standard_targets = all install installdirs uninstall distprep clean distclean maintainer-clean coverage check installcheck maintainer-check
+# these targets should recurse even into subdirectories not being built:
+standard_always_targets = distprep clean distclean maintainer-clean
.PHONY: $(standard_targets) install-strip html man installcheck-parallel
# $3: target to run in subdir (defaults to current element of $1)
recurse = $(foreach target,$(if $1,$1,$(standard_targets)),$(foreach subdir,$(if $2,$2,$(SUBDIRS)),$(eval $(call _create_recursive_target,$(target),$(subdir),$(if $3,$3,$(target))))))
+# If a makefile's list of SUBDIRS varies depending on configuration, then
+# any subdirectories excluded from SUBDIRS should instead be added to
+# ALWAYS_SUBDIRS, and then it must call recurse_always as well as recurse.
+# This ensures that distprep, distclean, etc will apply to all subdirectories.
+# In the normal case all arguments will be defaulted.
+# $1: targets to make recursive (defaults to standard_always_targets)
+# $2: list of subdirs (defaults to ALWAYS_SUBDIRS variable)
+# $3: target to run in subdir (defaults to current element of $1)
+recurse_always = $(foreach target,$(if $1,$1,$(standard_always_targets)),$(foreach subdir,$(if $2,$2,$(ALWAYS_SUBDIRS)),$(eval $(call _create_recursive_target,$(target),$(subdir),$(if $3,$3,$(target))))))
+
##########################################################################
#
SUBDIRS = initdb pg_ctl pg_dump \
psql scripts pg_config pg_controldata pg_resetxlog pg_basebackup
+
ifeq ($(PORTNAME), win32)
-SUBDIRS+=pgevent
+SUBDIRS += pgevent
+else
+ALWAYS_SUBDIRS += pgevent
endif
$(recurse)
+$(recurse_always)
ifeq ($(with_perl), yes)
SUBDIRS += plperl
+else
+ALWAYS_SUBDIRS += plperl
endif
ifeq ($(with_python), yes)
SUBDIRS += plpython
+else
+ALWAYS_SUBDIRS += plpython
endif
ifeq ($(with_tcl), yes)
SUBDIRS += tcl
+else
+ALWAYS_SUBDIRS += tcl
endif
$(recurse)
+$(recurse_always)
include $(top_srcdir)/src/Makefile.shlib
-# Force this dependency to be known even without dependency info built:
-plpython.o: spiexceptions.h
-
-spiexceptions.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-spiexceptions.pl
- $(PERL) $(srcdir)/generate-spiexceptions.pl $< > $@
-
all: all-lib
-distprep: spiexceptions.h
-
install: all install-lib install-data
$(pg_regress_installcheck) --inputdir=./python3 --outputdir=./python3 $(REGRESS_OPTS) $(REGRESS)
clean: clean3
-else
+else # not Python 3
check: submake
$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
installcheck: submake
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
-endif
+endif # not Python 3
.PHONY: submake
submake:
rm -f python${pytverstr}.def
endif
-maintainer-clean: distclean
- rm -f spiexceptions.h
-
else # can't build
all:
echo ""
endif # can't build
+
+# distprep and maintainer-clean rules should be run even if we can't build.
+
+# Force this dependency to be known even without dependency info built:
+plpython.o: spiexceptions.h
+
+spiexceptions.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-spiexceptions.pl
+ $(PERL) $(srcdir)/generate-spiexceptions.pl $< > $@
+
+distprep: spiexceptions.h
+
+maintainer-clean: distclean
+ rm -f spiexceptions.h