From owner-freebsd-ports@FreeBSD.ORG Mon Dec 8 10:32:28 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5562216A4CE for ; Mon, 8 Dec 2003 10:32:28 -0800 (PST) Received: from vsmtp12.tin.it (vsmtp12.tin.it [212.216.176.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5B9E43F93 for ; Mon, 8 Dec 2003 10:32:26 -0800 (PST) (envelope-from nivit@email.it) Received: from psyllobora (62.211.129.149) by vsmtp12.tin.it (7.0.019) id 3FD28ED2000E2398 for freebsd-ports@freebsd.org; Mon, 8 Dec 2003 19:32:25 +0100 Received: (qmail 5468 invoked by uid 1005); 8 Dec 2003 18:24:27 -0000 From: nivit@email.it (Nicola Vitale) Date: Mon, 8 Dec 2003 19:24:27 +0100 To: freebsd-ports@freebsd.org Message-ID: <20031208182427.GA5296@Psyllobora> References: <3FD43680.6090001@ciam.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FD43680.6090001@ciam.ru> X-Operating-System: FreeBSD/i386 (http://www.freebsd.org) User-Agent: Mutt (http://www.mutt.org) Subject: Re: Help with 'exists' in Makefile X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2003 18:32:28 -0000 > [Sergey Matveychuk, 2003-12-08T11:29:52+00:00] > [...] > Why '.if exists()' always fails? > > [...] > TESTS_COOKIE= ${WRKDIR}/.tests_built > [...] > test: build > .if exists(${TESTS_COOKIE}) > @${ECHO_MSG} "===> Running tests."; \ > ${ECHO_MSG} "===> Tests done." > .else > @${ECHO_MSG} "===> Tests was not build"; \ > ${ECHO_MSG} "" > .endif > > .include Because the WRKDIR variable is defined in post-makefile section, so when your target (test) is built it is null. Try this: # touch /.tests_built # make test It also works, for example, if you put your target after the directive .include but this usage is forbidden. :) Ciao. -- Nicola S. Vitale nivit@email.it