# BuildSystemHeader added automatically
# $Header: [Makefile,v 1.1.1.7 92/10/27 06:48:17 rich Exp ]$
#	@(#)Makefile	1.5	ULTRIX	9/2/88

DESTDIR=
EXAMPLETOPDIR=${DESTDIR}/usr/examples/dps
EXAMPLESUBDIR=${EXAMPLETOPDIR}/psclock

INSTALLLIST = Makefile *.c *.h *.bit *.psw *.man


OBJS = psclock.o Clock.o wraps.o

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

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

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

MITLIBDIR = ../../../mitclients/mit

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

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


all: psclock

psclock:	$(OBJS)
	rm -f psclock
	$(CC) -o psclock $(OBJS) $(LIBS)

Clock.o:    Clock.c wraps.h

clean:
	rm -f *.o psclock pswindW.c wraps.c wraps.h \#* *~ core

install:  all
	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)

clobber: clean
	-rm -f *

relink::
	rm -f psclock

relink:: all

