I need to do some simple math in a Makefile but can't find out how to do it. In a shell script I would do it like this:
A=1
B=2
C=$[$A+$B]
But how can I do this in a Makefile? Let's use this as a base:
A=1
B=2
C=$(A)+$(B)
all:
@echo 'A is $(A)'
@echo 'B is $(B)'
@echo 'C is $(C)'
Naturally this outputs C is 1+2
. How can I rewrite the definition of the variable C
so the Makefile outputs C is 3
?