How do I perform arithmetic in a makefile?

后端 未结 8 1011
终归单人心
终归单人心 2020-12-01 10:12

Is it possible to perform some operations on variables in a makefile? For instance, defining

JPI=4
JPJ=2

Is it possible to define in the sa

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 10:47

    The GNU Make Standard Library provides integer arithmetic functions.

    include gmsl
    
    JPI = 4
    JPJ = 2
    
    JPIJ = $(call plus,$(JPI),$(JPJ))
    

提交回复
热议问题