help-make
[Top][All Lists]
Advanced

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

Re: Help copying & renaming filename inside makefile.


From: givemecode
Subject: Re: Help copying & renaming filename inside makefile.
Date: Tue, 11 Jan 2011 06:51:16 -0800 (PST)


Oleksandr Gavenko-2 wrote:
> 
> On 10.01.2011 20:52, givemecode 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
> 
> HEADER += $(patsubst %.h,%.hh,$(widlcard $(INCLUDE_DIR)/%.h))
> 
> -- 
> С уважением, Александр Гавенко.
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
> 
> 







I tried putting that line in my makefile and it doesn't seem to create a
list that I need (probably operator error).

Here is what I am currently doing:

in my include directory I have a bunch of .h files.
>ls include/*
a.h
b.h
c.h

Then, in a makefile I typed a list of identical filenames except I changed
the extension

makefile:
###############################
HEADER = a.hh
HEADER += b.hh
HEADER += c.hh

#and there is this for loop later that uses this list:
    @for f in $(HEADER) ; do echo "HOWDY!"  ; done
##################################

I was hoping to use whatever headers are in the include directory instead of
trying to remember to modify this makefile. When I try to compile, the C
source files which include the .hh files can't find the header (.hh). Is
there a way to do this? thanks please help.


-- 
View this message in context: 
http://old.nabble.com/Help-copying---renaming-filename-inside-makefile.-tp30636319p30644365.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]