Fix ecpg test building process to not generate *.dSYM junk on Macs.
authorTom Lane <[email protected]>
Wed, 20 Oct 2010 04:55:07 +0000 (00:55 -0400)
committerTom Lane <[email protected]>
Wed, 20 Oct 2010 04:55:07 +0000 (00:55 -0400)
The trick is to not try to build executables directly from .c files,
but to always build the intermediate .o files.  For obscure reasons,
Darwin's version of gcc will leave debug cruft behind in the first
case but not the second.  Per complaint from Robert Haas.

src/interfaces/ecpg/test/Makefile.regress

index 847cded5b15a6a0a22f67cffced232a4c34e43d6..c979bf6f901416070191908984fad4390281a276 100644 (file)
@@ -8,7 +8,8 @@ override LIBS := -lecpg -lpgtypes $(filter -l%, $(libpq)) $(LIBS) $(PTHREAD_LIBS
 ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include
 
 %: %.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
+       $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o
+       $(CC) $(CPPFLAGS) $(CFLAGS) $*.o $(LDFLAGS) $(LIBS) -o $@
 
 %.c: %.pgc ../regression.h
        $(ECPG) -o $@ -I$(srcdir) $<