#
#	Makefile	1.8	84/04/23
#
# ----------- Makefile for bitmap, color, window, and SunCore demos ------
FLOATFLAG= -fsingle
DESTDIR=
#
CORE_DEMOS= chessgame draw mixcolor product shaded showmap stringart suncube
WINDOW_DEMOS= rotcube
DEMOS= ${CORE_DEMOS} ${WINDOW_DEMOS}
#
CORELIBS= -lcore -lm
WINLIBS=-lsuntool -lsunwindow -lpixrect
#
CFLAGS = -O -fsingle
#
# create the world target for release tapes
#
all:	${DEMOS}

#
# individual demo targets
#

chessgame: chessgame.o
	cc chessgame.o -o chessgame ${CORELIBS} ${WINLIBS} 

draw: draw.o
	cc draw.o -o draw ${CORELIBS} ${WINLIBS} 

mixcolor: mixcolor.o
	cc mixcolor.o -o mixcolor ${CORELIBS} ${WINLIBS} 

product: product.o
	cc product.o -o product ${CORELIBS} ${WINLIBS} 

rotcube: rotcube.o
	cc rotcube.o -o rotcube ${WINLIBS}

shaded: shaded.o
	cc shaded.o -o shaded ${CORELIBS} ${WINLIBS}

showmap: showmap.o
	cc showmap.o -o showmap ${CORELIBS} ${WINLIBS}

stringart: stringart.o
	cc stringart.o -o stringart ${CORELIBS} ${WINLIBS}

suncube: suncube.o
	cc suncube.o -o suncube ${CORELIBS} ${WINLIBS} 

#
# clean up this directory
#
clean:
	rm -f *.o errs core ${DEMOS}

#
# move stuff into place for creation of release tapes
#
install: 
	-for i in '' /src /MAPS /DATA; do \
		mkdir ${DESTDIR}/usr/demo$$i && \
		chown bin ${DESTDIR}/usr/demo$$i && \
                chmod 755 ${DESTDIR}/usr/demo$$i; done
	-for i in ${DEMOS}; do \
		(cp $$i.c ${DESTDIR}/usr/demo/src); done
	-cd DATA; for i in *; do\
		(cp $$i ${DESTDIR}/usr/demo/DATA); done
	-cd MAPS; for i in *; do\
		(cp $$i ${DESTDIR}/usr/demo/MAPS); done
	-(cp READ_ME ${DESTDIR}/usr/demo)
	-(cp demolib.h ${DESTDIR}/usr/demo/src)
	-(cp Makefile ${DESTDIR}/usr/demo/src)
