# BuildSystemHeader added automatically
# $Header: [Makefile,v 1.1.1.2 91/09/19 09:33:47 afuller Exp ]$
#	@(#)Makefile	1.5	ULTRIX	9/2/88

DESTDIR=
EXAMPLETOPDIR=${DESTDIR}/usr/examples/dps
EXAMPLESUBDIR=${EXAMPLETOPDIR}/gray-square

INSTALLLIST = Makefile examplemain.c *.psw

OBJS = examplemain.o examplewraps.o

PSWRAP= ${DESTDIR}/usr/bin/pswrap

.SUFFIXES: $(.SUFFIXES) .psw .h
.psw.o:	$*.psw
	${PSWRAP} -o $*.c $*.psw
	$(CC) $(CFLAGS) -c $*.c
	rm $*.c

.psw.h: $*.psw
	${PSWRAP} -h $*.h $*.psw > /dev/null

.SUFFIXES: .uil .uid

CFLAGS = -g -I${DESTDIR}/usr/include/X11 -I${DESTDIR}/usr/include/DPS \
	-I${DESTDIR}/usr/include -I.


LIBS =	${DESTDIR}/usr/lib/libdps.a \
	${DESTDIR}/usr/lib/libXext.a \
	${DESTDIR}/usr/lib/libdwt.a \
	/usr/lib/libddif.a \
	${DESTDIR}/usr/lib/libX11.a \
	${DESTDIR}/usr/lib/libsmt.a \
	$(DEC_TOP)/extensions/ip/libip.a \
	-lm


all: examplemain

examplemain:	$(OBJS)
	$(CC) -o examplemain $(OBJS) $(LIBS)

examplemain.o: examplemain.c examplewraps.h

install:  all
	-mkdir ${EXAMPLETOPDIR}
	-mkdir ${EXAMPLESUBDIR}
	for i in $(INSTALLLIST) ;\
	do \
		echo Installing $$i ;\
		install -c -m 644 $$i ${EXAMPLESUBDIR}/$$i ;\
	done
	awk '/^install:/ { skip = 1 } /^$$/ { skip = 0 } skip != 1 { print }' \
		${EXAMPLESUBDIR}/Makefile > ${EXAMPLESUBDIR}/foo
	mv ${EXAMPLESUBDIR}/foo ${EXAMPLESUBDIR}/Makefile
#The awk garbage above removes the above install rule (as well as this comment)
#from the installed Makefile.  What a hack.  8/22/89 (tw)

clean:
	rm -f *.o examplemain examplewraps.[ch] \#* *~ core

clobber: clean
	-rm -f *

relink::
	rm -f examplemain

relink:: all
