Skip to content

Instantly share code, notes, and snippets.

@alpha22jp
Created October 20, 2016 01:38
Show Gist options
  • Save alpha22jp/5c8559b3aca395debe3d56d902a5b495 to your computer and use it in GitHub Desktop.
Save alpha22jp/5c8559b3aca395debe3d56d902a5b495 to your computer and use it in GitHub Desktop.
MakefileでAND/OR条件判定
COND_A = NO
COND_B = YES
all:
# AND condition
ifeq ($(COND_A) $(COND_B), YES YES)
@echo "A and B is true"
else
@echo "A and B is false"
endif
# OR condition
ifeq ($(findstring YES, $(COND_A) $(COND_B)), YES)
@echo "A or B is true"
else
@echo "A or B is false"
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment