1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-05 01:55:52 +00:00
freebsd-ports/Mk/bsd.scons.mk
Alejandro Pulver 8131b5a9a5 - Respect BUILD_WRKSRC and INSTALL_WRKSRC as bsd.port.mk does.
PR:		ports/112281
Submitted by:	alepulver (myself)
Approved by:	alexbl (maintainer)
2007-06-05 02:06:10 +00:00

89 lines
2.4 KiB
Makefile

#-*- mode: Makefile; tab-width: 4; -*-
# ex:ts=4
#
# $FreeBSD$
#
# bsd.scons.mk - Python-based SCons build system interface.
# Author: Alexander Botero-Lowry <alexbl@FreeBSD.org>
#
# Please view me with 4 column tabs!
# Please make sure all changes to this file are passed through the maintainer.
SCONS_MAINTAINER= alexbl@FreeBSD.org
#
# SCONS_BIN is the location where the scons port installs the scons
# executable.
#
# SCONS_PORT is where the scons port is located in the ports tree.
#
SCONS_BIN= ${LOCALBASE}/bin/scons
SCONS_PORT= ${PORTSDIR}/devel/scons
#
# CCFLAGS is the scons equivalent of CFLAGS. So we should bring in our
# FreeBSD CFLAGS.
#
# LINKFLAGS is equivalent to LDFLAGS in make speak, so we bring in the
# FreeBSD default LDFLAGS.
#
# Some scons projects may honor PKGCONFIGDIR, which tells them where to
# look for, and install, pkgconfig files.
#
# LIBPATH is the search path for libraries. Bring in some safe defaults.
#
# CPPPATH is the search path for includes, Again, bring in some safe defaults.
#
CCFLAGS?= ${CFLAGS}
LINKFLAGS?= ${LDFLAGS}
PKGCONFIGDIR?= ${LOCALBASE}/libdata/pkgconfig
LIBPATH?= ${LOCALBASE}/lib ${X11BASE}/lib
CPPPATH?= ${LOCALBASE}/include ${X11BASE}/include
#
# SCONS_ENV is where we pass all the stuff that should be the
# same for any scons port to scons. Things like CCFLAGS, and LINKFLAGS
# go here.
#
# SCONS_ARG is where you pass port specific scons flags to the scons
# enviornment.
#
# SCONS_BUILDENV is where you pass variables you want to be in the
# System Enviornment instead of the SCons Enviornment.
#
# SCONS_TARGET is the same as MAKE_TARGET it is passed as the last
# argument to scons.
#
SCONS_ENV?= CCFLAGS="${CCFLAGS}" CXXFLAGS="${CXXFLAGS}" \
LINKFLAGS="${LINKFLAGS}" PKGCONFIGDIR="${PKGCONFIGDIR}" \
CPPPATH="${CPPPATH}" LIBPATH="${LIBPATH}" PREFIX="${PREFIX}" \
CC="${CC}" CXX="${CXX}"
SCONS_ARGS?=
SCONS_BUILDENV?=
SCONS_TARGET?=
#
# SCONS_INSTALL_TARGET is the default target to be used when
# installing a port using scons.
#
SCONS_INSTALL_TARGET?= ${INSTALL_TARGET}
#
# Make sure we depend on scons
#
BUILD_DEPENDS+= ${SCONS_BIN}:${SCONS_PORT}
.if !target(do-build)
do-build:
@cd ${BUILD_WRKSRC} && \
${SETENV} ${SCONS_BUILDENV} ${SCONS_BIN} ${SCONS_ENV} ${SCONS_ARGS} \
${SCONS_TARGET}
.endif
.if !target(do-install)
do-install:
@cd ${INSTALL_WRKSRC} && ${SETENV} ${SCONS_BUILDENV} ${SCONS_BIN} \
${SCONS_ENV} ${SCONS_ARGS} ${SCONS_INSTALL_TARGET}
.endif