From 70968e7726223664e2d8458773775432cdbee5a6 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 4 Oct 2016 17:29:00 +0200 Subject: build: Simplify checking for PREFIX origin Use the $(filter ...) make function to simplify the detection of the origin of the PREFIX variable. This allows to merge two duplicate definitions for the INSTX command. Signed-off-by: Tobias Klauser --- Cmds | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Cmds b/Cmds index 159939e..d7fb40c 100644 --- a/Cmds +++ b/Cmds @@ -25,16 +25,12 @@ YAAC = $(Q)echo -e " YAAC\t$<" && bison INST = echo -e " INST\t$(1)" && install -d $(2) && \ install --mode=644 -DC $(1) $(2)/$(shell basename $(1)) -ifeq ("$(origin PREFIX)", "command line") +# Determine wheter origin of PREFIX is "file" or "command line" +ifeq ("$(origin PREFIX)", "$(filter $(origin PREFIX), file command line)") INSTX = echo -e " INST\t$(1)" && install -d $(2) && \ install -C $(1) $(2)/$(shell basename $(1)) else - ifeq ("$(origin PREFIX)", "file") - INSTX = echo -e " INST\t$(1)" && install -d $(2) && \ - install -C $(1) $(2)/$(shell basename $(1)) - else - INSTX = echo -e " INST\t$(1)" && install -C $(1) $(2)/$(shell basename $(1)) - endif + INSTX = echo -e " INST\t$(1)" && install -C $(1) $(2)/$(shell basename $(1)) endif MKDIR = echo -e " MKDIR\t$(1)" && mkdir -p $(1) -- cgit v1.2.3-54-g00ecf