How do I express the following logic in a Makefile?
if $(XORG_VERSION) > \"7.7\"
fi
Conditional Parts of Makefi
Using shell commands, as mentioned in the other answers, should suffice for most use cases:
if [ 1 -gt 0 ]; then \
#do something \
fi
However, if you, like me, want to use greater-than comparison in order to then set a make variable via make's $(eval) command, then you will find that attempting to do so using the other answer's model:
if [ 1 -gt 0 ]; then \
$(eval FOO := value) \
fi
raises an error:
if [ 1 -gt 0 ]; then fi;
/bin/bash: -c: line 0: syntax error near unexpected token `fi'
/bin/bash: -c: line 0: `if [ 1 -gt 0 ]; then fi;'
make: *** [clean] Error 2```
I found a way how to sort out that problem and posted it as a solution to this other question. I hope someone finds it helpful!