[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: .SECONDEXPAND and spaces?
From: |
Paul D. Smith |
Subject: |
RE: .SECONDEXPAND and spaces? |
Date: |
Wed, 3 May 2006 07:58:33 -0400 |
%% "Leeuwesteijn,Joost" <address@hidden> writes:
l> Is there a big performance penalty when putting .SECONDEXPANSION at
l> the top of my (toplevel) makefile? Probably not in my small
l> project, but in general. Could it be a problem in large project? I
l> suppose not because the files will be loaded to memory only once;
l> it's all done in memory which shouldn't really make a big
l> difference.
There is a very slight performance penalty in that when .SECONDEXPANSION
is enabled make performs a second expansion pass in various places where
it doesn't need to otherwise.
l> Could .SECONDEXPANSION have any other unwanted side-effects I
l> should worry about?
If you have "normal" prerequisite files that contain "$" in the names
(many Java files do this for example) then you'll have big problems
enabling .SECONDEXPANSION.
Otherwise, there is no issue.
>> -----Original Message-----
>>
>> When I try to do secondary expansion, it seems to work.
>> Adding a simple string to the target name:
>> $(MOD1.OBJECTS) : address@hidden
>> gives a make -p output of:
>> OUTPUT/MOD1/mod1file2.o: OUTPUT/MOD1/mod1file2.o-fubar
>> Which is OK.
>>
>>
>> When I try to mangle the prerequisite a bit more (just a test)
>> it doesn't seem to work:
>> $(MOD1.OBJECTS) : $(MOD1.SOURCEDIR)/$$(notdir $$@)
>> gives a make -p output of:
>> OUTPUT/MOD1/mod1file1.o: MOD1/$(notdir) MOD1/$($@)
>> Which is not what I expected.
It sounds like you're using an older version of GNU make.
The .SECONDEXPANSION feature is only available starting in GNU make
3.81.
--
-------------------------------------------------------------------------------
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