#######################################################################
#
#                     MOSIS distribution Version 8.2
#
#######################################################################

MAGICDIR = ..

include ${MAGICDIR}/defs.mak

SC_CPP = ${CPP} -I./extract_template

FILES = mos.7bit.dstyle6 mos.7bit.std.cmap1 \
	mos.24bit.dstyle6 mos.7bit.mraster_dstyle6 mos.7bit.mraster.cmap1 \
	mos.OpenGL.dstyle6 mos.OpenGL.std.cmap1
TECH27FILES = minimum.tech27 scmos.tech27 scmos-tm.tech27 scmos-sub.tech27 \
	scmosWR.tech27
TECH26FILES = scmos.tech26 \
	scmos-tm.tech26 scmos-sub.tech26 scmosWR.tech26

INST_FILES= $(FILES:%=${SYSDIR}/%)
INST_TECH27= $(TECH27FILES:%=${SYSDIR}/%)
INST_TECH26= $(TECH26FILES:%=${SYSDIR}/%)

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

OBJS =$(CIFin) $(CIFout) $(HCIFin) $(HCIFout) $(SCIFin) $(SCIFout)

DEPEND = scmos.tech \
		extract_template/scmosExt.tech \
		extract_template/scmosExt26b-sub.tech \
		extract_template/scmosExt060_orb.tech \
		extract_template/scmosExt080.tech   \
		extract_template/scmosExt100.tech   \
		extract_template/scmosExt34.tech    \
		extract_template/scmosExt14b-sub.tech  \
		extract_template/scmosExtDiag.tech \
		extract_template/scmosExt14b-tm.tech 

all: version5

install-tcl: all ${INST_FILES} ${INST_TECH27}

install: all ${INST_FILES} ${INST_TECH27}

version4: $(OBJS) $(DEPEND) ${TECH26FILES}

scmos.tech26: $(OBJS)
	$(SC_CPP) -DV5 -DSTANDARD scmos.tech > scmos.tech26

scmos-tm.tech26: $(OBJS)
	$(SC_CPP) -DV5 -DHPTECH -DTIGHTMETAL scmos.tech > scmos-tm.tech26

scmos-sub.tech26: $(OBJS)
	$(SC_CPP) -DV5 -DSUBMICRON scmos.tech > scmos-sub.tech26

scmosWR.tech26: $(OBJS)
	$(SC_CPP) -DV5 -DSTANDARD -DWELL_ROUTE_CHECK scmos.tech > scmosWR.tech26

version5: $(OBJS) $(DEPEND) ${TECH27FILES}

scmos.tech27: $(OBJS)
	$(SC_CPP) -DV5 -DSTANDARD scmos.tech > scmos.tech27

scmos-tm.tech27: $(OBJS)
	$(SC_CPP) -DV5 -DHPTECH -DTIGHTMETAL scmos.tech > scmos-tm.tech27

scmos-sub.tech27: $(OBJS)
	$(SC_CPP) -DV5 -DSUBMICRON scmos.tech > scmos-sub.tech27

scmosWR.tech27: $(OBJS)
	$(SC_CPP) -DV5 -DSTANDARD -DWELL_ROUTE_CHECK scmos.tech > scmosWR.tech27

$(CIFin):
$(CIFout):
$(ICIFin):
$(ICIFout):
$(HCIFin):
$(HCIFout):
$(SCIFin):
$(SCIFout):
	cd cif_template; ${MAKE} clean; ${MAKE};

${SYSDIR}/%: %
	cp $* ${SYSDIR}/$*

clean:;
	-rm -f scmos*.tech27 *.tech26
	cd cif_template && ${MAKE} clean;
