#######################################################################
#
#                     MOSIS distribution Version 8.0
#
# This is a version control header file for MOSIS's distribution of
# Magic related technology files and system libraries....
#
#       Modified by Jen-I Pi, MOSIS Project, USC/ISI     06/28/1994
#       Please send bug reports/comments to mosis@mosis.edu :-)
#
#######################################################################
#  change this to your the root of your Magic source tree or the home
#  directory of user "cad"...
CADDIR = this_is_set_by_the_parent_Makefile_and_the_findcad_script
CAD     = ${CADDIR}
VERSION = 26
SYSLIB  = $(CAD)/lib/magic/sys
SRC     = README COPYRIGHT Makefile scmos.tech scmos.tech26 \
	mos.7bit.dstyle5 mos.7bit.std.cmap1 scmos-ibm.tech26
DEPS	= scmos.tech $(CIFin) $(CIFout) $(ICIFin) $(ICIFout)
CIFin   = cif_template/objs/CIFin
CIFout  = cif_template/objs/CIFout
ICIFin  = cif_template/objs/IBMCIFin
ICIFout = cif_template/objs/IBMCIFout
HCIFin  = cif_template/objs/HPCIFin
HCIFout = cif_template/objs/HPCIFout
CPPFLAGS = `cat ../misc/CPPFLAGS`

all: .version4 install

.version3: ${DEPS}
	/lib/cpp ${CPPFLAGS} scmos.tech > scmos.tech$(VERSION)
	/lib/cpp ${CPPFLAGS} -DHPTECH -DTIGHTMETAL scmos.tech > scmos-hp.tech$(VERSION)
	/lib/cpp ${CPPFLAGS} -DIBMTECH -DTIGHTMETAL -DSTACKVIA scmos.tech > scmos-ibm.tech$(VERSION)
	rm -f .version3; date > .version3

.version4: ${DEPS}
	/lib/cpp ${CPPFLAGS} -DV4 scmos.tech > scmos.tech$(VERSION)
	/lib/cpp ${CPPFLAGS} -DV4 -DHPTECH -DTIGHTMETAL scmos.tech > scmos-hp.tech$(VERSION)
	/lib/cpp ${CPPFLAGS} -DV4 -DIBMTECH -DTIGHTMETAL -DSTACKVIA scmos.tech > scmos-ibm.tech$(VERSION)
	rm -f .version4; date > .version4

# Note:  the "date > .version4" is to keep track of when the files were 
# installed.  By having this file, "make install" only copies files when needed.

test: test.tech
	/lib/cpp ${CPPFLAGS} test.tech > scmos.tech$(VERSION)

$(CIFin):
$(CIFout):
$(ICIFin):
$(ICIFout):
$(HCIFin):
$(HCIFout):
	cd cif_template; make clean; make all

installcad: install

install: .version4 ${SYSLIB}/scmos.tech

${SYSLIB}/scmos.tech: ${DEPS}
	../:installfile scmos.tech $(SYSLIB)
	../:installfile scmos.tech26 $(SYSLIB)
	../:installfile scmos-ibm.tech26 $(SYSLIB)
	../:installfile scmos-hp.tech26 $(SYSLIB)
	../:installfile mos.7bit.dstyle5 $(SYSLIB)
	../:installfile mos.7bit.std.cmap1 $(SYSLIB)

tarfile: $(SRC)
	rm -f scmos_tech.tar.Z
	tar -cvf scmos_tech.tar $(SRC) examples cif_template rules doc\
		 irsim_parameters
	compress scmos_tech.tar

uufile: $(SRC)
	uuencode scmos_tech.tar.Z scmos_tech.tar.Z > scmos_tech.uu

clean:;
	rm -f scmos.tech$(VERSION) scmos-ibm.tech$(VERSION) \
	      scmos-hp.tech$(VERSION) *.tar.Z *.tar .version3 .version4

