#
# rcsid "$Header: /usr/cvsroot/magic/ext2spice/Makefile,v 1.1 2005/02/11 17:31:52 tim Exp $"
#

MODULE   = ext2spice
MAGICDIR = ..
SRCS     = ext2spice.c

EXTRA_LIBS = ${MAGICDIR}/extflat/libextflat.o ${MAGICDIR}/utils/libutils.a

include ${MAGICDIR}/defs.mak

LIBS += -lm ${LD_EXTRA_LIBS} ${SUB_EXTRA_LIBS}
CLEANS += exttospice${SHDLIB_EXT} spicewrap.o

main: ext2spice

tcl-main: exttospice${SHDLIB_EXT}

spicewrap.o: ext2spice.c
	${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ext2spice.c -c -o spicewrap.o

exttospice${SHDLIB_EXT}: spicewrap.o ${MAGICDIR}/extflat/libextflat.o
	@echo --- making exttospice Tcl library \(exttospice${SHDLIB_EXT}\)
	${RM} exttospice${SHDLIB_EXT}
	${CC} ${CFLAGS} ${CPPFLAGS} -o $@ ${LDDL_FLAGS} spicewrap.o \
		${MAGICDIR}/extflat/libextflat.o ${LD_SHARED} -lc ${LIBS}

install: ${BINDIR}/${MODULE}${EXEEXT} ${BINDIR}/spice2sim 

install-tcl: ${TCLDIR}/exttospice${SHDLIB_EXT} ${BINDIR}/spice2sim

${TCLDIR}/exttospice${SHDLIB_EXT}: exttospice${SHDLIB_EXT}
	${RM} ${TCLDIR}/exttospice${SHDLIB_EXT}
	${CP} exttospice${SHDLIB_EXT} ${TCLDIR}/exttospice${SHDLIB_EXT}

${BINDIR}/spice2sim: spice2sim
	${RM} ${BINDIR}/spice2sim
	${CP} spice2sim ${BINDIR}/spice2sim

include ${MAGICDIR}/rules.mak
