# Makefile for a ns32000		Modified by Julian Stacey

# which cursor file we want - can be ucl or ukc
CURSOR = ucl
CFLAGS = -Dputch=myputch
# dont know if this -Dputch is correct, but it gets everything to work JHS.
all:
	@echo It would have been better to have typed	cd ..	make
	@echo We will assume unix and sufficient process ram for a nested make.
	/usr/bin/local/make -f ../include/make/system_5 \
		-f ../include/make/unix -f ns32000/makefile basic
basic: $(INST_DIR)basic
$(INST_DIR)basic: basic.bin
	strip basic.bin
	cp basic.bin $(INST_DIR)basic
	@$(CHGRP) $@
	@$(CHMOD) $(CHMOD_ARGS) $@
basic.bin:  bas1.o bas2.o bas3.o bas4.o bas5.o bas6.o bas7.o bas8.o \
          bas9.o cursor.o termcap.o assist.o term.o as.o
	-rm basic.tmp
	cc -O bas1.o bas2.o bas3.o bas4.o bas5.o bas6.o bas7.o bas8.o bas9.o \
		cursor.o termcap.o assist.o term.o as.o -lm -o basic.tmp
	-ls -l basic.*
	@echo If symetric linker fails, basic.tmp is not deleted.
	@echo Next mv only happens if linker succeeded.
	mv basic.tmp basic.bin
clean:
	@echo rm should run in directory basic, not basic/ns32000
	cd ns32000/../../basic ; rm -f *.o *.s cursor.c term.c basic.tmp as.s basic.bin key.asm
assist.o: bas.h assist.c ns32000/conf.h
	cc -O -c -Dns32000 assist.c
as.o:	as.s
	cc -c as.s
as.s: ns32000/as.s
	cp ns32000/as.s as.s
termcap.o: bas.h termcap.c ns32000/conf.h
	cc -O -c -Dns32000 termcap.c
cursor.c: cursor/cursor.${CURSOR}
	cp cursor/cursor.${CURSOR} cursor.c
cursor.o: cursor.c
	cc -O -c -Dns32000 cursor.c
term.o: term.c
	cc -O -c -Dns32000 term.c
term.c: ns32000/term.c ns32000/conf.h
	cp ns32000/term.c term.c
.c.o:
	cc $(CFLAGS) -O -c -Dns32000 $*.c
bas.h: ns32000/conf.h

bas1.o: bas1.c bas.h ns32000/conf.h

bas2.o: bas2.c bas.h ns32000/conf.h

bas3.o: bas3.c bas.h ns32000/conf.h

bas4.o: bas4.c bas.h ns32000/conf.h

bas5.o: bas5.c bas.h ns32000/conf.h

bas6.o: bas6.c bas.h ns32000/conf.h

bas7.o: bas7.c bas.h ns32000/conf.h cursor.c

bas8.o: bas8.c bas.h ns32000/conf.h

bas9.o: bas9.c bas.h ns32000/conf.h
