#
#Makefile for Apple ][ Emulator
#(C) 1989 Ben Koning [556498717 408/738-1763 ben@apple.com]
#

#Local printing command:
PRINT = lpr -Psimplex

#Apple.II is split up as follows:
OBJ = main.o 6502.o mega2.o debug.o

#CFLAGS=-lcurses -ltermcap
CLFAGS=-Wall

#Make normal version:
debug: ${OBJ} apple.h
	cc -g $(OBJ) ${CFLAGS}
lint:
	lint main.c 6502.c mega2.c debug.c -lcurses -ltermcap

#Make final optimized version:
final:
	touch apple.h
	make debug
	strip a.out
	mv a.out Apple.II
	make clean

#Make profiling version:
profil:
	cc -pg main.c 6502.c mega2.c debug.c -lcurses -ltermcap

#Building modules from source:
main.o: main.c apple.h
	cc -c  -g main.c
6502.o: 6502.c apple.h
	cc -c  -g 6502.c
mega2.o: mega2.c apple.h
	cc -c  -g mega2.c
debug.o: debug.c apple.h
	cc -c  -g debug.c

#Cleanup of directory:
clean:
	rm -f ${OBJ}
	rm -f file
	rm -f a.out
	rm -f core

#Printout without long ROM listings:
print:
	rm -f          file
	touch          file
	pr README   >> file
	pr Makefile >> file
	pr *.h      >> file
	pr main.c   >> file
	pr 6502.c   >> file
	pr mega2.c  >> file
	$(PRINT)       file
	rm -f          file
	wc             *.h *.c

#Printout with long copyrighted ROM listings:
printall:
	make print

