]> granicus.if.org Git - postgresql/commitdiff
ecpg: Improve test building
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 2 Feb 2012 18:24:38 +0000 (20:24 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 2 Feb 2012 18:33:29 +0000 (20:33 +0200)
Further improve on commit c75e1436467f32a06b5ab9d594d2a390e7f4594d.
Instead of building both .o files and binaries in the same make rule,
just rely on the normal .c -> .o rule.  This will ensure that
dependency tracking is used when enabled.  To do this, disable the
implicit direct .c -> binary rule globally, which will also prevent
the original problem (*.dSYM junk) from reappearing elsewhere.

src/Makefile.global.in
src/interfaces/ecpg/test/Makefile.regress

index 3bf658d6b0c879076722a7faf7f213aa9a4eabbc..26b2d5e4a9b8794955f5b531de61b7961cb10446 100644 (file)
@@ -515,6 +515,12 @@ TAS         = @TAS@
 %.bz2: %
        $(BZIP2) -c $< >$@
 
+# Direct builds of foo.c -> foo are disabled to avoid generating
+# *.dSYM junk on Macs.  All builds should normally go through the
+# foo.c -> foo.o -> foo steps.  This also ensures that dependency
+# tracking (see below) is used.
+%: %.c
+
 ifndef PGXS
 
 # Remake Makefile.global from Makefile.global.in if the latter
index b2417081ee080c8217e30d9e8b5c3691497f8103..edfece07df6dbd8dd73680ca672ce2ff0cae2ab6 100644 (file)
@@ -7,9 +7,8 @@ override LIBS := -lecpg -lpgtypes $(filter -l%, $(libpq)) $(LIBS) $(PTHREAD_LIBS
 
 ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include
 
-%: %.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o
-       $(CC) $(CPPFLAGS) $(CFLAGS) $*.o $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
+%: %.o
+       $(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
 
 %.c: %.pgc ../regression.h
        $(ECPG) -o $@ -I$(srcdir) $<