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 <help-make-bounces+sharma__r=hotmail....@gnu.org> on behalf of Sébastien Hinderer <sebastien.hinde...@inria.fr> Sent: Thursday, September 14, 2017 4:52 AM To: help-make@gnu.org 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 Help-make@gnu.org 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 bug-m...@gnu.org instead of posting them here. To see the collection of ... _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make