# ********************************************************************
# * Makefile for VME CAMAC	FEB-1992	Y.Takeuchi (T.I.T.)  *
# *                                                                  *
# * 13-JUL-1992 Y.Takeuchi    modify for new CC-driver               *
# * 30-NOV-1992 Y.Takeuchi    modify                                 *
# * 11-JAN-1993 Y.Takeuchi    modify                                 *
# ********************************************************************
INC		= ../include
LIST		= cclist.c klist.c

KCAM		= kcam_ss.c kcam_mb.c
#KCAM		= kcam_ss.c kcam_sb.c

DEV		= /sys/sun/conf.c		\
		  /sys/sun4c/conf/files		\
		  /sys/sun4c/conf/CAMAC		\
		  /sys/sundev/k2917.h		\
		  /sys/sundev/cc.h		\
		  /sys/sundev/cc_config.h	\
		  /sys/sundev/cc_common.h	\
		  /sys/sundev/cc.c

all:

kernel: $(DEV)
	cd /sys/sun4c/conf; sfconfig CAMAC
	cd /sys/sun4c/CAMAC; make
#	mv /vmunix /vmunix.previous
	@echo !!!CAUTION!!! /vmunix will be overwrite.
	mv -i /sys/sun4c/CAMAC/vmunix /vmunix

clean:
	rm -f *~ core

cat:
	cat -n /sys/sundev/cc.c | less

copy: $(DEV)

lint: $(DEV)
	lint -nuh -DKERNEL -D`arch -k` /sys/sundev/cc.c | less

/sys/sun/conf.c: conf.c
	cp conf.c /sys/sun/conf.c

/sys/sun4c/conf/files: files
	cp files /sys/sun4c/conf/files

/sys/sun4c/conf/CAMAC: CAMAC 
	cp CAMAC /sys/sun4c/conf/CAMAC

/sys/sundev/k2917.h: $(INC)/k2917.h 
	cp $(INC)/k2917.h /sys/sundev/k2917.h

/sys/sundev/cc.h: $(INC)/cc.h 
	cp $(INC)/cc.h /sys/sundev/cc.h

/sys/sundev/cc_config.h: $(INC)/cc_config.h 
	cp $(INC)/cc_config.h /sys/sundev/cc_config.h

/sys/sundev/cc_common.h: $(INC)/cc_common.h 
	cp $(INC)/cc_common.h /sys/sundev/cc_common.h

/sys/sundev/cc.c: ccmain.c $(KCAM) $(LIST) 
	cat ccmain.c $(KCAM) $(LIST) >/sys/sundev/cc.c

check:
	@echo '****** original files ******'
	@cd /sys/sun4c/conf; grep SMI GENERIC*
	@cd /sys/sun; grep SMI conf.c*
	@cd /sys/sun4c/conf; grep SMI files*
	@echo '****** for CAMAC files ******'
	@grep SMI C* c* f*

newfiles:
	cp /sys/sun4c/conf/GENERIC CAMAC
	cp /sys/sun/conf.c.original conf.c
	cp /sys/sun4c/conf/files.original files
#	cp /sys/sun/conf.c .
#	cp /sys/sun4c/conf/files .

node:
	cd /dev; mknod cc c 105 0; chmod 666 cc

