I need to do something like this:
case `uname -m` in
i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;
esac
But I need to do this in makefile for a particular target. I have not found a method to make an if condition with a regular expression.
I tried this:
ifeq ($(shell uname -m), i*86)
But it does not work. Even
ifeq ($(shell uname -m), i686)
does not work.
Using Makefile built-in conditionals (as opposite of Ωmega's Bash solution)
ifeq ($(shell uname -m | egrep "i.86"),) # empty result from egrep
@echo "No match"
else
@echo "Match"
endif
See here using this approach to validate a Git tag https://gist.github.com/jesugmz/a155b4a6686c4172048fabc6836c59e1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With