Skip to content
Snippets Groups Projects
Commit 19e231bb authored by Peter Eisentraut's avatar Peter Eisentraut
Browse files

Improved parallel make support

Replace for loops in makefiles with proper dependencies.  Parallel
make can now span across directories.  Also, make -k and make -q work
properly.

GNU make 3.80 or newer is now required.
parent d6754f67
Branches
Tags
No related merge requests found
Showing
with 118 additions and 135 deletions
...@@ -8,57 +8,39 @@ subdir = ...@@ -8,57 +8,39 @@ subdir =
top_builddir = . top_builddir = .
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
$(call recurse,all install,src config)
all: all:
$(MAKE) -C src all +@echo "All of PostgreSQL successfully made. Ready to install."
$(MAKE) -C config all
@echo "All of PostgreSQL successfully made. Ready to install."
docs: docs:
$(MAKE) -C doc all $(MAKE) -C doc all
$(call recurse,world,doc src config contrib,all)
world: world:
$(MAKE) -C doc all +@echo "PostgreSQL, contrib, and documentation successfully made. Ready to install."
$(MAKE) -C src all
$(MAKE) -C config all
$(MAKE) -C contrib all
@echo "PostgreSQL, contrib, and documentation successfully made. Ready to install."
html man: html man:
$(MAKE) -C doc $@ $(MAKE) -C doc $@
install: install:
$(MAKE) -C src $@ +@echo "PostgreSQL installation complete."
$(MAKE) -C config $@
@echo "PostgreSQL installation complete."
install-docs: install-docs:
$(MAKE) -C doc install $(MAKE) -C doc install
$(call recurse,install-world,doc src config contrib,install)
install-world: install-world:
$(MAKE) -C doc install +@echo "PostgreSQL, contrib, and documentation installation complete."
$(MAKE) -C src install
$(MAKE) -C config install
$(MAKE) -C contrib install
@echo "PostgreSQL, contrib, and documentation installation complete."
installdirs uninstall coverage: $(call recurse,installdirs uninstall coverage,doc src config)
$(MAKE) -C doc $@
$(MAKE) -C src $@
$(MAKE) -C config $@
distprep: $(call recurse,distprep,doc src config contrib)
$(MAKE) -C doc $@
$(MAKE) -C src $@
$(MAKE) -C config $@
$(MAKE) -C contrib $@
# clean, distclean, etc should apply to contrib too, even though # clean, distclean, etc should apply to contrib too, even though
# it's not built by default # it's not built by default
$(call recurse,clean,doc contrib src config)
clean: clean:
$(MAKE) -C doc $@
$(MAKE) -C contrib $@
$(MAKE) -C src $@
$(MAKE) -C config $@
# Garbage from autoconf: # Garbage from autoconf:
@rm -rf autom4te.cache/ @rm -rf autom4te.cache/
...@@ -78,11 +60,7 @@ check: all ...@@ -78,11 +60,7 @@ check: all
check installcheck installcheck-parallel: check installcheck installcheck-parallel:
$(MAKE) -C src/test $@ $(MAKE) -C src/test $@
installcheck-world: $(call recurse,installcheck-world,src/test src/pl src/interfaces/ecpg contrib,installcheck)
$(MAKE) -C src/test installcheck
$(MAKE) -C src/pl installcheck
$(MAKE) -C src/interfaces/ecpg installcheck
$(MAKE) -C contrib installcheck
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
./config.status $@ ./config.status $@
...@@ -143,12 +121,4 @@ distcheck: dist ...@@ -143,12 +121,4 @@ distcheck: dist
rm -rf $(distdir) $(dummy) rm -rf $(distdir) $(dummy)
@echo "Distribution integrity checks out." @echo "Distribution integrity checks out."
.PHONY: dist distdir distcheck docs install-docs .PHONY: dist distdir distcheck docs install-docs world install-world installcheck-world
# Temporary measure to explore whether we can start requiring GNU make
# 3.80. That version also happens to be the version where the
# .VARIABLES variable was introduced, so this is a simple check.
ifndef .VARIABLES
$(warning warning: GNU make 3.80 or newer might become required soon. You are using version $(MAKE_VERSION).)
endif
...@@ -63,14 +63,4 @@ endif ...@@ -63,14 +63,4 @@ endif
# start-scripts \ (does not have a makefile) # start-scripts \ (does not have a makefile)
all install installdirs uninstall distprep clean distclean maintainer-clean: $(recurse)
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@ || exit; \
done
# We'd like check operations to run all the subtests before failing.
check installcheck:
@CHECKERR=0; for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@ || CHECKERR=$$?; \
done; \
exit $$CHECKERR
...@@ -4,6 +4,7 @@ MODULE_big = dblink ...@@ -4,6 +4,7 @@ MODULE_big = dblink
PG_CPPFLAGS = -I$(libpq_srcdir) PG_CPPFLAGS = -I$(libpq_srcdir)
OBJS = dblink.o OBJS = dblink.o
SHLIB_LINK = $(libpq) SHLIB_LINK = $(libpq)
SHLIB_PREREQS = submake-libpq
DATA_built = dblink.sql DATA_built = dblink.sql
DATA = uninstall_dblink.sql DATA = uninstall_dblink.sql
......
...@@ -68,8 +68,8 @@ su - postgres ...@@ -68,8 +68,8 @@ su - postgres
<primary>make</primary> <primary>make</primary>
</indexterm> </indexterm>
<acronym>GNU</> <application>make</> is required; other <acronym>GNU</> <application>make</> version 3.80 or newer is required; other
<application>make</> programs will <emphasis>not</> work. <application>make</> programs or older <acronym>GNU</> <application>make</> versions will <emphasis>not</> work.
<acronym>GNU</> <application>make</> is often installed under <acronym>GNU</> <application>make</> is often installed under
the name <filename>gmake</filename>; this document will always the name <filename>gmake</filename>; this document will always
refer to it by that name. (On some systems refer to it by that name. (On some systems
...@@ -79,7 +79,6 @@ su - postgres ...@@ -79,7 +79,6 @@ su - postgres
<screen> <screen>
<userinput>gmake --version</userinput> <userinput>gmake --version</userinput>
</screen> </screen>
It is recommended to use version 3.79.1 or later.
</para> </para>
</listitem> </listitem>
......
...@@ -12,20 +12,21 @@ subdir = src ...@@ -12,20 +12,21 @@ subdir = src
top_builddir = .. top_builddir = ..
include Makefile.global include Makefile.global
SUBDIRS = \
port \
timezone \
backend \
backend/utils/mb/conversion_procs \
backend/snowball \
include \
interfaces \
backend/replication/libpqwalreceiver \
bin \
pl \
makefiles \
test/regress
all install installdirs uninstall distprep: $(recurse)
$(MAKE) -C port $@
$(MAKE) -C timezone $@
$(MAKE) -C backend $@
$(MAKE) -C backend/utils/mb/conversion_procs $@
$(MAKE) -C backend/snowball $@
$(MAKE) -C include $@
$(MAKE) -C interfaces $@
$(MAKE) -C backend/replication/libpqwalreceiver $@
$(MAKE) -C bin $@
$(MAKE) -C pl $@
$(MAKE) -C makefiles $@
$(MAKE) -C test/regress $@
install: install-local install: install-local
...@@ -46,31 +47,11 @@ uninstall-local: ...@@ -46,31 +47,11 @@ uninstall-local:
rm -f $(addprefix '$(DESTDIR)$(pgxsdir)/$(subdir)'/, Makefile.global Makefile.port Makefile.shlib nls-global.mk) rm -f $(addprefix '$(DESTDIR)$(pgxsdir)/$(subdir)'/, Makefile.global Makefile.port Makefile.shlib nls-global.mk)
clean: clean:
$(MAKE) -C port $@
$(MAKE) -C timezone $@
$(MAKE) -C backend $@
$(MAKE) -C backend/snowball $@
$(MAKE) -C include $@
$(MAKE) -C interfaces $@
$(MAKE) -C backend/replication/libpqwalreceiver $@
$(MAKE) -C bin $@
$(MAKE) -C pl $@
$(MAKE) -C makefiles $@
$(MAKE) -C test $@ $(MAKE) -C test $@
$(MAKE) -C tutorial NO_PGXS=1 $@ $(MAKE) -C tutorial NO_PGXS=1 $@
$(MAKE) -C test/thread $@ $(MAKE) -C test/thread $@
distclean maintainer-clean: distclean maintainer-clean:
$(MAKE) -C port $@
$(MAKE) -C timezone $@
$(MAKE) -C backend $@
$(MAKE) -C backend/snowball $@
$(MAKE) -C include $@
$(MAKE) -C interfaces $@
$(MAKE) -C backend/replication/libpqwalreceiver $@
$(MAKE) -C bin $@
$(MAKE) -C pl $@
$(MAKE) -C makefiles $@
$(MAKE) -C test $@ $(MAKE) -C test $@
$(MAKE) -C tutorial NO_PGXS=1 $@ $(MAKE) -C tutorial NO_PGXS=1 $@
$(MAKE) -C test/thread $@ $(MAKE) -C test/thread $@
......
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
# #
# Meta configuration # Meta configuration
.PHONY: all install install-strip installdirs uninstall clean distclean maintainer-clean distprep check installcheck maintainer-check coverage html man installcheck-parallel world install-world installcheck-world standard_targets = all install installdirs uninstall distprep clean distclean maintainer-clean coverage check installcheck
.PHONY: $(standard_targets) install-strip maintainer-check html man installcheck-parallel
# make `all' the default target # make `all' the default target
all: all:
...@@ -538,6 +540,48 @@ install-strip: ...@@ -538,6 +540,48 @@ install-strip:
install install
##########################################################################
#
# Recursive make support
# ----------------------
# Instead of recursing through subdirectories with a for loop or
# repeated $(MAKE) -C whatever calls, this is a little smarter: it
# allows parallel make across directories and lets make -k and -q work
# correctly.
# This function is only for internal use below. It should be called
# with $(eval). It will set up a target so that it recurses into
# subdirectories.
# $1: target name, e.g., all
# $2: list of subdirs
# $3: target to run in subdir, usually same as $1
define _create_recursive_target
.PHONY: $(patsubst %,$(1)-%-recursive,$(2))
$(1): $(patsubst %,$(1)-%-recursive,$(2))
$(2:%=$(1)-%-recursive):
$$(MAKE) -C $$(patsubst $(1)-%-recursive,%,$$@) $(3)
endef
# Note that the use of $$ on the last line above is important; we want
# those variables/functions to be evaluated when the rule is run, not
# when the $(eval) is run to create the rule. In the case of
# $$(MAKE), this is necessary to get make -q working.
# Call this function in a makefile. In the normal case it doesn't
# need any arguments.
# $1: targets to make recursive (defaults to list of standard targets)
# $2: list of subdirs (defaults to SUBDIRS variable)
# $3: target to run in subdir (defaults to $1)
recurse = $(foreach target,$(if $1,$1,$(standard_targets)),$(eval $(call _create_recursive_target,$(target),$(if $2,$2,$(SUBDIRS)),$(if $3,$3,$(target)))))
# We need the $(eval) function and order-only prerequisites, which are
# available in GNU make 3.80. That also happens to be the version
# where the .VARIABLES variable was introduced, so this is a simple
# check.
ifndef .VARIABLES
$(error GNU make 3.80 or newer is required. You are using version $(MAKE_VERSION))
endif
########################################################################## ##########################################################################
# #
# Automatic dependency generation # Automatic dependency generation
...@@ -640,7 +684,6 @@ lcov.info: $(gcda_files) ...@@ -640,7 +684,6 @@ lcov.info: $(gcda_files)
$(GCOV) -b -f -p -o . $(GCOVFLAGS) $*.c >$*.c.gcov.out $(GCOV) -b -f -p -o . $(GCOVFLAGS) $*.c >$*.c.gcov.out
coverage: $(gcda_files:.gcda=.c.gcov) lcov.info coverage: $(gcda_files:.gcda=.c.gcov) lcov.info
$(if $(SUBDIRS),for dir in $(SUBDIRS); do $(MAKE) -C $$dir coverage || exit; done)
.PHONY: coverage-html .PHONY: coverage-html
coverage-html: coverage coverage-html: coverage
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
# OBJS List of object files to include in library # OBJS List of object files to include in library
# SHLIB_LINK If shared library relies on other libraries, # SHLIB_LINK If shared library relies on other libraries,
# additional stuff to put in its link command # additional stuff to put in its link command
# SHLIB_PREREQS Order-only prerequisites for library build target
# SHLIB_EXPORTS (optional) Name of file containing list of symbols to # SHLIB_EXPORTS (optional) Name of file containing list of symbols to
# export, in the format "function_name number" # export, in the format "function_name number"
# #
...@@ -340,7 +341,7 @@ all-static-lib: $(stlib) ...@@ -340,7 +341,7 @@ all-static-lib: $(stlib)
all-shared-lib: $(shlib) all-shared-lib: $(shlib)
ifndef haslibarule ifndef haslibarule
$(stlib): $(OBJS) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
$(LINK.static) $@ $^ $(LINK.static) $@ $^
$(RANLIB) $@ $(RANLIB) $@
endif #haslibarule endif #haslibarule
...@@ -351,7 +352,7 @@ ifeq (,$(filter cygwin win32,$(PORTNAME))) ...@@ -351,7 +352,7 @@ ifeq (,$(filter cygwin win32,$(PORTNAME)))
ifneq ($(PORTNAME), aix) ifneq ($(PORTNAME), aix)
# Normal case # Normal case
$(shlib): $(OBJS) $(shlib): $(OBJS) | $(SHLIB_PREREQS)
$(LINK.shared) -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LINK.shared) -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK)
ifdef shlib_major ifdef shlib_major
# If we're using major and minor versions, then make a symlink to major-version-only. # If we're using major and minor versions, then make a symlink to major-version-only.
...@@ -382,7 +383,7 @@ endif ...@@ -382,7 +383,7 @@ endif
else # PORTNAME == aix else # PORTNAME == aix
# AIX case # AIX case
$(shlib) $(stlib): $(OBJS) $(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
$(LINK.static) $(stlib) $^ $(LINK.static) $(stlib) $^
$(RANLIB) $(stlib) $(RANLIB) $(stlib)
$(MKLDEXPORT) $(stlib) >$(exports_file) $(MKLDEXPORT) $(stlib) >$(exports_file)
...@@ -408,10 +409,10 @@ else ...@@ -408,10 +409,10 @@ else
DLL_DEFFILE = lib$(NAME)dll.def DLL_DEFFILE = lib$(NAME)dll.def
endif endif
$(shlib): $(OBJS) $(DLL_DEFFILE) $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS)
$(DLLWRAP) -o $@ --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(DLLWRAP) -o $@ --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK)
$(stlib): $(shlib) $(DLL_DEFFILE) $(stlib): $(shlib) $(DLL_DEFFILE) | $(SHLIB_PREREQS)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@ $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
endif # PORTNAME == cygwin || PORTNAME == win32 endif # PORTNAME == cygwin || PORTNAME == win32
......
...@@ -122,7 +122,9 @@ submake-schemapg: ...@@ -122,7 +122,9 @@ submake-schemapg:
.PHONY: submake-schemapg .PHONY: submake-schemapg
catalog/schemapg.h: submake-schemapg catalog/schemapg.h: | submake-schemapg
$(top_builddir)/src/port/libpgport_srv.a: | submake-libpgport
# The postgres.o target is needed by the rule in Makefile.global that # The postgres.o target is needed by the rule in Makefile.global that
......
...@@ -34,15 +34,13 @@ objfiles.txt: Makefile $(SUBDIROBJS) $(OBJS) ...@@ -34,15 +34,13 @@ objfiles.txt: Makefile $(SUBDIROBJS) $(OBJS)
expand_subsys = $(foreach file,$(1),$(if $(filter %/objfiles.txt,$(file)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file)))),$(file))) expand_subsys = $(foreach file,$(1),$(if $(filter %/objfiles.txt,$(file)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file)))),$(file)))
# Parallel make trickery # Parallel make trickery
$(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ; $(SUBDIROBJS): | $(SUBDIRS:%=%-recursive) ;
.PHONY: $(SUBDIRS:%=%-recursive) .PHONY: $(SUBDIRS:%=%-recursive)
$(SUBDIRS:%=%-recursive): $(SUBDIRS:%=%-recursive):
$(MAKE) -C $(subst -recursive,,$@) all $(MAKE) -C $(subst -recursive,,$@) all
$(call recurse,clean)
clean: clean-local clean: clean-local
clean-local: clean-local:
ifdef SUBDIRS
for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean || exit; done
endif
rm -f $(subsysfilename) $(OBJS) rm -f $(subsysfilename) $(OBJS)
...@@ -16,9 +16,10 @@ override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS) ...@@ -16,9 +16,10 @@ override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
OBJS = libpqwalreceiver.o OBJS = libpqwalreceiver.o
SHLIB_LINK = $(libpq) SHLIB_LINK = $(libpq)
SHLIB_PREREQS = submake-libpq
NAME = libpqwalreceiver NAME = libpqwalreceiver
all: submake-libpq all-shared-lib all: all-shared-lib
include $(top_srcdir)/src/Makefile.shlib include $(top_srcdir)/src/Makefile.shlib
......
...@@ -26,6 +26,8 @@ SUBDIRS = \ ...@@ -26,6 +26,8 @@ SUBDIRS = \
utf8_and_sjis utf8_and_win utf8_and_uhc \ utf8_and_sjis utf8_and_win utf8_and_uhc \
utf8_and_euc2004 utf8_and_sjis2004 euc2004_sjis2004 utf8_and_euc2004 utf8_and_sjis2004 euc2004_sjis2004
$(recurse)
# conversion_name source_encoding destination_encoding function object # conversion_name source_encoding destination_encoding function object
CONVERSIONS = \ CONVERSIONS = \
ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \ ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
...@@ -162,7 +164,6 @@ CONVERSIONS = \ ...@@ -162,7 +164,6 @@ CONVERSIONS = \
shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004 shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
all: $(SQLSCRIPT) all: $(SQLSCRIPT)
@for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done
$(SQLSCRIPT): Makefile $(SQLSCRIPT): Makefile
ifeq ($(enable_shared), yes) ifeq ($(enable_shared), yes)
...@@ -205,15 +206,12 @@ $(REGRESSION_SCRIPT): Makefile ...@@ -205,15 +206,12 @@ $(REGRESSION_SCRIPT): Makefile
install: $(SQLSCRIPT) installdirs install: $(SQLSCRIPT) installdirs
$(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)' $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
@for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done
installdirs: installdirs:
$(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)' $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
uninstall: uninstall:
rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)' rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
@for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f $(SQLSCRIPT) rm -f $(SQLSCRIPT)
@for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done
...@@ -19,5 +19,4 @@ ifeq ($(PORTNAME), win32) ...@@ -19,5 +19,4 @@ ifeq ($(PORTNAME), win32)
SUBDIRS+=pgevent SUBDIRS+=pgevent
endif endif
all install installdirs uninstall distprep clean distclean maintainer-clean: $(recurse)
@for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done
...@@ -20,9 +20,9 @@ override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) ...@@ -20,9 +20,9 @@ override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= initdb.o encnames.o pqsignal.o $(WIN32RES) OBJS= initdb.o encnames.o pqsignal.o $(WIN32RES)
all: submake-libpgport initdb all: initdb
initdb: $(OBJS) initdb: $(OBJS) | submake-libpgport
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
# We used to pull in all of libpq to get encnames and pqsignal, but that # We used to pull in all of libpq to get encnames and pqsignal, but that
......
...@@ -31,9 +31,9 @@ override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\"" ...@@ -31,9 +31,9 @@ override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
override CPPFLAGS += -DVAL_LDFLAGS_SL="\"$(LDFLAGS_SL)\"" override CPPFLAGS += -DVAL_LDFLAGS_SL="\"$(LDFLAGS_SL)\""
override CPPFLAGS += -DVAL_LIBS="\"$(LIBS)\"" override CPPFLAGS += -DVAL_LIBS="\"$(LIBS)\""
all: submake-libpgport pg_config all: pg_config
pg_config: $(OBJS) pg_config: $(OBJS) | submake-libpgport
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs install: all installdirs
......
...@@ -17,9 +17,9 @@ include $(top_builddir)/src/Makefile.global ...@@ -17,9 +17,9 @@ include $(top_builddir)/src/Makefile.global
OBJS= pg_controldata.o pg_crc.o $(WIN32RES) OBJS= pg_controldata.o pg_crc.o $(WIN32RES)
all: submake-libpgport pg_controldata all: pg_controldata
pg_controldata: $(OBJS) pg_controldata: $(OBJS) | submake-libpgport
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
......
...@@ -20,9 +20,9 @@ override CPPFLAGS := -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS) ...@@ -20,9 +20,9 @@ override CPPFLAGS := -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= pg_ctl.o $(WIN32RES) OBJS= pg_ctl.o $(WIN32RES)
all: submake-libpq submake-libpgport pg_ctl all: pg_ctl
pg_ctl: $(OBJS) $(libpq_builddir)/libpq.a pg_ctl: $(OBJS) | submake-libpq submake-libpgport
$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs install: all installdirs
......
...@@ -27,15 +27,15 @@ KEYWRDOBJS = keywords.o kwlookup.o ...@@ -27,15 +27,15 @@ KEYWRDOBJS = keywords.o kwlookup.o
kwlookup.c: % : $(top_srcdir)/src/backend/parser/% kwlookup.c: % : $(top_srcdir)/src/backend/parser/%
rm -f $@ && $(LN_S) $< . rm -f $@ && $(LN_S) $< .
all: submake-libpq submake-libpgport pg_dump pg_restore pg_dumpall all: pg_dump pg_restore pg_dumpall
pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(KEYWRDOBJS) $(libpq_builddir)/libpq.a pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(KEYWRDOBJS) | submake-libpq submake-libpgport
$(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
pg_restore: pg_restore.o $(OBJS) $(KEYWRDOBJS) $(libpq_builddir)/libpq.a pg_restore: pg_restore.o $(OBJS) $(KEYWRDOBJS) | submake-libpq submake-libpgport
$(CC) $(CFLAGS) pg_restore.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) pg_restore.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
pg_dumpall: pg_dumpall.o dumputils.o $(KEYWRDOBJS) $(libpq_builddir)/libpq.a pg_dumpall: pg_dumpall.o dumputils.o $(KEYWRDOBJS) | submake-libpq submake-libpgport
$(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(KEYWRDOBJS) $(WIN32RES) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(KEYWRDOBJS) $(WIN32RES) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs install: all installdirs
......
...@@ -17,9 +17,9 @@ include $(top_builddir)/src/Makefile.global ...@@ -17,9 +17,9 @@ include $(top_builddir)/src/Makefile.global
OBJS= pg_resetxlog.o pg_crc.o $(WIN32RES) OBJS= pg_resetxlog.o pg_crc.o $(WIN32RES)
all: submake-libpgport pg_resetxlog all: pg_resetxlog
pg_resetxlog: $(OBJS) pg_resetxlog: $(OBJS) | submake-libpgport
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
......
...@@ -29,9 +29,9 @@ OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \ ...@@ -29,9 +29,9 @@ OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
FLEXFLAGS = -Cfe FLEXFLAGS = -Cfe
all: submake-libpq submake-libpgport psql all: psql
psql: $(OBJS) $(libpq_builddir)/libpq.a psql: $(OBJS) | submake-libpq submake-libpgport
$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
help.o: sql_help.h help.o: sql_help.h
......
...@@ -20,20 +20,20 @@ PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vac ...@@ -20,20 +20,20 @@ PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vac
override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS) override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
all: submake-libpq $(PROGRAMS) all: $(PROGRAMS)
%: %.o $(WIN32RES) %: %.o $(WIN32RES)
$(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
createdb: createdb.o common.o dumputils.o kwlookup.o keywords.o createdb: createdb.o common.o dumputils.o kwlookup.o keywords.o | submake-libpq
createlang: createlang.o common.o print.o mbprint.o createlang: createlang.o common.o print.o mbprint.o | submake-libpq
createuser: createuser.o common.o dumputils.o kwlookup.o keywords.o createuser: createuser.o common.o dumputils.o kwlookup.o keywords.o | submake-libpq
dropdb: dropdb.o common.o dumputils.o kwlookup.o keywords.o dropdb: dropdb.o common.o dumputils.o kwlookup.o keywords.o | submake-libpq
droplang: droplang.o common.o print.o mbprint.o droplang: droplang.o common.o print.o mbprint.o | submake-libpq
dropuser: dropuser.o common.o dumputils.o kwlookup.o keywords.o dropuser: dropuser.o common.o dumputils.o kwlookup.o keywords.o | submake-libpq
clusterdb: clusterdb.o common.o dumputils.o kwlookup.o keywords.o clusterdb: clusterdb.o common.o dumputils.o kwlookup.o keywords.o | submake-libpq
vacuumdb: vacuumdb.o common.o vacuumdb: vacuumdb.o common.o | submake-libpq
reindexdb: reindexdb.o common.o dumputils.o kwlookup.o keywords.o reindexdb: reindexdb.o common.o dumputils.o kwlookup.o keywords.o | submake-libpq
dumputils.c keywords.c: % : $(top_srcdir)/src/bin/pg_dump/% dumputils.c keywords.c: % : $(top_srcdir)/src/bin/pg_dump/%
rm -f $@ && $(LN_S) $< . rm -f $@ && $(LN_S) $< .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment