Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jan 2014 11:23:11 +0100
From:      John Marino <freebsd.contact@marino.st>
To:        lev@FreeBSD.org
Cc:        ports@FreeBSD.org
Subject:   Re: How to use ${WRKDIR}, ${PREFIX} and other variables in target names?
Message-ID:  <52DBA78F.30403@marino.st>
In-Reply-To: <788996080.20140119140901@serebryakov.spb.ru>
References:  <788996080.20140119140901@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

On 1/19/2014 11:09, Lev Serebryakov wrote:
> 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.


Many ports carry a BSD makefile in the files subdirectory, install that
and that makefile does all the internal building.

What you are attempting is not done.

The ports Makefiles are meant to handle major targets (configure, build,
install), not do the low level building.  You should have a separate
makefile in WRKSRC for that.

John





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52DBA78F.30403>