[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Search string pattern in make
From: |
micron_make |
Subject: |
Re: Search string pattern in make |
Date: |
Sun, 15 Jul 2007 21:52:01 -0700 (PDT) |
Hi,
thanks for the reply. I will try it. I couldn't test the solution as I did
not have access to my PC
cheers!!
John Graham-Cumming-2 wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> micron_make wrote:
>> I have the following directory structure
>>
>> C:\My_Modules\Module_Test1\source\src (*.c)
>> \mak (make file)
>>
>> I shall have similar directory structure with Module_Test2, Module_Test3
>> etc.
>>
>> In my make file I use $(abspath) to get the directory path of a
>> particular
>> type of file, whose relative path is known.
>> files_path=$(abspath $(wildcard ../src/*.c))
>>
>>>From the files_path variable I would like to filter out the pattern
>> “/Module_ /”. (i.e the string beginning with a backslash, followed by the
>> string “Module_” followed by any number of characters until the next
>> backslash)
>> I need this because I would like to automatically fill some definitions
>> in
>> the make file.
>
> GNU Make does not have a function for doing this sort of regexp-based
> modifications, so you are left with using patsubst to get what you want.
>
> You could do:
>
> files_path := $(patsubst /Module_%,%,$(files_path))
>
> that will eliminate the /Module_ part, and then you'd be forced to do:
>
> files_path := $(patsubst Test1/%,%,$(files_path))
>
> to remove the Test1/ part, and so on.
>
> John.
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGk55QLphrp73n/hARAjIrAKCWkTCW0OFDF3gKOkwUAjDZdd0vyACcCg/1
> ezZz4+lm5JDtGZtmMhWlQUc=
> =ragA
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
>
>
--
View this message in context:
http://www.nabble.com/Search-string-pattern-in-make-tf4054079.html#a11609167
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.