On Mon, 2011-01-10 at 10:31 -0800, samantha domville wrote:
> Hi - I have an include directory with many .h files. I need to create a rule
> which is a SINGLE line to loop through all *.h files in the include directory
> to
> create a HEADER list (below) instead of manually creating the list.
>
> HEADER += a.hh
> HEADER += b.hh
> HEADER += c.hh
> ....
>
>
> So I need a foreach loop which loops through all the include/*.h files, and
> appends them with a .hh and adds them to the HEADER += . list. Possibly
> something like this, which I will mess up but anyway:
>
> $(foreach i, $(INCLUDE_DIR)/%.h )
> HEADER += $(@:%.h=%.hh)
>
> please help, thanks
I'm assuming that these .h files already exist; that is they're source
code and not derived objects created as part of the build.
If so, can't you just use:
HEADER := $(patsubst %.h,%.hh,$(wildcard $(INCLUDE_DIR)/*.h))
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make