aboutsummaryrefslogtreecommitdiff
path: root/Mk/Uses/waf.mk
blob: 06b41c02304e10018af38ca6e1ee6f6cfc588dc5 (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
# Provide support to use the waf building system
#
# Feature:		waf
# Usage:		USES=waf
#
# It implies USES=python:build automatically is no USES=python has been
# specified yet
#
# WAF_CMD		can be specified in the ports if the waf script is not
# 			in WRKSRC/waf
# CONFIGURE_TARGET	default to 'configure'
# ALL_TARGET		default to 'build'
# INSTALL_TARGET=	default to 'install'

.if !defined(_INCLUDE_USES_WAF_MK)
_INCLUDE_USES_WAF_MK=	yes

.  if !empty(waf_ARGS)
IGNORE=	Incorrect 'USES+= waf:${waf_ARGS}' waf takes no arguments
.  endif

.  if !${USES:Mpython*}
python_ARGS=	build
.include "${USESDIR}/python.mk"
.  endif

MAKEFILE=	#
MAKE_FLAGS=	#
ALL_TARGET=	#
HAS_CONFIGURE=	yes
MAKE_ARGS+=	--verbose
WAF_CMD?=	./waf

CONFIGURE_TARGET?=	configure
ALL_TARGET?=		build
INSTALL_TARGET?=	install
TEST_TARGET?=		test

CONFIGURE_CMD=	${PYTHON_CMD} ${WAF_CMD} ${CONFIGURE_TARGET}
MAKE_CMD=	${PYTHON_CMD} ${WAF_CMD}
CONFIGURE_ARGS+=	--prefix=${PREFIX} \
			${_MAKE_JOBS}

DESTDIRNAME=	--destdir

# Set a minimal job of 1
_MAKE_JOBS=	-j${MAKE_JOBS_NUMBER}

.endif