#-------------------------------------------------------------------------------
#				Standalone Makefile
#-------------------------------------------------------------------------------


CC=	cc
AS=	as
LD=	/bin/ld
AR=	ar
RANLIB= ranlib
SIZE=	size
LIB=	/usr/lib/libc.a
#
# The following is for GIP's with a Writable Control Store attached.
#
# CFLAGS=	-O -DHASWCS
#
CFLAGS=	-O

#
#-------------------------------------------------------------------------------
#             -- Source files --
#
CFILES= erode.c uc_test.c mem_test.c hw_test.c graphics.c fifo.c dasm.c\
	debug.V10.c debug.V20.c

OFILES=	erode.o uc_test.o mem_test.o hw_test.o graphics.o fifo.o dasm.o
#
#-------------------------------------------------------------------------------
#             -- Definitions for each bus/processor configurations --
#
#   -----   VBUS M68010
V10FLAGS=	-DMC68010
V10LIB=		libsa.V10.a
V10CFLAGS=	${CFLAGS} ${V10FLAGS}
V10OFILES=	${OFILES} debug.V10.o 

#   -----   VBUS M68020
V20FLAGS=	-DMC68020
V20LIB=		libsa.V20.a
V20CFLAGS	=${CFLAGS} ${V20FLAGS}
V20OFILES=	${OFILES} debug.V20.o 

#
#-------------------------------------------------------------------------------
#             -- Suffix Rules for each bus/processor configurations --
#
.SUFFIXES:.V10.o .V20.o

.c.V10.o:; ${CC} ${V10CFLAGS} $*.c; mv $*.o $@

.c.V20.o:; ${CC} ${V20CFLAGS} $*.c; mv $*.o $@

#
#-------------------------------------------------------------------------------
#                      -- make all definitions --
#
V10STD=	debug.V10

V20STD=	debug.V20

all:	V10 V20
	@echo All done.

V10:	${V10STD}

V20:	${V20STD}


#
#-------------------------------------------------------------------------------
#                               -- misc --
#
listing:
	pr *.h ${CFILES} | lpr

clean:
	rm -f ${OFILES} debug.V10.o debug.V20.o debug.V10 debug.V20

#
#-------------------------------------------------------------------------------
#				VBUS 68010

V10LFDIAG=	-S -N -x -T 8000 -e start

debug.V10: M.V10.o ${OFILES} debug.V10.o ${V10LIB}
	${LD} ${V10LFDIAG} M.V10.o ${OFILES} debug.V10.o \
	${V10LIB} ${LIB} -o debug.V10

#
#-------------------------------------------------------------------------------
#				VBUS 68020

V20LFDIAG=	-S -N -x -T 8000 -e start

debug.V20: M.V20.o ${OFILES} debug.V20.o ${V20LIB}
	${LD} ${V20LFDIAG} M.V20.o ${OFILES} debug.V20.o \
	${V20LIB} ${LIB} -o debug.V20

