Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14d309c

Browse files
committed
Fix missing dependencies in ecpg's test Makefiles.
Ensure that ecpg preprocessor output files are rebuilt when re-testingafter a change in the ecpg preprocessor itself, or a change in any ofseveral include files that get copied verbatim into the output files.The lack of these dependencies was what created problems for Kevin Grittnerafter the recent pgindent run. There's no way for --enable-depend todiscover these dependencies automatically, so we've gotta put them intothe Makefiles by hand.While at it, reduce the amount of duplication in the ecpg invocations.
1 parentfb1974c commit14d309c

File tree

4 files changed

+31
-38
lines changed

4 files changed

+31
-38
lines changed
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
1+
# This file is included into the Makefiles of subdirectories of ecpg/test/,
2+
# so the file references have one more level of .. than you might expect.
3+
14
override CPPFLAGS := -I../../include -I$(top_srcdir)/src/interfaces/ecpg/include \
25
-I$(libpq_srcdir) $(CPPFLAGS)
36
override CFLAGS += $(PTHREAD_CFLAGS)
47

58
override LDFLAGS := -L../../ecpglib -L../../pgtypeslib $(filter-out -l%, $(libpq)) $(LDFLAGS)
69
override LIBS := -lecpg -lpgtypes $(filter -l%, $(libpq)) $(LIBS) $(PTHREAD_LIBS)
710

8-
ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include
11+
# Standard way to invoke the ecpg preprocessor
12+
ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include -I$(srcdir)
13+
14+
# Files that most or all ecpg preprocessor test outputs depend on
15+
ECPG_TEST_DEPENDENCIES = ../../preproc/ecpg \
16+
$(srcdir)/../regression.h \
17+
$(srcdir)/../../include/sqlca.h \
18+
$(srcdir)/../../include/sqlda.h \
19+
$(srcdir)/../../include/sqltypes.h \
20+
$(srcdir)/../../include/sql3types.h
921

1022
%: %.o
1123
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
1224

13-
%.c: %.pgc ../regression.h
14-
$(ECPG) -o $@ -I$(srcdir) $<
25+
# Caution: this build rule is overridden in some child Makefiles
26+
# where it's necessary to use nondefault switches to ecpg;
27+
# make sure those rules match except for the extra switches.
28+
%.c: %.pgc $(ECPG_TEST_DEPENDENCIES)
29+
$(ECPG) -o $@ $<
1530

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

‎src/interfaces/ecpg/test/compat_informix/Makefile

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ top_builddir = ../../../../..
33
include$(top_builddir)/src/Makefile.global
44
include$(top_srcdir)/$(subdir)/../Makefile.regress
55

6-
# special informix compatibilityswitches
6+
#Usespecial informix compatibilityswitch for all tests in this directory
77
ECPG += -C INFORMIX
8-
ECPG_NOIND =$(ECPG) -r no_indicator
98

109
overrideLDFLAGS := -L../../compatlib$(LDFLAGS)
1110
overrideLIBS := -lecpg_compat$(LIBS)
@@ -22,26 +21,5 @@ TESTS = test_informix test_informix.c \
2221

2322
all:$(TESTS)
2423

25-
test_informix.c: test_informix.pgc ../regression.h
26-
$(ECPG) -o$@ -I$(srcdir)$<
27-
28-
test_informix2.c: test_informix2.pgc ../regression.h
29-
$(ECPG) -o$@ -I$(srcdir)$<
30-
31-
sqlda.c: sqlda.pgc ../regression.h
32-
$(ECPG) -o$@ -I$(srcdir)$<
33-
34-
dec_test.c: dec_test.pgc ../regression.h
35-
$(ECPG) -o$@ -I$(srcdir)$<
36-
37-
rfmtdate.c: rfmtdate.pgc ../regression.h
38-
$(ECPG) -o$@ -I$(srcdir)$<
39-
40-
rfmtlong.c: rfmtlong.pgc ../regression.h
41-
$(ECPG) -o$@ -I$(srcdir)$<
42-
43-
rnull.c: rnull.pgc ../regression.h
44-
$(ECPG_NOIND) -o$@ -I$(srcdir)$<
45-
46-
charfuncs.c: charfuncs.pgc ../regression.h
47-
$(ECPG) -o$@ -I$(srcdir)$<
24+
rnull.c: rnull.pgc$(ECPG_TEST_DEPENDENCIES)
25+
$(ECPG) -r no_indicator -o$@$<

‎src/interfaces/ecpg/test/preproc/Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ TESTS = array_of_struct array_of_struct.c \
1919

2020
all:$(TESTS)
2121

22-
array_of_struct.c:array_of_struct.pgc../regression.h
23-
$(ECPG) -c -o$@-I$(srcdir)$<
22+
array_of_struct.c:array_of_struct.pgc$(ECPG_TEST_DEPENDENCIES)
23+
$(ECPG) -c -o$@$<
2424

25-
pointer_to_struct.c:pointer_to_struct.pgc../regression.h
26-
$(ECPG) -c -o$@-I$(srcdir)$<
25+
pointer_to_struct.c:pointer_to_struct.pgc$(ECPG_TEST_DEPENDENCIES)
26+
$(ECPG) -c -o$@$<
2727

28-
autoprep.c:autoprep.pgc../regression.h
29-
$(ECPG) -r prepare -o$@-I$(srcdir)$<
28+
autoprep.c: autoprep.pgc$(ECPG_TEST_DEPENDENCIES)
29+
$(ECPG) -r prepare -o$@$<
3030

31-
strings.c:strings.pgc strings.h../regression.h
32-
$(ECPG) -i -o$@-I$(srcdir)$<
31+
strings.c: strings.pgc strings.h$(ECPG_TEST_DEPENDENCIES)
32+
$(ECPG) -i -o$@$<

‎src/interfaces/ecpg/test/sql/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ TESTS = array array.c \
2626

2727
all:$(TESTS)
2828

29-
oldexec.c:oldexec.pgc../regression.h
30-
$(ECPG) -r questionmarks -o$@-I$(srcdir)$<
29+
oldexec.c:oldexec.pgc$(ECPG_TEST_DEPENDENCIES)
30+
$(ECPG) -r questionmarks -o$@$<

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp