summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-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))