Created
April 16, 2014 07:30
-
-
Save wilem/10824334 to your computer and use it in GitHub Desktop.
do math(arithmetic operation) in makefile.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# calculator by call (bash)shell command. | |
calc=$(shell echo $$\(\($(1)\)\)) | |
foo=$(call calc,3*4) | |
SZ_1K:=$(call calc,32*32) | |
SZ_4K:=$(call calc,$(SZ_1K)*4) | |
SZ_4M:=$(call calc,$(SZ_4K)*$(SZ_1K)) | |
SZ_4G:=$(call calc,$(SZ_4M)*$(SZ_1K)) | |
SZ_8G=$(shell echo $(exp_8g)) | |
SZ_4T=$(shell echo $(exp_4t)) | |
math: | |
@echo foo is $(foo) | |
@echo "SZ_1K is:" $(SZ_1K) | |
@echo "SZ_4K is:" $(SZ_4K) | |
@echo "SZ_4M is:" $(SZ_4M) | |
@echo "SZ_4G is:" $(SZ_4G) | |
@echo "SZ_8G is:" $(SZ_8G) | |
@echo "SZ_4T is:" $(SZ_4T) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment