a5a2364bca
(released in August 2002). Stop parametrizing some of the values in files/Makefile.bsd -- they change _so rarely_ the benefit does not justify the gymnastics. Default to TCL-8.3 Suggested by: kris
44 lines
1.1 KiB
Text
44 lines
1.1 KiB
Text
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 <bsd.lib.mk>
|
|
|
|
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}
|