#
# $Header: /usr/local/devel/postgres/src/regress/video/RCS/Makefile,v 1.7 1994/04/04 08:48:24 aoki Exp $
#

.include <postgres.global.mk>

.include <postgres.prog.mk>

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

#
# ... plus test query inputs
#
CREATEFILES= ${DLOBJS} set-up-1.pq video.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= video.out
CLEANFILES+= ${CREATEFILES} ${OUTFILES}

video.pq: ${.CURDIR}/video_order set-up-1.pq
	cat set-up-1.pq > ${.TARGET}
	C=`pwd`; cd ${.CURDIR}; cat `cat video_order` | \
	sed -e 's:\\p:\\g:g' >> $$C/${.TARGET}

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

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

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