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

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

INSTALLLIST = Makefile PSDraw PSDrawCompLib PSDrawKinds *.c *.h *.bit *.psw psdraw.1X


OBJS = psdraw.o pswindow.o coords.o rect.o drawing.o util.o widget.o \
		knobs.o pixmgr.o actions.o button.o menus.o scrn.o \
		widgetinfo.o ops.o popup.o pswindW.o prop.o value.o mode.o \
		wraps.o ScrollW.o color.o

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

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

.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: psdraw

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


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

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 | \
		sed -e 's/realinstall/install/' > ${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.  Then it turns the below "realinstall" rule
#into the install rule.  What a hack.  8/22/89 (tw)

realinstall: all
	install -c -m 644 PSDraw /usr/lib/X11/app-defaults
	install -c -m 644 PSDrawCompLib /usr/lib/X11/app-defaults
	install -c -m 644 PSDrawKinds /usr/lib/X11/app-defaults
	@echo "There is no standard place to install example executables and"
	@echo "man pages.  If you wish them installed, you'll have to do them"
	@echo "by hand."

clobber: clean
	-rm -f *

relink::
	rm -f psdraw

relink:: all

