#
#		Cadmus Bit Block Transfer Facility Makefile
#		@(#)makefile	1.3 : latest delta is 8/19/85
#

SYS=		${INC}/sys
BIP=		${INC}/bip

LOCALH=	rule.h chip.h debug.h mc68K.h MacWorld.h
CFILES=	bitblt.c chip.c cursor.c driver.c
IFILES=	compile.i fastpaint.i m_to_m.i s_to_m.i s_to_s.i subr.i thin_mode.i
OBJS=	chip.o cursor.o
KOBJS=	bitblt.o

# -DQMAC for QMAC addresses else DDN addresses.
# -DSOFT_CHIP for software simulation else use the real chip.
# -DSLOW_STUFF for slow but correct (?) C version
#	else optimized in-line loop verion.
# -DDEBUG for debug output & statistics, -g for adb use.
# -DTEST to include definitions for test driver

#CFLAGS= -DQMAC -DSLOW_STUFF -DDEBUG -DTEST
CFLAGS= -DQMAC -I$(INC)

all:	../../$(KERN_LIB) $(KOBJS)

../../$(KERN_LIB): ${OBJS}
	ar rv ../../$(KERN_LIB) $?

driver:	${OBJS} driver.o
	cc -o driver ${CFLAGS} ${OBJS} driver.o
	-/bin/rm -f driver.o
	-@echo "driver finished."

clip:	clip.c
	cc -o clip ${CFLAGS} clip.c
	-@echo "clip finished."

lint:	${CFILES}
	-lint -a ${CFLAGS} ${CFILES}

tags:	${CFILES} ${LOCALH} ${IFILES}
	ctags ${LOCALH} ${CFILES} ${IFILES}

#	including README.h here isn't fair
comment:
	cat ${LOCALH} ${CFILES} ${IFILES} | comment

depend:
	/bin/grep '^#[ 	]*include' ${CFILES}			\
		| sed '/<.*>/d'					\
		| sed 's/:[^"]*"\([^"]*\)".*/: \1/'		\
		| sed 's/\.c/.o/'			>> make_dep
	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' > ed_dep
	echo '$$r make_dep' >> ed_dep
	echo 'w' >> ed_dep
	cp makefile makefile.bak
	ed - makefile <ed_dep
	/bin/rm ed_dep make_dep
	echo '#' >> makefile
	echo '# Dependencies must be last in the makefile,' >> makefile
	echo '# if you put anything here it will go away;' >> makefile
	echo '# see make depend above.' >> makefile
	echo '#' >> makefile


# DO NOT DELETE THIS LINE	--	make depend uses it.

bitblt.o: rule.h
bitblt.o: MacWorld.h
bitblt.o: chip.h
bitblt.o: debug.h
bitblt.o: mc68K.h
bitblt.o: fastpaint.i
bitblt.o: thin_mode.i
bitblt.o: m_to_m.i
bitblt.o: s_to_s.i
bitblt.o: s_to_m.i
bitblt.o: compile.i
bitblt.o: subr.i
chip.o: MacWorld.h
chip.o: rule.h
chip.o: chip.h
chip.o: debug.h
cursor.o: rule.h
cursor.o: MacWorld.h
cursor.o: chip.h
cursor.o: debug.h
cursor.o: mc68K.h
driver.o: rule.h
driver.o: MacWorld.h
driver.o: chip.h
driver.o: debug.h
#
# Dependencies must be last in the makefile,
# if you put anything here it will go away;
# see make depend above.
#
