Greater than string comparison in a Makefile

前端 未结 3 1218
甜味超标
甜味超标 2021-01-02 02:00

How do I express the following logic in a Makefile?

if $(XORG_VERSION) > \"7.7\"
   
fi

Conditional Parts of Makefi

3条回答
  •  孤独总比滥情好
    2021-01-02 02:40

    You're not restricted to using the make conditional statements - each command is a shell command which may be as complex as you need (including a shell conditional statement):

    Consider the following makefile:

    dummy:
        if [ ${xyz} -gt 8 ] ; then \
            echo urk!! ${xyz} ;\
        fi
    

    When you use xyz=7 make --silent, there is no output. When you use xyz=9 make --silent, it outputs urk!! 9 as expected.

提交回复
热议问题