On Thu, Jul 31, 2008 at 8:18 PM, PRC <[EMAIL PROTECTED]> 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 _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
