[email protected] wrote: > This not not work on GNU Make 3.81 : The problem is that you are using shell syntax specific to bash, ksh, other shells but isn't in /bin/sh. In order to use syntax that isn't portable shell syntax then you need to select a different shell. Or you need to use portable syntax available in /bin/sh only.
> all: > if [[ "mystring" =~ "string" ]]; \ > then echo "found"; \ > else echo "not found"; \ > fi > > > output : > /bin/sh: [[: not found The problem is that you are using syntax that isn't supported by /bin/sh. You have probably become used to programming in bash, ksh, or some other new shell that has that syntax. But make uses /bin/sh by default and that shell doesn't support the [[ ... ]] syntax. See this section of the manual where it discusses how your execution shell is selected. http://www.gnu.org/software/make/manual/make.html#Execution The program used as the shell is taken from the variable SHELL. If this variable is not set in your makefile, the program /bin/sh is used as the shell. I recommend using portable shell syntax in your Makefile. Alternatively you can specify your shell to be "SHELL = /bin/bash" or whatever but doing so may make it a hardship for anyone else to compile your code on their system if their system is different from yours. Bob _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
