bug-make
[Top][All Lists]
Advanced

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

RE: Using $(eval) to get information at the time a target is invoked


From: Hsu, Shihchieh IAS
Subject: RE: Using $(eval) to get information at the time a target is invoked
Date: Sat, 8 Jan 2011 11:40:23 -0500

My earlier example makefile did not emphasize the fact that information should 
be obtained when target is invoked.  Here is as better example:

SRC_DIR = ./

PROG_NAME = test

define PROGRAM_template
        $(1)_SRC_DIR   = $$(SRC_DIR)
        $(1)_SRC_FILES = $$(wildcard $$($(1)_SRC_DIR)*.c)
endef

clean:
        del hello.c

all:
        $(eval $(call PROGRAM_template,$(PROG_NAME)))
        rem $(test_SRC_DIR)
        rem $(test_SRC_FILES)
        rem $(wildcard $(test_SRC_DIR)*.c)

The change is where the $(eval) is located.

Identical results are obtained as before.  So the issue is probably not when 
GNU/Linux renews the cache $(eval), but when Windows/Make refresh/update the 
cache.

Thanks,

SC Hsu

-----Original Message-----
From: Eli Zaretskii [mailto:address@hidden 
Sent: Saturday, January 08, 2011 4:35 AM
To: address@hidden
Cc: Hsu, Shihchieh IAS; address@hidden
Subject: Re: Using $(eval) to get information at the time a target is invoked

> From: Paul Smith <address@hidden>
> Date: Fri, 07 Jan 2011 21:58:53 -0500
> Cc: address@hidden
> 
> I realize that maybe this doesn't matter on Windows where the filesystem
> is not case-sensitive, but of course on Linux if you delete "hello.c"
> that won't have any impact on "Hello.c" which is why "Hello.c" still
> exists after the "rm".
> 
> In your second example, with the subdirectory, you get the cases the
> same:
> 
> > A makefile (makefile_sav) looking for files under a subfolder <test>
> > works: (<test> contains hello.c and world.c files)
> > 
> > clean:
> >         del test\hello.c
> 
> and it works.  I don't know enough about Windows to say if this case
> difference really matters, but you might try that.

No, it doesn't matter.  The _real_ difference (one that is not easy to
arrive at, reading just the text of the report) is that in the first
example, Make is invoked from _within_ the `test' directory, while in
the second example, it is invoked from the _parent_ of `test'.

> Please post a message on the address@hidden mailing list if you can't
> figure it out: the folks on that list are a lot more knowledgeable about
> make running on DOS/Windows platforms.

No need, for the moment: I can reproduce the problem with the Windows
build of Make 3.82.

But I wonder if this is really Windows-specific.  Could this be the
example you asked for in Savannah bug#443 and #14617 (which was hoped
to be solved in bug#21231)?  Can you tell me what causes Make to renew
the cache used by $(wildcard) on GNU/Linux?  I could then try to see
why it does not happen on Windows in this case.



reply via email to

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