[Top][All Lists]

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

Strange behaviour with variable

From: hans . peter . van . lohuizen
Subject: Strange behaviour with variable
Date: Tue, 6 Jan 2004 12:07:27 +0100


When experimenting with some input variables I found the following strange behaviour:

I have an external module.hier file listing modules to be processed.
I use the following lines in the generic makefile:

 MODULES   = $(shell cat module.hier | $(GREP) )                         #determine list of modules
 TOP_MOD   = $(word $(words $(MODULES)),$(MODULES) )   #determine last module from list : makefile \
        @rm -f $@;\
        for t in $(MODULES); do \
                print "$$t/ddb/generic.db : \\"                             >>$@;\
                print "       \$$(wildcard $$t/../RTL/*.vhdl)"        >>$@;\
        print "proj/$$t/synopsys/ddb/scanopt.db : \\"                >>$@;\
        print "       \$$(wildcard proj/$$t/../NETLIST/*_netlist_scn.v)"                >>$@;\
              print "proj/$(TOP_MOD)/synopsys/ddb/scanopt.db : \\"                      >>$@;\
        print "       \$$(wildcard proj/$(TOP_MOD)/../NETLIST/*_netlist_scn.v)"  >>$@;

What I get as a result (only 'module1'  in module.hier) is:

module1/ddb/generic.db : \
       $(wildcard module1/cmd/*specific.tcl) \
       $(wildcard module1/../RTL/*.vhdl)
proj/module1/synopsys/ddb/scanopt.db : \
       $(wildcard proj/module1/../NETLIST/*_netlist_scn.v)
proj/module1   /synopsys/ddb/scanopt.db : \
       $(wildcard proj/module1   /../NETLIST/*_netlist_scn.v)

Could somebody explain to me why in the last two lines there are spaces after the module1 name??
When I do an echo of $(TOP_MOD) I do not see these spaces!
I would expect the last two proj/... lines to be the same.


Hans Peter.
reply via email to

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