-----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
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to