summaryrefslogtreecommitdiff
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2004-08-11 00:09:55 +0200
committerSam Ravnborg <sam@mars.ravnborg.org>2004-08-11 00:09:55 +0200
commit9c1bfb5fc7a096f137476b2a6787d7e00b02d777 (patch)
tree1903d2fcd8957f0a0daa4e843afdd1aab5d73157 /scripts/Makefile.build
parent94869f86021d8d3e785e2222d151fb4b98d2ae2a (diff)
kbuild: Separate out host-progs handling
Concentrating all host-progs functionality in one file made a more readable Makefile.lib - and allow for potential reuse of host-progs functionality. Processing of host-progs related stuff are avoided when no host-progs are specified. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build89
1 files changed, 5 insertions, 84 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 008ac6cfd405..458bedea2e7b 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -14,6 +14,11 @@ include $(obj)/Makefile
include scripts/Makefile.lib
+# Do not include host-progs rules unles needed
+ifdef host-progs
+include scripts/Makefile.host
+endif
+
ifneq ($(KBUILD_SRC),)
# Create output directory if not already present
_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
@@ -275,90 +280,6 @@ $(multi-used-m) : %.o: $(multi-objs-m) FORCE
targets += $(multi-used-y) $(multi-used-m)
-# Compile programs on the host
-# ===========================================================================
-# host-progs := bin2hex
-# Will compile bin2hex.c and create an executable named bin2hex
-#
-# host-progs := 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
-# 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
-# conf-objs := conf.o libkconfig.so
-# libkconfig-objs := expr.o type.o
-# Will create a shared library named libkconfig.so that consist of
-# expr.o and type.o (they are both compiled as C code and the object file
-# 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
-#
-
-# Create executable from a single .c file
-# host-csingle -> Executable
-quiet_cmd_host-csingle = HOSTCC $@
- cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOST_LOADLIBES) -o $@ $<
-$(host-csingle): %: %.c FORCE
- $(call if_changed_dep,host-csingle)
-
-# Link an executable based on list of .o files, all plain c
-# host-cmulti -> executable
-quiet_cmd_host-cmulti = HOSTLD $@
- cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
- $(addprefix $(obj)/,$($(@F)-objs)) \
- $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
- $(call if_changed,host-cmulti)
-
-# Create .o file from a single .c file
-# host-cobjs -> .o
-quiet_cmd_host-cobjs = HOSTCC $@
- cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $<
-$(host-cobjs): %.o: %.c FORCE
- $(call if_changed_dep,host-cobjs)
-
-# Link an executable based on list of .o files, a mixture of .c and .cc
-# host-cxxmulti -> executable
-quiet_cmd_host-cxxmulti = HOSTLD $@
- cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \
- $(foreach o,objs cxxobjs,\
- $(addprefix $(obj)/,$($(@F)-$(o)))) \
- $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
- $(call if_changed,host-cxxmulti)
-
-# Create .o file from a single .cc (C++) file
-quiet_cmd_host-cxxobjs = HOSTCXX $@
- cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $<
-$(host-cxxobjs): %.o: %.cc FORCE
- $(call if_changed_dep,host-cxxobjs)
-
-# Compile .c file, create position independent .o file
-# host-cshobjs -> .o
-quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
- cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
-$(host-cshobjs): %.o: %.c FORCE
- $(call if_changed_dep,host-cshobjs)
-
-# Link a shared library, based on position independent .o files
-# *.o -> .so shared library (host-cshlib)
-quiet_cmd_host-cshlib = HOSTLLD -shared $@
- cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \
- $(addprefix $(obj)/,$($(@F:.so=-objs))) \
- $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cshlib): %: $(host-cshobjs) FORCE
- $(call if_changed,host-cshlib)
-
-targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
- $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs)
# Descending
# ---------------------------------------------------------------------------