From 19e231bbdaef792dce22100012b504e2fb72f971 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 12 Nov 2010 22:15:16 +0200 Subject: 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. --- src/interfaces/Makefile | 3 +-- src/interfaces/ecpg/Makefile | 16 +++++----------- src/interfaces/ecpg/compatlib/Makefile | 9 +++++++++ src/interfaces/ecpg/ecpglib/Makefile | 9 ++++----- src/interfaces/ecpg/preproc/Makefile | 7 +++++-- 5 files changed, 24 insertions(+), 20 deletions(-) (limited to 'src/interfaces') diff --git a/src/interfaces/Makefile b/src/interfaces/Makefile index f208a28919b..2c034bc7923 100644 --- a/src/interfaces/Makefile +++ b/src/interfaces/Makefile @@ -14,5 +14,4 @@ include $(top_builddir)/src/Makefile.global SUBDIRS = libpq ecpg -all install installdirs uninstall distprep clean distclean maintainer-clean: - @for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done +$(recurse) diff --git a/src/interfaces/ecpg/Makefile b/src/interfaces/ecpg/Makefile index 71bfff672d7..d955ceed1c9 100644 --- a/src/interfaces/ecpg/Makefile +++ b/src/interfaces/ecpg/Makefile @@ -2,19 +2,13 @@ subdir = src/interfaces/ecpg top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -all install installdirs uninstall distprep: - $(MAKE) -C include $@ - $(MAKE) -C pgtypeslib $@ - $(MAKE) -C ecpglib $@ - $(MAKE) -C compatlib $@ - $(MAKE) -C preproc $@ +SUBDIRS = include pgtypeslib ecpglib compatlib preproc + +$(recurse) + +all-compatlib-recursive: all-ecpglib-recursive clean distclean maintainer-clean: - $(MAKE) -C include $@ - $(MAKE) -C pgtypeslib $@ - $(MAKE) -C ecpglib $@ - $(MAKE) -C compatlib $@ - $(MAKE) -C preproc $@ $(MAKE) -C test clean check checktcp installcheck: all diff --git a/src/interfaces/ecpg/compatlib/Makefile b/src/interfaces/ecpg/compatlib/Makefile index d211b7d20a7..eb9a76ae74b 100644 --- a/src/interfaces/ecpg/compatlib/Makefile +++ b/src/interfaces/ecpg/compatlib/Makefile @@ -23,6 +23,7 @@ override CFLAGS += $(PTHREAD_CFLAGS) SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \ $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS) +SHLIB_PREREQS = submake-ecpglib submake-pgtypeslib SHLIB_EXPORTS = exports.txt @@ -33,6 +34,14 @@ OBJS= informix.o $(filter snprintf.o, $(LIBOBJS)) all: all-lib +.PHONY: submake-ecpglib submake-pgtypeslib + +submake-ecpglib: + $(MAKE) -C $(top_builddir)/src/interfaces/ecpg/ecpglib all + +submake-pgtypeslib: + $(MAKE) -C $(top_builddir)/src/interfaces/ecpg/pgtypeslib all + # Shared library stuff include $(top_srcdir)/src/Makefile.shlib diff --git a/src/interfaces/ecpg/ecpglib/Makefile b/src/interfaces/ecpg/ecpglib/Makefile index 7d134acd7f3..9a29d150c7e 100644 --- a/src/interfaces/ecpg/ecpglib/Makefile +++ b/src/interfaces/ecpg/ecpglib/Makefile @@ -34,6 +34,7 @@ OBJS += thread.o endif SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS) +SHLIB_PREREQS = submake-libpq submake-pgtypeslib SHLIB_EXPORTS = exports.txt @@ -42,12 +43,10 @@ ifeq ($(PORTNAME), win32) SHLIB_LINK += -lshfolder endif -all: libpq pgtypeslib all-lib +all: all-lib -libpq: - $(MAKE) -C $(top_builddir)/src/interfaces/libpq all - -pgtypeslib: +.PHONY: submake-pgtypeslib +submake-pgtypeslib: $(MAKE) -C $(top_builddir)/src/interfaces/ecpg/pgtypeslib all # Shared library stuff diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index 8978eeb241f..e8a6916faa8 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -30,11 +30,14 @@ OBJS= preproc.o type.o ecpg.o output.o parser.o \ keywords.o c_keywords.o ecpg_keywords.o kwlookup.o ../ecpglib/typename.o descriptor.o variable.o \ $(WIN32RES) -all: submake-libpgport ecpg +all: ecpg -ecpg: $(OBJS) +ecpg: $(OBJS) | submake-libpgport $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $^ $(LIBS) $(PTHREAD_LIBS) -o $@$(X) +../ecpglib/typename.o: ../ecpglib/typename.c + $(MAKE) -C $(dir $@) $(notdir $@) + # pgc is compiled as part of preproc preproc.o: pgc.c -- cgit v1.2.3