help-make
[Top][All Lists]
Advanced

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

RE: VPATH


From: MD.Mahbubur Rahman
Subject: RE: VPATH
Date: Tue, 20 Sep 2011 06:33:53 -0700 (PDT)

Got the point. Now I understand clearly. Thanks a lot.



Paul Smith-20 wrote:
> 
> On Wed, 2011-09-14 at 01:53 -0700, MD.Mahbubur Rahman wrote:
>> So for these two lines:
>> files_hpp = $(wildcard *.h) 
>> files_cpp = $(wildcard *.cpp)
>> 
>> How I can make VPATH work for?
> 
> I'll answer this:
> 
>         files_hpp = $(foreach DIR,$(subst :, ,$(VPATH)),$(wildcard
> $(DIR)/*.h)
>         files_cpp = $(foreach DIR,$(subst :, ,$(VPATH)),$(wildcard
> $(DIR)/*.cpp)
> 
> but I'll say that IMO this is a bad idea.  I personally always recommend
> that makefiles list the files they want to compile explicitly, and not
> try to get them via wildcard.  The latter is very error-prone: extra
> files might exist and be accidentally compiled; files may be missing and
> not be compiled, etc.
> 
> -- 
> -------------------------------------------------------------------------------
>  Paul D. Smith <address@hidden>          Find some GNU make tips at:
>  http://www.gnu.org                      http://make.mad-scientist.net
>  "Please remain calm...I may be mad, but I am a professional." --Mad
> Scientist
> 
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-make
> 
> 

-- 
View this message in context: 
http://old.nabble.com/VPATH-tp30680920p32501068.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.




reply via email to

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