Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 2003 01:13:20 -0500
From:      chuckr <chuckr@chuckr.org>
To:        Dan Langille <dan@langille.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: optionally include file within a Makefile
Message-ID:  <3FE29700.5060505@chuckr.org>
In-Reply-To: <3FE20A5C.2872.92C92363@localhost>
References:  <3FE20A5C.2872.92C92363@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
Dan Langille wrote:

>On 18 Dec 2003 at 19:02, Dan Langille wrote:
>
>  
>
>>My goal is provide a way to override values in a Makefile with values
>>from a local config file.
>>    
>>
>
>I'm getting further.  What's the proper way to do an include?
>
>[dan@polo:~] $ cat Makefile
>A?="things"
>
>all:
>        @echo A is $A
>        if [ -r ${HOME}/.bacula-regress ] ; then \
>                echo loading tha file; \
>                .include "${HOME}/.bacula-regress" ; \
>        fi
>
>        @echo A is $A
>[dan@polo:~] $ cat .bacula-regress
>BACULA_SOURCE="${HOME}/src/bacula-cvs"
>EMAIL=dan+bacula@langille.org
>AUTOCHANGER="/dev/null"
>
>A="stuff"
>echo yes, we have stuff here.
>[dan@polo:~] $ make
>A is things
>if [ -r /home/dan/.bacula-regress ] ; then  echo loading tha file;  
>.include "/home/dan/.bacula-regress" ;  fi
>loading tha file
>.include: not found
>*** Error code 127
>  
>
.if exists(your filename, relative to /usr/share/mk)
.include <whatever>    or
include (not documented, but it works, abs path)
.endif

>Stop in /usr/home/dan.
>[dan@polo:~] $
>  
>




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