summaryrefslogtreecommitdiff
path: root/lang/itcl/files/Makefile.lib
blob: 7c669fa80f19f7faacfe974c1d79480c06bbbcdb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
NO_PROFILE=	yes
LIB=		itcl
ITCL_LIBRARY=	${PREFIX}/lib/itcl${MAJOR}.${MINOR}
CFLAGS+=	-I. -I./../generic \
		-I${TCL_INCLUDEDIR}/generic \
		-DHAVE_GETCWD=1 -DNO_VALUES_H=1 -DHAVE_UNISTD_H=1 -DUSE_TERMIOS=1\
		-DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1\
		-DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1\
		-DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1\
		-DTCL_SHLIB_EXT=\".so\" \
		-DHAVE_SYS_FILIO_H=1 \
		-DRETSIGTYPE=void \
		-DITCL_LIBRARY=\"${ITCL_LIBRARY}\"
CFLAGS+=	-Werror
LDADD+=		-L${PREFIX}/lib -ltcl${USE_TCL}

.if ${USE_TCL} >= 85
LDADD+=		-ltclstub${USE_TCL}
.endif

.PATH:	${.CURDIR}/unix ${.CURDIR}/generic ${.CURDIR}/man

SRCS=	itcl_bicmds.c itcl_class.c itcl_cmds.c itcl_ensemble.c \
	itcl_linkage.c itcl_methods.c itcl_migrate.c itcl_objects.c \
	itcl_parse.c itcl_util.c itclStubInit.c itclStubLib.c

pkgIndex.tcl: pkgIndex.tcl.in
	sed -e 's#"@PKG_LIB_FILE@"#.. ${SHLIB_NAME}#' -e "s#@PACKAGE_VERSION@#${MAJOR}.${MINOR}#" \
		< $> > $@

itclConfig.sh: itclConfig.sh.in
	sed -e 's#@itcl_LIB_FILE@#${SHLIB_NAME}#g' \
		-e "s#@PACKAGE_VERSION@#${MAJOR}.${MINOR}#" \
		-e 's#@itcl_BUILD_LIB_SPEC@#-L${LIBDIR} -litcl#' \
		-e 's#@itcl_LIB_SPEC@#-L${LIBDIR} -litcl#' < $> > $@

SCRIPTDIR=	lib/itcl${MAJOR}.${MINOR}
SCRIPTPATH=	${PREFIX}/${SCRIPTDIR}
LIBDIR=		${PREFIX}/lib
INCDIR=		${PREFIX}/include/itcl${MAJOR}.${MINOR}

${SCRIPTPATH} ${INCDIR}:
	mkdir -p ${.TARGET}

beforeinstall: pkgIndex.tcl itclConfig.sh ${SCRIPTPATH} ${INCDIR}
	${BSD_INSTALL_DATA} pkgIndex.tcl itclConfig.sh ${.CURDIR}/library/itcl.tcl \
		${SCRIPTPATH}
	${BSD_INSTALL_DATA} ${.CURDIR}/generic/*.h ${INCDIR}

.include <bsd.lib.mk>