# Makefile fuer Apple-Simulator

CC=		gcc

CFLAGS=		-O2

all:		apple2

install:	apple2
		strip apple2
		chmod 711 apple2
		mv apple2 ..

clean:
		rm -f *.o core apple2 slot?.c cpu6502.c

apple2:		apple.o screen.o cpu6502.o simulator.o \
		slot0.o slot1.o slot2.o slot3.o slot4.o slot5.o slot6.o slot7.o
		$(CC) $(CFLAGS) -o apple2 apple.o screen.o cpu6502.o \
		simulator.o slot0.o slot1.o slot2.o slot3.o slot4.o slot5.o \
		slot6.o slot7.o -lX11

cpu6502.c:
		ln -s cpu2.c cpu6502.c

slot0.c:	languagecard.c
		sed -e "s/SLOT/0/g" <$? >$@

slot1.c:	noslot.c
		sed -e "s/SLOT/1/g" <$? >$@

slot2.c:	noslot.c
		sed -e "s/SLOT/2/g" <$? >$@

slot3.c:	noslot.c
		sed -e "s/SLOT/3/g" <$? >$@

slot4.c:	noslot.c
		sed -e "s/SLOT/4/g" <$? >$@

slot5.c:	controller.c
		sed -e "s/SLOT/5/g" <$? >$@

slot6.c:	controller.c
		sed -e "s/SLOT/6/g" <$? >$@

slot7.c:	noslot.c
		sed -e "s/SLOT/7/g" <$? >$@
