Hello everyone,
I'm trying to make a patch for an outdated ported. Unfortunately, I need to do a string comparison in the Makefile like so:
I've tried all these variations:
All forms I've tried I've ended getting malformed condition. Has anyone used the expr command in the Makefile?
Thanks,
Tommy
I'm trying to make a patch for an outdated ported. Unfortunately, I need to do a string comparison in the Makefile like so:
Makefile:
STRING1=12
STRING2=34
.if `${EXPR} "${STRING1} < ${STRING2}"`
.endif
Code:
(${EXPR} "${STRING1} < ${STRING2}")
${EXPR} ${STRING1} < ${STRING2}
$((${EXPR} "${STRING1} < ${STRING2}"))
# This works in the shell
expr "${STRING1} < ${STRING2}"
# Would produce: 12 < 34
Thanks,
Tommy