6 # bsd.scons.mk - Python-based SCons build system interface.
7 # Author: Alexander Botero-Lowry <alexbl@FreeBSD.org>
9 # Please view me with 4 column tabs!
11 # Please make sure all changes to this file are passed through the maintainer.
12 SCONS_MAINTAINER= python@FreeBSD.org
15 # SCONS_BIN is the location where the scons port installs the scons
18 # SCONS_PORT is where the scons port is located in the ports tree.
20 SCONS_BIN= ${LOCALBASE}/bin/scons
21 SCONS_PORT= ${PORTSDIR}/devel/scons
24 # CCFLAGS is the scons equivalent of CFLAGS. So we should bring in our
27 # LINKFLAGS is equivalent to LDFLAGS in make speak, so we bring in the
28 # FreeBSD default LDFLAGS.
30 # Some scons projects may honor PKGCONFIGDIR, which tells them where to
31 # look for, and install, pkgconfig files.
33 # LIBPATH is the search path for libraries. Bring in some safe defaults.
35 # CPPPATH is the search path for includes, Again, bring in some safe defaults.
38 LINKFLAGS?= ${LDFLAGS}
39 PKGCONFIGDIR?= ${LOCALBASE}/libdata/pkgconfig
40 LIBPATH?= ${LOCALBASE}/lib
41 CPPPATH?= ${LOCALBASE}/include
44 # SCONS_ENV is where we pass all the stuff that should be the
45 # same for any scons port to scons. Things like CCFLAGS, and LINKFLAGS
48 # SCONS_ARGS is where you pass port specific scons flags to the scons
51 # SCONS_BUILDENV is where you pass variables you want to be in the
52 # System Environment instead of the SCons Environment.
54 # SCONS_TARGET is the same as MAKE_TARGET it is passed as the last
57 SCONS_ENV?= CCFLAGS="${CCFLAGS}" CXXFLAGS="${CXXFLAGS}" \
58 LINKFLAGS="${LINKFLAGS}" PKGCONFIGDIR="${PKGCONFIGDIR}" \
59 CPPPATH="${CPPPATH}" LIBPATH="${LIBPATH}" PREFIX="${PREFIX}" \
60 CC="${CC}" CXX="${CXX}"
65 .if !defined(NO_STAGE)
66 SCONS_ARGS+= ${DESTDIRNAME}=${STAGEDIR}
70 # SCONS_INSTALL_TARGET is the default target to be used when
71 # installing a port using scons.
73 SCONS_INSTALL_TARGET?= ${INSTALL_TARGET}
76 # Make sure we depend on scons
78 BUILD_DEPENDS+= ${SCONS_BIN}:${SCONS_PORT}
82 @cd ${BUILD_WRKSRC} && \
83 ${SETENV} ${SCONS_BUILDENV} ${SCONS_BIN} ${SCONS_ENV} ${_MAKE_JOBS} \
84 ${SCONS_ARGS} ${SCONS_TARGET}
87 .if !target(do-install)
89 @cd ${INSTALL_WRKSRC} && ${SETENV} ${SCONS_BUILDENV} ${SCONS_BIN} \
90 ${SCONS_ENV} ${SCONS_ARGS} ${SCONS_INSTALL_TARGET}