LIBNAME= Memchan SHLIB_NAME= lib${LIBNAME}.so.2 .PATH: ${.CURDIR}/generic SRCS= memchan.c init.c counter.c fifo.c fifo2.c null.c buf.c \ bufFix.c bufExt.c bufRange.c bufQueue.c bufStubInit.c \ bufStubLib.c TCL_VER?= 8.3 LOCALBASE?= /usr/local CFLAGS+= -I${LOCALBASE}/include/tcl${TCL_VER} \ -DMEMCHAN_VERSION='"${SHLIB_MAJOR}.${SHLIB_MINOR}"' LDADD= -L${LOCALBASE}/lib -ltcl${TCL_VER:S/.//} all: pkgIndex.tcl test pkgIndex.tcl: echo 'package ifneeded ${LIBNAME} 2.2 \ [list load [file join $$dir $(SHLIB_NAME)]]' > pkgIndex.tcl DIR = lib/tcl${TCL_VER}/${LIBNAME} LIBDIR = ${PREFIX}/${DIR} MANDIR = ${PREFIX}/man/man ${LIBDIR}: ${MKDIR} ${LIBDIR} env: @${ECHO} SHLIB_NAME=${SHLIB_NAME} SHLIB_LINK=${SHLIB_LINK} DIR=${DIR} beforeinstall: ${LIBDIR} pkgIndex.tcl ${INSTALL_DATA} pkgIndex.tcl ${LIBDIR}/pkgIndex.tcl .include test: ${SHLIB_NAME} pkgIndex.tcl echo ' set auto_path ${.OBJDIR}; cd ${.CURDIR}/tests; \ package require ${LIBNAME}; \ if {[catch {source all} msg]} { \ puts stderr $msg; exit -1 \ }' | ${LOCALBASE}/bin/tclsh${TCL_VER}