#
# @(#)Makefile.release 1.2 86/10/07 SMI
#

#
# Makefile for the GP demos and libraries
# to be include on release tapes

DESTDIR=

CFLAGS= -O

SUBDIR= VIEWPORT DEV_GP1

DEMOS= flight rotobj

WINLIBS= -lsuntool -lsunwindow -lpixrect

all: ${DEMOS} ${SUBDIR}

${SUBDIR}: FRC
	cd $@; make ${MFLAGS}

FRC:

flight: flight.o 
	cc -o flight flight.o ${WINLIBS} ${CFLAGS}

flight.o: flight.c flight_dat.h
	cc -c ${CFLAGS} flight.c

rotobj: rotobj.o 
	cc -o rotobj rotobj.o ${WINLIBS} -lm ${CFLAGS}

rotobj.o: rotobj.c
	cc -c ${CFLAGS} rotobj.c

clean:
	rm -f *.o
	for i in ${SUBDIR}; do \
		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} clean); \
		done

install: all
	-install -s flight tempfile && \
	 rm flight; rm flight.o  && \
	 mv tempfile flight;
	-install -s rotobj tempfile && \
	 rm rotobj; rm rotobj.o && \
	 mv tempfile rotobj;
	-for i in ${SUBDIR}; do \
		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); \
		done
