Skip to content

Commit 9010e0e

Browse files
author
Bryan Henderson
committed
Rename Makefile to GNUMakefile and add a "use GNU Make" Makefile so people
don't accidentally use non-GNU make.
1 parent fdcf8b6 commit 9010e0e

File tree

2 files changed

+106
-92
lines changed

2 files changed

+106
-92
lines changed

src/test/regress/GNUMakefile

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#-------------------------------------------------------------------------
2+
#
3+
# Makefile--
4+
# Makefile for regress (the regression test)
5+
#
6+
# Copyright (c) 1994, Regents of the University of California
7+
#
8+
#
9+
# IDENTIFICATION
10+
# $Header: /cvsroot/pgsql/src/test/regress/Attic/GNUMakefile,v 1.1 1997/01/18 08:01:30 bryanh Exp $
11+
#
12+
#-------------------------------------------------------------------------
13+
14+
SRCDIR= ../..
15+
include ../../Makefile.global
16+
17+
CFLAGS+= -I$(LIBPQDIR) -I../../include
18+
19+
LDADD+= -L$(LIBPQDIR) -lpq
20+
21+
#
22+
# DLOBJS is the dynamically-loaded object file. The regression test uses
23+
# this when it does a CREATE FUNCTION ... LANGUAGE 'C').
24+
#
25+
DLOBJS= regress$(DLSUFFIX)
26+
27+
#
28+
# ... plus test query inputs
29+
#
30+
# INFILES is the files the regression test uses for input.
31+
INFILES= $(DLOBJS) \
32+
create.sql queries.sql errors.sql destroy.sql security.sql \
33+
expected.out
34+
#
35+
# plus exports files
36+
#
37+
ifdef EXPSUFF
38+
INFILES+= $(DLOBJS:.o=$(EXPSUFF))
39+
endif
40+
41+
# OUTFILES is the files that get created by running the regression test.
42+
OUTFILES= stud_emp.data onek.data regress.out aportal.out
43+
44+
#
45+
# prepare to run the test (including clean-up after the last run)
46+
#
47+
all: $(INFILES)
48+
rm -f $(OUTFILES)
49+
50+
#
51+
# run the test
52+
#
53+
runtest: $(INFILES) expected.out
54+
$(SHELL) ./regress.sh 2>&1 | tee regress.out
55+
@echo "ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILE regress.out"
56+
57+
# The expected.input file is part of the distribution. It was made by hand
58+
# from 'regress.out' from a reference run of the regression test, replacing
59+
# installation-dependent things with names like _CWD_. The following rule
60+
# turns those names back into real values for the instant installation to
61+
# create a standard (expected.out) against which to compare regress.out
62+
# from the experimental run.
63+
#
64+
#
65+
expected.out: expected.input
66+
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
67+
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
68+
if [ -z "$$USER" ]; then echo 'Cannot deduce $USER.'; exit 1; fi; \
69+
rm -f expected.out; \
70+
MYTZ=`date | cut -c21`; \
71+
C="`pwd`"; \
72+
sed -e "s:_CWD_:$$C:g" \
73+
-e "s:_OBJWD_:$$C:g" \
74+
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
75+
-e "s;\([A-Z][a-z][a-z][^ ]* [A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9] \)[A-Z]\([A-Z][A-Z]\);\1$$MYTZ\2;g" \
76+
-e "s;\([A-Z][a-z][a-z][^ ]* [A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] \)[A-Z]\([A-Z][A-Z] [0-9][0-9][0-9][0-9]\);\1$$MYTZ\2;g" \
77+
-e "s:_USER_:$$USER:g" < expected.input > expected.out
78+
@echo "YOUR EXPECTED RESULTS ARE NOW IN FILE expected.out."
79+
80+
%.sql: %.source
81+
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
82+
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
83+
if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
84+
rm -f $@; \
85+
C=`pwd`; \
86+
sed -e "s:_CWD_:$$C:g" \
87+
-e "s:_OBJWD_:$$C:g" \
88+
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
89+
-e "s/_USER_/$$USER/g" < $< > $@
90+
91+
clean:
92+
rm -f $(INFILES)
93+
rm -f $(OUTFILES)
94+

src/test/regress/Makefile

