summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-10-04 17:29:00 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-10-04 17:29:00 +0200
commit70968e7726223664e2d8458773775432cdbee5a6 (patch)
tree740afe7cf3598720fb0b900a45c0caa386b05544
parent5a1eba2843cb66a0cd3b8cccab41d930d7533b62 (diff)
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 <tklauser@distanz.ch>
-rw-r--r--Cmds10
1 files 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)