How do I express the following logic in a Makefile?
if $(XORG_VERSION) > \"7.7\"
fi
Conditional Parts of Makefi
I use the sort function to compare values lexicographically. The idea is, sort the list of two values, $(XORG_VERSION) and 7.7, then take the first value - if it's 7.7 then the version is the same or greater.
ifeq "7.7" "$(word 1, $(sort 7.7 $(XORG_VERSION)))"
endif
Adjust 7.7 to 7.8 if you need the strict greater-than condition.
This approach improves portability by avoiding shell scripts and concomitant assumptions about the capabilities of the available OS shell. However, it fails if the lexicographic ordering is not equivalent to the numerical ordering, for example when comparing 7.7 and 7.11.