#######################################################################
#
#                     MOSIS distribution Version 8.2
#
# 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/02/1995
#       Please send bug reports/comments to mosis@mosis.edu :-)
#
#######################################################################
#  change this to the root of your Magic source tree or the home
#  directory of user "cad"...
CAD     = /nfs/cad1/cad
OLDVER  = 26
NEWVER  = 27
SYSLIB  = $(CAD)/lib/magic/sys
SRC     = README COPYRIGHT Makefile scmos.tech scmos.tech26 \
	mos.7bit.dstyle5 mos.7bit.std.cmap1 scmos-tm.tech26 scmos-sub.tech26
CIFin   = cif_template/objs/CIFin
CIFout  = cif_template/objs/CIFout
ICIFin  = cif_template/objs/IBMCIFin
ICIFout = cif_template/objs/IBMCIFout
HCIFin  = cif_template/objs/TMCIFin
HCIFout = cif_template/objs/TMCIFout
SCIFin  = cif_template/objs/SUBCIFin
SCIFout = cif_template/objs/SUBCIFout

all: version4

version3: scmos.tech $(CIFin) $(CIFout) $(HCIFin) $(HCIFout) $(SCIFin) $(SCIFout)
	/lib/cpp -P -DSTANDARD scmos.tech > scmos.tech$(OLDVER)
	/lib/cpp -P -DHPTECH -DTIGHTMETAL scmos.tech > scmos-tm.tech$(OLDVER)
	/lib/cpp -P -DSUBMICRON scmos.tech > scmos-sub.tech$(OLDVER)
#	/lib/cpp -P -DIBMTECH -DTIGHTMETAL -DSTACKVIA scmos.tech > scmos-ibm.tech$(OLDVER)

version4: scmos.tech $(CIFin) $(CIFout) $(HCIFin) $(HCIFout) $(SCIFin) $(SCIFout)
	/lib/cpp -P -DV4 -DSTANDARD scmos.tech > scmos.tech$(OLDVER)
	/lib/cpp -P -DV4 -DHPTECH -DTIGHTMETAL scmos.tech > scmos-tm.tech$(OLDVER)
	/lib/cpp -P -DV4 -DSUBMICRON scmos.tech > scmos-sub.tech$(OLDVER)
#	/lib/cpp -P -DV4 -DIBMTECH -DTIGHTMETAL -DSTACKVIA scmos.tech > scmos-ibm.tech$(OLDVER)

version5: scmos.tech $(CIFin) $(CIFout) $(HCIFin) $(HCIFout) $(SCIFin) $(SCIFout)
	/lib/cpp -P -DV5 -DSTANDARD scmos.tech > scmos.tech$(NEWVER)
	/lib/cpp -P -DV5 -DHPTECH -DTIGHTMETAL scmos.tech > scmos-tm.tech$(NEWVER)
	/lib/cpp -P -DV5 -DSUBMICRON scmos.tech > scmos-sub.tech$(NEWVER)
	/lib/cpp -P -DV5 -DIBMTECH -DTIGHTMETAL -DSTACKVIA scmos.tech > scmos-ibm.tech$(NEWVER)

test: test.tech
	/lib/cpp -P -DV4 -DSTANDARD test.tech > test.tech$(OLDVER)
	/lib/cpp -P -DV4 -DHPTECH -DTIGHTMETAL test.tech > test-tm.tech$(OLDVER)
	/lib/cpp -P -DV4 -DSUBMICRON test.tech > test-sub.tech$(OLDVER)
#	/lib/cpp -P -DV4 -DIBMTECH -DTIGHTMETAL -DSTACKVIA test.tech > test-ibm.tech$(OLDVER)

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

install:;
	install -c scmos.tech $(SYSLIB)
	install -c scmos.tech26 $(SYSLIB)
	install -c scmos-sub.tech26 $(SYSLIB)
	install -c scmos-tm.tech26 $(SYSLIB)	
	install -c scmos.tech27 $(SYSLIB)
	install -c scmos-sub.tech27 $(SYSLIB)
	install -c scmos-tm.tech27 $(SYSLIB)
	install -c mos.7bit.dstyle5 $(SYSLIB)
	install -c mos.7bit.std.cmap1 $(SYSLIB)
#	install -c scmos-ibm.tech26 $(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$(OLDVER) scmos-ibm.tech$(OLDVER) \
	      scmos-sub.tech$(OLDVER) *.tar.Z *.tar
