Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Dec 2003 19:24:27 +0100
From:      nivit@email.it (Nicola Vitale)
To:        freebsd-ports@freebsd.org
Subject:   Re: Help with 'exists' in Makefile
Message-ID:  <20031208182427.GA5296@Psyllobora>
In-Reply-To: <3FD43680.6090001@ciam.ru>
References:  <3FD43680.6090001@ciam.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
> [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 <bsd.port.mk>

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 <bsd.port.post.mk>

but this usage is forbidden. :)

Ciao.
-- 
Nicola S. Vitale
nivit@email.it



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