help-make
[Top][All Lists]
Advanced

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

simply expanded variable getting overwritten


From: micron_make
Subject: simply expanded variable getting overwritten
Date: Mon, 20 Aug 2007 06:10:04 -0700 (PDT)

Hi,
I have one main makefile which includes two sub-makefiles residing in two
different directories.
 I have the following lines in my main make file

EXP_MOD_NAM:=one
include Module/$(EXP_MOD_NAM)/gen.mak

EXP_MOD_NAM:=two
include Module/$(EXP_MOD_NAM)/gen.mak

In both the sub-make files(gen.mak) I have the following same lines
(stripped down)
#to get all the c files
$(EXP_MOD_NAM)_NAM := $(wildcard Module/$(EXP_MOD_NAM)/*.c)
#to store "this" Module name
local_mod:= $(EXP_MOD_NAM)
#gloablly update files to build
FILES_TO_BUILD += $($(EXP_MOD_NAM)_NAM)

#below line will be  actually $(RM) Module/$(loc_mod)/*.bak in production
code 
CLCMD:=  Module/$(loc_mod)/*.bak

$(loc_mod)_clean: 
        @echo $(CLCMD) 

When I run 
>make one_clean 
I get Module/two/*.bak i.e. loc_mod is two  and not one. Since loc_mode is
simply expanded variable my thought was loc_mod should be one.As I see the
target expands to one_clean correctly but no the variable in the command. Is
this right behaviour? Is there a way to preserve the variable value
"locally"?

-- 
View this message in context: 
http://www.nabble.com/simply-expanded-variable-getting-overwritten-tf4298806.html#a12235661
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.





reply via email to

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