help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setting variable value


From: Aditya Kher
Subject: setting variable value
Date: Wed, 23 Aug 2006 14:39:43 +0530

GNU Make 3.79

Lets say I have a Makefile like this

FOO:=<some_dir>

all: target_1 target_2

target_1:
  cd ${FOO}
  ls

targe_2:
  cd ${FOO}
  ls

Now  I want to ensure that for FOO is set to different directory for
target_1 and target_2
so I added following to this Makefile

ifeq(${MAKECMDGOALS}, target_1)
FOO = dir_1
endif

ifeq (${MAKECMDGOALS}, target_2)
FOO = dir_2
endif

but if I execute gmake all then I want FOO to be changed to dir_1
while it is making target_1 and dir_2 while it is making target_2
That doesnt happen with above code.
Ideas?


--
Aditya Kher
http://kher.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]