summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build7
-rw-r--r--scripts/Makefile.clean6
-rw-r--r--scripts/Makefile.host26
3 files changed, 24 insertions, 15 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 458bedea2e7b..707ad9d0353a 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -14,8 +14,13 @@ include $(obj)/Makefile
include scripts/Makefile.lib
-# Do not include host-progs rules unles needed
ifdef host-progs
+$(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please replace with hostprogs-y!)
+hostprogs-y += $(host-progs)
+endif
+
+# Do not include host rules unles needed
+ifneq ($(hostprogs-y)$(hostprogs-m),)
include scripts/Makefile.host
endif
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
index 1daba0623151..ab73032fc773 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -29,8 +29,10 @@ subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-))
# Add subdir path
subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
-__clean-files := $(extra-y) $(EXTRA_TARGETS) $(always) $(host-progs) \
- $(targets) $(clean-files)
+__clean-files := $(extra-y) $(EXTRA_TARGETS) $(always) \
+ $(targets) $(clean-files) \
+ $(host-progs) \
+ $(hostprogs-y) $(hostprogs-m) $(hostprogs-)
__clean-files := $(wildcard \
$(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \
$(filter /%, $(__clean-files)))
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index d21a9639deb9..04a79033fbce 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -6,21 +6,21 @@
# Both C and C++ is supported, but preferred language is C for such utilities.
#
# Samle syntax (see Documentation/kbuild/makefile.txt for reference)
-# host-progs := bin2hex
+# hostprogs-y := bin2hex
# Will compile bin2hex.c and create an executable named bin2hex
#
-# host-progs := lxdialog
+# hostprogs-y := lxdialog
# lxdialog-objs := checklist.o lxdialog.o
# Will compile lxdialog.c and checklist.c, and then link the executable
# lxdialog, based on checklist.o and lxdialog.o
#
-# host-progs := qconf
+# hostprogs-y := qconf
# qconf-cxxobjs := qconf.o
# qconf-objs := menu.o
# Will compile qconf as a C++ program, and menu as a C program.
# They are linked as C++ code to the executable qconf
-# host-progs := conf
+# hostprogs-y := conf
# conf-objs := conf.o libkconfig.so
# libkconfig-objs := expr.o type.o
# Will create a shared library named libkconfig.so that consist of
@@ -28,28 +28,30 @@
# are made as position independent code).
# conf.c is compiled as a c program, and conf.o is linked together with
# libkconfig.so as the executable conf.
-# Note: Shared libraries consisting of C++ files are not supported
+# Note: Shared libraries consisting of C++ files are not supported
-# host-progs := tools/build may have been specified. Retreive directory
-obj-dirs += $(foreach f,$(host-progs), $(if $(dir $(f)),$(dir $(f))))
+__hostprogs := $(hostprogs-y)$(hostprogs-m)
+
+# hostprogs-y := tools/build may have been specified. Retreive directory
+obj-dirs += $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f))))
obj-dirs := $(strip $(sort $(filter-out ./,$(obj-dirs))))
# C code
# Executables compiled from a single .c file
-host-csingle := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m)))
+host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
# C executables linked based on several .o files
-host-cmulti := $(foreach m,$(host-progs),\
+host-cmulti := $(foreach m,$(__hostprogs),\
$(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m))))
# Object (.o) files compiled from .c files
-host-cobjs := $(sort $(foreach m,$(host-progs),$($(m)-objs)))
+host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs)))
# C++ code
# C++ executables compiled from at least on .cc file
# and zero or more .c files
-host-cxxmulti := $(foreach m,$(host-progs),$(if $($(m)-cxxobjs),$(m)))
+host-cxxmulti := $(foreach m,$(__hostprogs),$(if $($(m)-cxxobjs),$(m)))
# C++ Object (.o) files compiled from .cc files
host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs)))
@@ -63,7 +65,7 @@ host-cobjs := $(filter-out %.so,$(host-cobjs))
#Object (.o) files used by the shared libaries
host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
-host-progs := $(addprefix $(obj)/,$(host-progs))
+__hostprogs := $(addprefix $(obj)/,$(__hostprogs))
host-csingle := $(addprefix $(obj)/,$(host-csingle))
host-cmulti := $(addprefix $(obj)/,$(host-cmulti))
host-cobjs := $(addprefix $(obj)/,$(host-cobjs))