summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2010-11-12 22:15:16 +0200
committerPeter Eisentraut <peter_e@gmx.net>2010-11-12 22:15:16 +0200
commit19e231bbdaef792dce22100012b504e2fb72f971 (patch)
tree011823e7b1b882972eaff7c4f3a6b18571030e4a /src/interfaces/ecpg
parentd6754f67b08ad6a05640fc5d9d97c6f225512ea0 (diff)
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.
Diffstat (limited to 'src/interfaces/ecpg')
-rw-r--r--src/interfaces/ecpg/Makefile16
-rw-r--r--src/interfaces/ecpg/compatlib/Makefile9
-rw-r--r--src/interfaces/ecpg/ecpglib/Makefile9
-rw-r--r--src/interfaces/ecpg/preproc/Makefile7
4 files changed, 23 insertions, 18 deletions
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