1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

End of the make file simplifications.

This commit is contained in:
Bryan Henderson
1996-11-12 11:43:32 +00:00
parent 594525aec1
commit d7dd9295b7
13 changed files with 260 additions and 268 deletions

View File

@ -7,12 +7,10 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/Makefile,v 1.1.1.1 1996/07/09 06:22:20 scrappy Exp $
# $Header: /cvsroot/pgsql/src/test/Makefile,v 1.2 1996/11/12 11:42:41 bryanh Exp $
#
#-------------------------------------------------------------------------
SUBDIR= bench regress
include ../mk/postgres.subdir.mk
.DEFAULT all:
$(MAKE) -C bench $@
$(MAKE) -C regress $@

View File

@ -7,56 +7,52 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/bench/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:21 scrappy Exp $
# $Header: /cvsroot/pgsql/src/test/bench/Attic/Makefile,v 1.2 1996/11/12 11:42:49 bryanh Exp $
#
#-------------------------------------------------------------------------
MKDIR= ../../mk
include $(MKDIR)/postgres.mk
SRCDIR= ../..
LIBPQDIR= $(SRCDIR)/libpq
include ../../Makefile.global
CREATEFILES= create.sql bench.sql
include $(MKDIR)/postgres.user.mk
OUTFILES= bench.out bench.out.perquery
CLEANFILES+= $(CREATEFILES) $(OUTFILES)
CFLAGS+= -I$(LIBPQDIR) $(CFLAGS_SL)
all: $(CREATEFILES)
rm -f $(OUTFILES)
create.sql: create.source
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
rm -f $@; \
C=`pwd`; \
sed -e "s:_CWD_:$$C:g" \
-e "s:_OBJWD_:$$C:g" \
-e "s:_SLSUFF_:$(SLSUFF):g" \
-e "s/_USER_/$$USER/g" < $< > $@
bench.sql:
cat > $(objdir)/$@ < /dev/null
x=1; \
for i in `ls query[0-9][0-9]`; do \
echo "select $$x as x" >> $(objdir)/$@; \
cat $$i >> $(objdir)/$@; \
x=`expr $$x + 1`; \
echo "select $$x as x" >> bench.sql; \
cat $$i >> bench.sql; \
x=`expr $$x + 1`; \
done
bench2.pq:
cat > ${.TARGET} < /dev/null
C=`pwd`; cd ${.CURDIR}; \
for i in 1 2 3 4 5 6; do \
echo "select timeofday();" >> $$C/${.TARGET}; \
done; \
x=1; \
for i in `ls query[0-9][0-9]`; do \
echo "select $$x as x;" >> $$C/${.TARGET}; \
echo "select timeofday();" >> $$C/${.TARGET}; \
cat $$i >> $$C/${.TARGET}; \
echo "select timeofday();" >> $$C/${.TARGET}; \
x=`expr $$x + 1`; \
done
runtest: $(OUTFILES)
bench.out: $(CREATEFILES)
$(SHELL) ./create.sh && \
$(SHELL) ./runwisc.sh > $(objdir)/$@ 2>&1
@echo "RESULTS OF BENCHMARK ARE SAVED IN ${MAKEOBJDIR}/bench.out";
$(SHELL) ./runwisc.sh >bench.out 2>&1
@echo "RESULTS OF BENCHMARK ARE SAVED IN FILE bench.out";
bench.out.perquery: bench.out
$(SHELL) ./perquery < $(objdir)/bench.out 2>&1 > $@
@echo "BREAKDOWN OF BENCHMARK IS SAVED IN ${MAKEOBJDIR}/bench.out.perquery";
$(SHELL) ./perquery <bench.out 2>&1 > $@
@echo "BREAKDOWN OF BENCHMARK IS SAVED IN FILE" \
"bench.out.perquery";
all:: $(CREATEFILES)
rm -f $(OUTFILES)
runtest: ${OUTFILES}
clean:
rm -f $(OUTFILES) $(CREATEFILES)

View File

@ -2,14 +2,13 @@
# Makefile for example programs
#
MKDIR= ../../mk
include $(MKDIR)/postgres.mk
SRCDIR= ../..
LIBPQDIR= $(SRCDIR)/libpq
include ../../Makefile.global
CFLAGS+= -I$(HEADERDIR) -I$(srcdir)/backend -I$(srcdir)/backend/include
CFLAGS+= -I$(LIBPQDIR)
LIBPQ:= -L$(LIBDIR) -lpq
LD_ADD+=$(LIBPQ)
LD_ADD+= -L$(LIBPQDIR) -lpq
#
# And where libpq goes, so goes the authentication stuff...
@ -19,56 +18,12 @@ LD_ADD+= $(KRBLIBS)
CFLAGS+= $(KRBFLAGS)
endif
P1_PROG:= testlibpq
P1_OBJS:= testlibpq.o
$(P1_PROG): $(addprefix $(objdir)/,$(P1_OBJS))
$(CC) $(CFLAGS) -o $(objdir)/$(@F) $< $(LD_ADD)
P2_PROG:= testlibpq2
P2_OBJS:= testlibpq2.o
$(P2_PROG): $(addprefix $(objdir)/,$(P2_OBJS))
$(CC) $(CFLAGS) -o $(objdir)/$(@F) $< $(LD_ADD)
P3_PROG:= testlibpq3
P3_OBJS:= testlibpq3.o
$(P3_PROG): $(addprefix $(objdir)/,$(P3_OBJS))
$(CC) $(CFLAGS) -o $(objdir)/$(@F) $< $(LD_ADD)
P4_PROG:= testlo
P4_OBJS:= testlo.o
$(P4_PROG): $(addprefix $(objdir)/,$(P4_OBJS))
$(CC) $(CFLAGS) -o $(objdir)/$(@F) $< $(LD_ADD)
OBJS:= $(P1_OBJS) $(P2_OBJS) $(P3_OBJS) $(P4_OBJS)
PROGS:= $(P1_PROG) $(P2_PROG) $(P3_PROG) $(P4_PROG)
CLEANFILES+= $(OBJS) $(PROGS)
all:: $(PROGS)
install:: $(PROGS)
@for i in ${PROGS}; do \
echo "Installing $$i"; \
$(INSTALL) $(objdir)/$$i $(DESTDIR)$(BINDIR)/$$i;\
done
PROGS= testlibpq0 testlibpq1 testlibpq2 testlibpq3 testlibpq4 testlo
all: $(PROGS)
$(PROGS): % : %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $@.c $(LD_ADD)
clean:
rm -f $(PROGS)

