Import security/amavis-stats version 0.1.12_3
[dports.git] / Mk / bsd.scons.mk
1 #-*- tab-width: 4; -*-
2 # ex:ts=4
3 #
4 # $FreeBSD$
5 #
6 # bsd.scons.mk - Python-based SCons build system interface.
7 # Author: Alexander Botero-Lowry <alexbl@FreeBSD.org>
8 #
9 # Please view me with 4 column tabs!
10
11 # Please make sure all changes to this file are passed through the maintainer.
12 SCONS_MAINTAINER=       python@FreeBSD.org
13
14 #
15 # SCONS_BIN is the location where the scons port installs the scons
16 # executable.
17 #
18 # SCONS_PORT is where the scons port is located in the ports tree.
19 #
20 SCONS_BIN=      ${LOCALBASE}/bin/scons
21 SCONS_PORT=     ${PORTSDIR}/devel/scons
22
23 #
24 # CCFLAGS is the scons equivalent of CFLAGS. So we should bring in our
25 # FreeBSD CFLAGS.
26 #
27 # LINKFLAGS is equivalent to LDFLAGS in make speak, so we bring in the
28 # FreeBSD default LDFLAGS.
29 #
30 # Some scons projects may honor PKGCONFIGDIR, which tells them where to
31 # look for, and install, pkgconfig files.
32 #
33 # LIBPATH is the search path for libraries. Bring in some safe defaults.
34 #
35 # CPPPATH is the search path for includes, Again, bring in some safe defaults.
36 #
37 CCFLAGS?=       ${CFLAGS}
38 LINKFLAGS?=     ${LDFLAGS}
39 PKGCONFIGDIR?=  ${LOCALBASE}/libdata/pkgconfig
40 LIBPATH?=       ${LOCALBASE}/lib
41 CPPPATH?=       ${LOCALBASE}/include
42
43 #
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
46 # go here.
47 #
48 # SCONS_ARGS is where you pass port specific scons flags to the scons
49 # environment.
50 #
51 # SCONS_BUILDENV is where you pass variables you want to be in the
52 # System Environment instead of the SCons Environment.
53 #
54 # SCONS_TARGET is the same as MAKE_TARGET it is passed as the last
55 # argument to scons.
56 #
57 SCONS_ENV?=     CCFLAGS="${CCFLAGS}" CXXFLAGS="${CXXFLAGS}" \
58                 LINKFLAGS="${LINKFLAGS}" PKGCONFIGDIR="${PKGCONFIGDIR}"  \
59                 CPPPATH="${CPPPATH}" LIBPATH="${LIBPATH}" PREFIX="${PREFIX}" \
60                 CC="${CC}" CXX="${CXX}"
61 SCONS_ARGS?=
62 SCONS_BUILDENV?=
63 SCONS_TARGET?=
64
65 .if !defined(NO_STAGE)
66 SCONS_ARGS+=    ${DESTDIRNAME}=${STAGEDIR}
67 .endif
68
69 #
70 # SCONS_INSTALL_TARGET is the default target to be used when
71 # installing a port using scons.
72 #
73 SCONS_INSTALL_TARGET?=  ${INSTALL_TARGET}
74
75 #
76 # Make sure we depend on scons
77 #
78 BUILD_DEPENDS+= ${SCONS_BIN}:${SCONS_PORT}
79
80 .if !target(do-build)
81 do-build:
82         @cd ${BUILD_WRKSRC} && \
83         ${SETENV} ${SCONS_BUILDENV} ${SCONS_BIN} ${SCONS_ENV} ${_MAKE_JOBS} \
84         ${SCONS_ARGS} ${SCONS_TARGET}
85 .endif
86
87 .if !target(do-install)
88 do-install:
89         @cd ${INSTALL_WRKSRC} && ${SETENV} ${SCONS_BUILDENV} ${SCONS_BIN} \
90         ${SCONS_ENV} ${SCONS_ARGS} ${SCONS_INSTALL_TARGET}
91 .endif
92