Lines changed: 12 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,12 @@
1-
#-------------------------------------------------------------------------
2-
#
3-
# Makefile--
4-
# Makefile for regress (the regression test)
5-
#
6-
# Copyright (c) 1994, Regents of the University of California
7-
#
8-
#
9-
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/test/regress/Makefile,v 1.12 1997/01/05 21:17:36 bryanh Exp $
11-
#
12-
#-------------------------------------------------------------------------
13-
14-
SRCDIR= ../..
15-
include ../../Makefile.global
16-
17-
CFLAGS+= -I$(LIBPQDIR) -I../../include
18-
19-
#
20-
# DLOBJS is the dynamically-loaded object file. The regression test uses
21-
# this when it does a CREATE FUNCTION ... LANGUAGE 'C').
22-
#
23-
DLOBJS= regress$(DLSUFFIX)
24-
25-
#
26-
# ... plus test query inputs
27-
#
28-
# INFILES is the files the regression test uses for input.
29-
INFILES= $(DLOBJS) \
30-
create.sql queries.sql errors.sql destroy.sql security.sql \
31-
expected.out
32-
#
33-
# plus exports files
34-
#
35-
ifdef EXPSUFF
36-
INFILES+= $(DLOBJS:.o=$(EXPSUFF))
37-
endif
38-
39-
# OUTFILES is the files that get created by running the regression test.
40-
OUTFILES= stud_emp.data onek.data regress.out aportal.out
41-
42-
#
43-
# prepare to run the test (including clean-up after the last run)
44-
#
45-
all: $(INFILES)
46-
rm -f $(OUTFILES)
47-
48-
#
49-
# run the test
50-
#
51-
runtest: $(INFILES) expected.out
52-
$(SHELL) ./regress.sh 2>&1 | tee regress.out
53-
@echo "ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILE regress.out"
54-
55-
# The expected.input file is part of the distribution. It was made by hand
56-
# from 'regress.out' from a reference run of the regression test, replacing
57-
# installation-dependent things with names like _CWD_. The following rule
58-
# turns those names back into real values for the instant installation to
59-
# create a standard (expected.out) against which to compare regress.out
60-
# from the experimental run.
61-
#
62-
#
63-
expected.out: expected.input
64-
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
65-
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
66-
if [ -z "$$USER" ]; then echo 'Cannot deduce $USER.'; exit 1; fi; \
67-
rm -f expected.out; \
68-
MYTZ=`date | cut -c21`; \
69-
C="`pwd`"; \
70-
sed -e "s:_CWD_:$$C:g" \
71-
-e "s:_OBJWD_:$$C:g" \
72-
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
73-
-e "s;\([A-Z][a-z][a-z][^ ]* [A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9] \)[A-Z]\([A-Z][A-Z]\);\1$$MYTZ\2;g" \
74-
-e "s;\([A-Z][a-z][a-z][^ ]* [A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] \)[A-Z]\([A-Z][A-Z] [0-9][0-9][0-9][0-9]\);\1$$MYTZ\2;g" \
75-
-e "s:_USER_:$$USER:g" < expected.input > expected.out
76-
@echo "YOUR EXPECTED RESULTS ARE NOW IN FILE expected.out."
77-
78-
%.sql: %.source
79-
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
80-
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
81-
if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
82-
rm -f $@; \
83-
C=`pwd`; \
84-
sed -e "s:_CWD_:$$C:g" \
85-
-e "s:_OBJWD_:$$C:g" \
86-
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
87-
-e "s/_USER_/$$USER/g" < $< > $@
88-
89-
clean:
90-
rm -f $(INFILES)
91-
rm -f $(OUTFILES)
92-
1+
# The Postgres make files exploit features of GNU make that other makes
2+
# do not have. Because it is a common mistake for users to try to build
3+
# Postgres with a different make, we have this make file that does nothing
4+
# but tell the user to use GNU make.
5+
6+
# If the user were using GNU make now, this file would not get used because
7+
# GNU make uses a make file named "GNUmakefile" in preference to "Makefile"
8+
# if it exists. Postgres is shipped with a "GNUmakefile".
9+
10+
all install clean dep depend:
11+
@echo "You must use GNU make to use Postgres. It may be installed"
12+
@echo "on your system with the name 'gmake'."

0 commit comments

Comments
 (0)