summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-11-24 11:52:06 (EST)
committer P. J. McDermott <pj@pehjota.net>2014-11-24 11:52:06 (EST)
commita3a6c44e6d763ab8b2f49f8f97013f8d5e5e2424 (patch)
tree0e868492eded8caa3ca2110f9dba263bc4079720
parentd7414686e224ce9e9c2ece3d5eccaeb5e26735ea (diff)
Makefile: Simplify hostprogs-y assignment
`make kconfig/mconf` works now as well.
-rw-r--r--Makefile19
1 files changed, 4 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index fe82a2b..aa8f013 100644
--- a/Makefile
+++ b/Makefile
@@ -11,21 +11,10 @@ include $(src)/Makefile
$(obj)/.depend: $(wildcard *.h *.c)
$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) -MM *.c > $@ 2>/dev/null || :
-ifeq ($(MAKECMDGOALS),xconfig)
-hostprogs-y := qconf
-endif
-ifeq ($(MAKECMDGOALS),gconfig)
-hostprogs-y := gconf
-endif
-ifeq ($(MAKECMDGOALS),menuconfig)
-hostprogs-y := mconf
-endif
-ifeq ($(MAKECMDGOALS),config)
-hostprogs-y := conf
-endif
-ifeq ($(MAKECMDGOALS),nconfig)
-hostprogs-y := nconf
-endif
+hostprogs-y := $(shell printf '%s' '$(MAKECMDGOALS)' | sed \
+ -e 's|$(obj)/||;' \
+ -e 's/xconfig/qconf/; s/gconfig/gconf/;' \
+ -e 's/menuconfig/mconf/; s/config/conf/; s/nconfig/nconf/;')
__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))