define other-rule .PHONY: other-rule other-rule: @ echo other-rule endef define other-rule2 .PHONY: other-rule2 other-rule: @ echo other-rule2 endef define rule_test .PHONY: rule-test rule-test: other-rule ifeq ($$(strip $$(VAR)),) $$(eval $$(call other-rule)) else $$(eval $$(call other-rule2)) endif endef $(eval $(rule_test))