gnu make help

John Vetterli jvetterli-zC6tqtfhjqE at public.gmane.org
Fri May 11 15:05:14 UTC 2007


A variable set on the command line cannot be changed by a line in the makefile 
unless you use the "override" directive.  Try this:

ifeq "${NETWORK}" "10_208_66_0"
       PUBLICKEY=root-10.208.66.59.pub
       override NETWORK=172_16_0_0
endif

For reference:
http://www.gnu.org/software/make/manual/html_node/Override-Directive.html

HTH
JV


On Fri, 11 May 2007, Neil Watson wrote:

> Consider this code:
>
> # makefile
>
> # This file will build a boot strap client. 
> SHELL=/bin/bash
> AWK=/bin/awk
> SVN=/usr/local/bin/svn
>
> # Define public key based on varible input
> ifeq "${NETWORK}" "172_16_0_0"
>       PUBLICKEY=root-172.16.48.66.pub
> endif
> ifeq "${NETWORK}" "192_168_0_0"
>       PUBLICKEY=root-192.168.81.43.pub
> endif
> ifeq "${NETWORK}" "10_208_66_0"
>       PUBLICKEY=root-10.208.66.59.pub
>       NETWORK=172_16_0_0
> endif
>
> WORKDIR=/var/cfengine
> BINDIR=/usr/local/sbin
> TARFILES=makefile \
>       bin/${VERSION}/cfagent\
>       bin/${VERSION}/cfkey \
>       bin/${VERSION}/cfexecd \
>       inputs/${NETWORK}/update.conf \
>       init.d/cfexecd.sv \
>       ppkeys/${PUBLICKEY} \
>       REVISION.txt
>
> Now consider this make command and the error:
>
> [nhwatson at tor-lx-config config]$ make client VERSION=redhat_as_4 
> NETWORK=10_208_66_0
> make: *** No rule to make target `inputs/10_208_66_0/update.conf', needed by 
> `client'.  Stop.
>
> Why is the network variable not reassigned to '172_16_0_0'?
>
> -- 
> Neil Watson             | Debian Linux
> System Administrator    | Uptime 7 days
> http://watson-wilson.ca
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list