How to use ${WRKDIR}, ${PREFIX} and other variables in target names?

Lev Serebryakov lev at FreeBSD.org
Sun Jan 19 10:09:13 UTC 2014


Hello, Ports.

I want to write something like this in port's Makefile

===============================
SOME_FILE=${WRKDIR}/name

some-target: ${SOME_FILE}

${SOME_FILE}: ${WRKDIR}/${DISTNAME}
    # Some commands to generate ${SOME_FILE}
===============================

 But it doesn't work. make complains, that

"I don't know how to make /distname"

 Of course, ${WRKDIR}/${DISTNAME} exists (it is directory with unpacked
sources).

 It looks like WRKDIR is not defined when target/prerequisites names are
expanded.

 I've tried to use bsd.port.pre.mk/bsd.port.post.mk, but it doesn't help
at all.

-- 
// Black Lion AKA Lev Serebryakov <lev at FreeBSD.org>



More information about the freebsd-ports mailing list