[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: writing to make file
From: |
Paul Smith |
Subject: |
Re: writing to make file |
Date: |
Wed, 01 Aug 2007 02:41:23 -0400 |
On Tue, 2007-07-31 at 22:40 -0700, micron_make wrote:
> In one of my make make files I do the following:
> files_path=$(abspath $(wildcard ../src/*.c))
> filt=$(subst /, ,$(files_path))
> mod_name_filter=$(filter Module_%,$(filt))
> MODULE_NAME=$(mod_name_filter)
Weird, but OK. I really, really think you want to be using := (simple)
assignment here, though, not = (recursive) assignment.
> $(MODULE_NAME) will contain the directory name I want (i.e. the name
> Module_ followed by any text)
It could possibly even contain more than one.
> I have included this make file in another make file which uses
> $(MODULE_NAME). This works fine.
>
> What I actually want is , instead of referencing the variable
> MODULE_NAME, I need to paste its value (i.e. the text Module_ followed
> by any text). This is required since my module specific make files are
> supposed to contain the name of the directory and not a generic
> reference. I understand this would require some kind of file write
> operation.
I really don't know what you mean by "paste its value" and "require some
kind of file write operation". Are you trying to create a new makefile,
or change an existing one, by adding that value to it in some way? Why
not just use the variable?
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist