1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-11 02:50:24 +00:00
freebsd-ports/Mk/Uses/pure.mk
Tijl Coosemans fe837ee6c6 Change the way USES is handled:
- Loop over USES twice, once to define all *_ARGS variables and once to
  include Uses/*.mk.  This allows all Uses/*.mk to examine arguments given
  to other USES entries.
- Always define *_ARGS (possibly empty) and replace commas with spaces.

Similar for _USES_POST.

Adjust all Uses/*.mk:
- defined(u_ARGS) becomes !empty(u_ARGS)
- Eliminate helper variables like _*_ARGS=${*_ARGS:C/,/ /g}
- Some Uses/*.mk used ":" as argument separator instead of ",", but no port
  used this form
- Uses/cran.mk: remove unused variable VALID_ARGS and USES+=fortran which
  has no effect
- Uses/twisted.mk: simplify handling of the case where neither "build" nor
  "run" arguments have been specified

PR:		193931
Exp-run by:	antoine
Approved by:	portmgr (antoine)
2014-09-28 16:36:31 +00:00

40 lines
990 B
Makefile

# Created by: Rusmir Dusko <nemysis@FreeBSD.org>
# $FreeBSD$
#
# Provide support for Pure Programming Language based projects
#
# Feature: pure
# Usage: USES=pure or USES=pure:ARGS
# Valid ARGS: ffi
# ARGS description:
# ffi makes the port depends on pure-ffi at runtime
#
# MAINTAINER= nemysis@FreeBSD.org
.if !defined(_INCLUDE_USES_PURE_MK)
_INCLUDE_USES_PURE_MK= yes
_valid_ARGS= ffi
# Sanity check
.for arg in ${pure_ARGS}
. if empty(_valid_ARGS:M${arg})
IGNORE= Incorrect 'USES+= pure:${pure_ARGS}' usage: argument [${arg}] is not recognized
. endif
.endfor
LIB_DEPENDS+= libpure.so:${PORTSDIR}/lang/pure
.include "${USESDIR}/gmake.mk"
.if ${pure_ARGS:Mffi}
RUN_DEPENDS+= ${LOCALBASE}/lib/pure/ffi.pure:${PORTSDIR}/devel/pure-ffi
.endif
MAKE_ARGS+= prefix=${PREFIX} mandir=${PREFIX}/man \
CC=${CC} CFLAGS="${CFLAGS}" \
CXX=${CXX} CXXFLAGS="${CXXFLAGS}" \
CPPFLAGS+=-I${LOCALBASE}/include \
LDFLAGS+=-L${LOCALBASE}/lib
.endif #!defined(_INCLUDE_USES_PURE_MK)