View File

@ -7,74 +7,85 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/Makefile,v 1.7 1996/11/12 11:16:44 scrappy Exp $
# $Header: /cvsroot/pgsql/src/test/regress/Makefile,v 1.8 1996/11/12 11:43:05 bryanh Exp $
#
#-------------------------------------------------------------------------
MKDIR= ../../mk
include $(MKDIR)/postgres.mk
include $(MKDIR)/postgres.user.mk
SRCDIR= ../..
LIBPQDIR= $(SRCDIR)/libpq
include ../../Makefile.global
CFLAGS+=-I../../include
CFLAGS+= -I$(LIBPQDIR) -I../../include
LDADD+= -L$(LIBPQDIR) -lpq
#
# try locating libpq.a in the following places
#
LIBPQ:= -L$(srcdir)/libpq/$(objdir) -L$(LIBDIR) -lpq
LDADD+= $(LIBPQ)
#
# build dynamically-loaded object files
# DLOBJS is the dynamically-loaded object file. The regression test uses
# this when it does a CREATE FUNCTION ... LANGUAGE 'C').
#
DLOBJS= regress$(SLSUFF)
#
# ... plus test query inputs
#
CREATEFILES= $(DLOBJS:%=$(objdir)/%) \
create.sql queries.sql errors.sql destroy.sql security.sql expected.out
# INFILES is the files the regression test uses for input.
INFILES= $(DLOBJS) \
create.sql queries.sql errors.sql destroy.sql security.sql \
expected.out
#
# plus exports files
#
ifdef EXPSUFF
INFILES+= $(DLOBJS:.o=$(EXPSUFF))
endif
# OUTFILES is the files that get created by running the regression test.
OUTFILES= stud_emp.data onek.data regress.out aportal.out
CLEANFILES+= $(notdir $(CREATEFILES)) $(OUTFILES)
$(OUTFILES): $(CREATEFILES)
$(SHELL) ./regress.sh 2>&1 | tee $(objdir)/regress.out
@echo "RESULTS OF REGRESSION ARE SAVED IN $(objdir)/regress.out"
#
# expected results file -- expand macros for user and location
#
# the expected.input file is make by hand from 'regress.out' when the
# regression test has been updated and a successful output obtained
#
expected.out: expected.input
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
if [ -z "$$USER" ]; then echo 'Cannot deduce $USER.'; exit 1; fi; \
rm -f $(objdir)/expected.out; \
C="`pwd`"; \
sed -e "s:_CWD_:$$C:g" \
-e "s:_OBJWD_:$$C/$(objdir):g" \
-e "s:_SLSUFF_:$(SLSUFF):g" \
-e "s/_USER_/$$USER/g" < expected.input > $(objdir)/expected.out
#
# prepare to run the test (including clean-up after the last run)
#
all:: $(CREATEFILES)
cd $(objdir); rm -f $(OUTFILES)
all: $(INFILES)
rm -f $(OUTFILES)
#
# run the test
#
runtest: expected.out regress.out
runtest: $(INFILES) expected.out
$(SHELL) ./regress.sh 2>&1 | tee regress.out
@echo "ACTUAL RESULTS OF REGRESSION TEST ARE NOW IN FILE regress.out"
#
# installation
#
install: localobj all
# The expected.input file is part of the distribution. It was made by hand
# from 'regress.out' from a reference run of the regression test, replacing
# installation-dependent things with names like _CWD_. The following rule
# turns those names back into real values for the instant installation to
# create a standard (expected.out) against which to compare regress.out
# from the experimental run.
expected.out: expected.input
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
if [ -z "$$USER" ]; then echo 'Cannot deduce $USER.'; exit 1; fi; \
rm -f expected.out; \
C="`pwd`"; \
sed -e "s:_CWD_:$$C:g" \
-e "s:_OBJWD_:$$C:g" \
-e "s:_SLSUFF_:$(SLSUFF):g" \
-e "s/_USER_/$$USER/g" < expected.input > expected.out
@echo "YOUR EXPECTED RESULTS ARE NOW IN FILE expected.out."
%.sql: %.source
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
rm -f $@; \
C=`pwd`; \
sed -e "s:_CWD_:$$C:g" \
-e "s:_OBJWD_:$$C:g" \
-e "s:_SLSUFF_:$(SLSUFF):g" \
-e "s/_USER_/$$USER/g" < $< > $@
clean:
rm -f $(INFILES)
rm -f $(OUTFILES)