# --------------------------------- makefile ---------------------------------

#
# This is part of the flight simulator 'fly8'.
# Author: Eyal Lebedinsky (eyal@ise.canberra.edu.au).
#

#
# makefile for shapes, unix version
#

CC=	cc
CFLAGS=	-I../

#
# on some systems (like BSD) you should use 'nawk'
#

AWK=	awk

SHAPES= runway.vxx m61.vxx mk82.vxx gtarget.vxx target.vxx viewer.vxx \
	plane.vxx crater.vxx house.vxx smoke.vxx tower.vxx broken.vxx \
	box.vxx chute.vxx

ACM=	runway.avx tower.avx f16.avx
ACMF=	f16.fvx


.SUFFIXES: .vx .vxx .acm .avx .fvx

.vx.vxx:
	cp $*.vx 001.c
	$(CC) $(CFLAGS) -E 001.c >$*.002
	rm 001.c
	$(AWK) -f f8shape.awk $*
	rm $*.002
	rm $*.003

.acm.avx:
	$(AWK) -f acm2avx.awk $*
	mv $*.001 001.c
	$(CC) $(CFLAGS) -E 001.c >avx.002
	rm 001.c
	$(AWK) -f f8shape.awk avx
	rm avx.002
	rm avx.003
	-rm $*.avx
	mv avx.vxx $*.avx

.acm.fvx:
	$(AWK) -f acm2fvx.awk $*
	mv $*.001 001.c
	$(CC) $(CFLAGS) -E 001.c >fvx.002
	rm 001.c
	$(AWK) -f f8shape.awk fvx
	rm fvx.002
	rm fvx.003
	-rm $*.fvx
	mv fvx.vxx $*.fvx

all:	shapes

shapes:	$(SHAPES) $(ACM) $(ACMF)

copy:	shapes
	cp *.vxx ..

clean:
	-rm *.vxx *.fvx *.avx
