From owner-freebsd-ports@FreeBSD.ORG Sun Jan 19 10:23:50 2014 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 808233BE; Sun, 19 Jan 2014 10:23:50 +0000 (UTC) Received: from shepard.synsport.net (mail.synsport.com [208.69.230.148]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59C871162; Sun, 19 Jan 2014 10:23:49 +0000 (UTC) Received: from [192.168.0.23] (unknown [130.255.19.191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by shepard.synsport.net (Postfix) with ESMTP id AD619438BC; Sun, 19 Jan 2014 04:23:27 -0600 (CST) Message-ID: <52DBA78F.30403@marino.st> Date: Sun, 19 Jan 2014 11:23:11 +0100 From: John Marino User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: lev@FreeBSD.org Subject: Re: How to use ${WRKDIR}, ${PREFIX} and other variables in target names? References: <788996080.20140119140901@serebryakov.spb.ru> In-Reply-To: <788996080.20140119140901@serebryakov.spb.ru> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: ports@FreeBSD.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: marino@freebsd.org List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jan 2014 10:23:50 -0000 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