Hello,
I need to expand a variable as an argument to patsubst, as in the following 
code snippet:

SRC := src
SRCEXT := .c .cpp
OBJEXT := .o .o
comma := ,
SUB = $(join $(addsuffix $(comma),$(addprefix %%,$(SRCEXT))),$(addprefix 
%%,$(OBJEXT)))
OBJ = $(patsubst $(SUB),$(wildcard $(addprefix $(SRC)/*,$(SRCEXT))))

test : 
    echo $(OBJ)

Expansion of $(OBJ) fails when make discovers patsubst is missing an argument 
(though the expanded contents of $(SUB) are "%.c,%.o"). Trying various 
combinations of $(eval $(value OBJ)) doesn't seem any closer to working. The 
goal is to gather source files and turn them into targets (i.e. list of files 
"foo.c bar.c baz.cpp", becomes list of targets "foo.o bar.o baz.o")

Am I approaching this in the right way? if so, how can I expand variables as 
arguments to functions?

Thanks,
Anthony
                                          
_________________________________________________________________
Learn more ways to connect with your buddies now
http://go.microsoft.com/?linkid=9734388
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to