Subject: Re: Makefile targets and variables
To: Johnny C. Lam <jlam@netbsd.org>
From: Mike M. Volokhov <mishka@terabyte.com.ua>
List: tech-pkg
Date: 09/09/2003 15:55:42
Johnny C. Lam wrote:
> On Mon, Sep 08, 2003 at 05:28:08PM +0300, Mike M. Volokhov wrote:
> 
>>Lets follow some example:
>>---- cut ---
>>post-extract:
>>.if exists(${WRKSRC}/some-file)
>>        echo "true"
>>        ${LS} -l ${WRKSRC}/some-file
>>.else
>>        echo "false"
>>        ${LS} -l ${WRKSRC}/some-file
>>.endif
>>---- cut ---
>>
>>% make extract
>>===> Checking for vulnerabilities in foo-1.0
>>=> Checksum OK for foo-1.0.tar.gz.
>>===> Extracting for foo-1.0
>>echo "false"
>>false
>>/bin/ls -l /usr/pkgsrc/wip/foo/work/foo-1.0/some-file
>>-rwxr-xr-x  1 mishka  users  647 Jan  6  2003 
>>/usr/pkgsrc/wip/foo/work/foo-1.0/some-file
>>%
> 
> 
> You want:
> 
> post-extract:
> 	@if [ -f ${WRKSRC}/some-file ]; then	\
> 		# do stuff here
> 	fi
> 
> There's no need to do the file existence check at the Makefile level.
> 

Yes, that's exactly what i did. Thanks!

--
Mishka.