#
# /usr/local/devel/postgres-v4r2/src/regress/demo/RCS/Makefile,v 1.10 1994/04/04 08:46:11 aoki Exp
#

.include <postgres.global.mk>

.include <postgres.prog.mk>

#
# build dynamically-loaded object files
#
DLOBJS= circle.o boxarea.o overpaid.o

#
# ... plus test query inputs
#
CREATEFILES= ${DLOBJS} \
	set-up-1.pq demo.pq

#
# ... plus exports files
#
.if defined(EXPSUFF)
CREATEFILES+= ${DLOBJS:S/.o/${EXPSUFF}/g}
.endif

#
# ... plus shared libraries
#
.if defined(SLSUFF)
.  if (${SLSUFF} != ".o")
CREATEFILES+= ${DLOBJS:S/.o/${SLSUFF}/g}
.    if (${PORTNAME} == "alpha")
CLEANFILES+= so_locations
.    endif
.  endif
.endif

OUTFILES= demo.out
CLEANFILES+= ${CREATEFILES} ${OUTFILES}

demo.pq: ${.CURDIR}/demo_order set-up-1.pq
	cat set-up-1.pq > ${.TARGET}
	C=`pwd`; cd ${.CURDIR}; cat `cat demo_order` >> $$C/${.TARGET}

demo.out: ${CREATEFILES}
	${SHCMD} ${.CURDIR}/wholedemo.sh 2>&1 | tee ${.TARGET}
	@echo "RESULTS OF DEMO ARE SAVED IN ${MAKEOBJDIR}/demo.out"

#
# prepare to run the test (including clean-up after the last run)
#
all: ${CREATEFILES}
	rm -f ${OUTFILES}

#
# run the test
#
runtest: ${OUTFILES}
