.SUFFIXES: .r .b .o .lst .press .c .lst .h .mss
#include ../../buildprefix
#CFLAGS = -I/usr/sun/include -DVAX
STUBS =
#ifdef X
C68FLAGS = -O -V -vx -I../../libc/include/mi
#else X
C68FLAGS = -O -V
#endif X
LIBS = 

SRC0 = misc.c init.c input.c find.c debug.c
SRC1 = perm.c defaults.c load.c save.c help.c
SRC2 = rotate.c scale.c move.c copy.c create.c
SRC3 = alter.c erase.c lower.c raise.c
SRC4 = drawpress.c spline.c splinedefs.c vec.c press.c
SRCn = draw.c
SRC = $(SRC0) $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRCn)
SRCh = draw.h

OBJ0 = misc.b init.b input.b find.b debug.b
OBJ1 = perm.b defaults.b load.b save.b help.b
OBJ2 = rotate.b scale.b move.b copy.b create.b
OBJ3 = alter.b erase.b lower.b raise.b
OBJ4 = drawpress.b spline.b splinedefs.b vec.b press.b
OBJn = draw.b
OBJ = $(OBJ0) $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJn)

VOBJ0 = misc.o init.o input.o find.o debug.o
VOBJ1 = perm.o defaults.o load.o save.o help.o
VOBJ2 = rotate.o scale.o move.o copy.o create.o
VOBJ3 = alter.o erase.o lower.o raise.o
VOBJ4 = drawpress.o spline.o splinedefs.o vec.o press.o
VOBJn = draw.o
VOBJ = $(VOBJ0) $(VOBJ1) $(VOBJ2) $(VOBJ3) $(VOBJ4) $(VOBJn)

LST0 = misc.lst init.lst input.lst find.lst debug.lst
LST1 = perm.lst defaults.lst load.lst save.lst help.lst
LST2 = rotate.lst scale.lst move.lst copy.lst create.lst
LST3 = alter.lst erase.lst lower.lst raise.lst
LST4 = drawpress.lst spline.lst splinedefs.lst vec.lst press.lst
LSTn = draw.lst
LST = $(LST0) $(LST1) $(LST2) $(LST3) $(LSTn)

sun: olddraw.r
vax: draw
all: sun vax
manuals: manual.press internal.press

draw: $(VOBJ)
	cc -O -o draw $(VOBJ) $(CFLAGS) $(STUBS) -lm -lVgts

olddraw.r: $(OBJ)
	cc68 $(C68FLAGS) -r -o olddraw.r $(OBJ) $(LIBS) 

lint:
	lint -bhax -I/usr/sun/include $(SRC) >lint.out

$(VOBJ)  $(OBJ):	draw.h
$(VOBJ4) $(OBJ4):	press.h vec.h

.c.o:
	cc -c $(C68FLAGS) $(CFLAGS) $<

.c.b:
	cc68 -c $(C68FLAGS) -o $@ $*.c

.mss.press:
	scribe $<

#---------------------------------------------------------------------
#     General purpose nicknacks.
#---------------------------------------------------------------------

manual-listings: manual.press internal.press
	@cz manual.press
	@cz internal.press
	@echo Making a listing of the manuals on the Dover.
	@echo

boise-listings:
	@echo Making listings on Boise.
	@pr -f -l78 README makefile draw.h $(SRC) | boise -b "Draw program"

all-listings:
	@cz README makefile draw.h &
	@echo Making listings on the dover.
	@echo
	@touch $(LST)
	@yapp $(SRC) &

no-listings:
	@touch $(LST)

incr-listings: $(LST)

.c.lst:
	@yapp $? &
	@touch $@
	@echo Listed $? on the Dover.
	@echo

clean:
	rm -f *.BAK *.CKP core .emacs* *.press *.otl *.aux
	rm -f *.o *.b *.lst draw draw.r bitpress lint.out
	rm -f *.o *.b *.lst draw.r bitpress lint.out

install: olddraw.r
	$(NETINSTALL) -p olddraw.r $(VSYS)/bin

backup:
	cd ..; cpdir draw ../../Vbackup/cmds/draw
