optionally include file within a Makefile

Dan Langille dan at langille.org
Thu Dec 18 17:13:19 PST 2003


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 at 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 at polo:~] $ cat .bacula-regress
BACULA_SOURCE="${HOME}/src/bacula-cvs"
EMAIL=dan+bacula at langille.org
AUTOCHANGER="/dev/null"

A="stuff"
echo yes, we have stuff here.
[dan at 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

Stop in /usr/home/dan.
[dan at polo:~] $
-- 
Dan Langille : http://www.langille.org/



More information about the freebsd-hackers mailing list