help-make
[Top][All Lists]
Advanced

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

Re: How to transfrom a.c dir1/b.c to -I. -I./dir1


From: Philip Guenther
Subject: Re: How to transfrom a.c dir1/b.c to -I. -I./dir1
Date: Fri, 1 Aug 2008 01:34:22 -0600

On Thu, Jul 31, 2008 at 8:18 PM, PRC <address@hidden> wrote:
> There is a variable in my Makefile script, whose value is:
> src = a.c dir1/b.c c.c dir2/d.c
> I wonder how to transform its value to
> -I. -I./dir1 -I. -I./dir2
> in the Makefile script only using Make built-in functions,
> without invoking shell utilities

Yes, this can be easily done using functions documented in the GNU
make info pages, in sections: "8.3 Functions for File Names" and "8.2
Functions for String Substitution and Analysis".  Did you read those
sections?  What have you tried?


> (I think shell functions are slower than built-in functions. Am I right? ).

Probably, but performance is only one factor to consider when writing
a makefile.  In particular, if you don't understand how the makefile
works, then the cost in "maintainability" may be greater than the
benefit of better performance.


Philip Guenther




reply via email to

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