[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Running case commands with the shell function?
From: |
Rakesh Sharma |
Subject: |
Re: Running case commands with the shell function? |
Date: |
Sat, 16 Sep 2017 14:00:59 +0000 |
There was a slight error in the previous version as it was not testing the dot
"." after the
openbsd versions 6,7,8, & 9.
TARGET := i386-$(rand)-openbsd8.$(rand)
1-9 := 1 2 3 4 5 6 7 8 9
flags := \
$(strip \
$(if $(patsubst i386-%,,$(TARGET)),,\
$(if $(strip \
$(foreach i,\
$(addprefix -openbsd,\
$(addprefix 5.,$(wordlist 5,9,$(1-9)))\
$(addsuffix .,$(wordlist 6,9,$(1-9)))),\
$(findstring $i,$(TARGET)))),-ccopt -nopie)))
$(info $(flags))
________________________________
From: Help-make <address@hidden> on behalf of Sébastien Hinderer
<address@hidden>
Sent: Thursday, September 14, 2017 4:52 AM
To: address@hidden
Subject: Running case commands with the shell function?
Dear all,
I'd like to be able to write something like this:
flags := \
$(shell \
case "$(TARGET)" in \
i386-*-openbsd5.[5-9]*|i386-*-openbsd[6-9].*) \
echo "-ccopt -nopie";; \
*);; \
esac \
)
Of course this does not work because the first closing parenthesis is
interpreted as ending the call to the shell function.
Is there a way to actually achieve this, please?
Thanks!
Sébastien.
_______________________________________________
Help-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-make
Help-make -- Users list for the GNU implementation of
make<https://lists.gnu.org/mailman/listinfo/help-make>
lists.gnu.org
This list is for users and installers of GNU make to ask for help. Please send
bug reports to address@hidden instead of posting them here. To see the
collection of ...
- Re: Running case commands with the shell function?, (continued)
Re: Running case commands with the shell function?, Sébastien Hinderer, 2017/09/14
Re: Running case commands with the shell function?, John Calcote, 2017/09/14
Re: Running case commands with the shell function?, Rakesh Sharma, 2017/09/16
Re: Running case commands with the shell function?,
Rakesh Sharma <=