summaryrefslogtreecommitdiffstats
path: root/src/interfaces/ecpg/test/Makefile.regress
blob: b0647cd2c5fdfd0c5565fc27b3436ddb0845b8d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This file is included into the Makefiles of subdirectories of ecpg/test/,
# so the file references have one more level of .. than you might expect.

override CPPFLAGS := -I../../include -I$(top_srcdir)/src/interfaces/ecpg/include \
	-I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)

LDFLAGS_INTERNAL += -L../../ecpglib -lecpg -L../../pgtypeslib -lpgtypes $(libpq)

override LIBS += $(PTHREAD_LIBS)

# Standard way to invoke the ecpg preprocessor
ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include -I$(srcdir)

# Files that most or all ecpg preprocessor test outputs depend on
ECPG_TEST_DEPENDENCIES = ../../preproc/ecpg$(X) \
	$(srcdir)/../regression.h \
	$(srcdir)/../printf_hack.h \
	$(srcdir)/../../include/sqlca.h \
	$(srcdir)/../../include/sqlda.h \
	$(srcdir)/../../include/sqltypes.h \
	$(srcdir)/../../include/sql3types.h

# Caution: this build rule is overridden in some child Makefiles
# where it's necessary to use nondefault switches to ecpg;
# make sure those rules match except for the extra switches.
%.c: %.pgc $(ECPG_TEST_DEPENDENCIES)
	$(ECPG) -o $@ $<

clean:
	rm -f $(TESTS) $(TESTS:%=%.o) $(TESTS:%=%.c)