Skip to content

Instantly share code, notes, and snippets.

@Hexa
Created November 19, 2017 11:59
Show Gist options
  • Save Hexa/3da39e8d72b536b9eb272c7603fac57f to your computer and use it in GitHub Desktop.
Save Hexa/3da39e8d72b536b9eb272c7603fac57f to your computer and use it in GitHub Desktop.
ifeq
.PHONY: all
b:
$(eval N := $(shell echo "100"))
p: b
ifeq ($(CMD),a)
$(eval B := $(shell expr $N + 10 ))
else
$(eval B := $(shell expr $N + 20 ))
endif
all: p
@echo $(B)
# $ make all CMD=a
# 110
# $ make all CMD=b
# 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment