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 <[email protected]>          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
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to