summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2012-01-15 19:33:37 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2012-01-15 19:33:37 +0100
commit4f8cb295daf718a9d7bb3da37867e939a63ac454 (patch)
tree311adad33392c026a82129d0e0b1cffa88a645b4 /mk
parentdec7ba98333dcf69a97ea8a22583171fbe035e00 (diff)
downloadembtoolkit-4f8cb295daf718a9d7bb3da37867e939a63ac454.tar.gz
embtoolkit-4f8cb295daf718a9d7bb3da37867e939a63ac454.tar.bz2
embtoolkit-4f8cb295daf718a9d7bb3da37867e939a63ac454.tar.xz
Toolchain: consider strace as toolchain addon
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/buildsystem.mk2
-rw-r--r--mk/packages.mk4
-rw-r--r--mk/toolchain.mk68
3 files changed, 52 insertions, 22 deletions
diff --git a/mk/buildsystem.mk b/mk/buildsystem.mk
index 0898ae3..772faef 100644
--- a/mk/buildsystem.mk
+++ b/mk/buildsystem.mk
@@ -97,7 +97,7 @@ define __embtk_mk_startbuild
$(call embtk_echo_blue,"\tGCC : gcc-$(call embtk_get_pkgversion,gcc)")
$(if $(CONFIG_EMBTK_HAVE_GDB_SYSTEM),
$(call embtk_echo_blue,"\tGDB : gdb-$(call embtk_get_pkgversion,gdb)"))
- $(if $(CONFIG_EMBTK_ROOTFS_HAVE_STRACE),
+ $(if $(CONFIG_EMBTK_HAVE_STRACE),
$(call embtk_echo_blue,"\tStrace : strace-$(call embtk_get_pkgversion,strace)"))
$(call embtk_echo_blue," ~~~~~~~~~~~~ ")
$(call embtk_echo_blue,"| Host tools |")
diff --git a/mk/packages.mk b/mk/packages.mk
index 7e9be1b..2e27261 100644
--- a/mk/packages.mk
+++ b/mk/packages.mk
@@ -41,10 +41,6 @@ HOSTTOOLS_COMPONENTS-$(CONFIG_EMBTK_HOST_HAVE_ZLIB) += zlib_host_install
# Packages for TARGET and HOST
#
-# strace
-ROOTFS_COMPONENTS-$(CONFIG_EMBTK_ROOTFS_HAVE_STRACE) += strace_install
-include $(EMBTK_ROOT)/mk/strace.mk
-
# Flash manipulation tools: mtd-utils
ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_MTDUTILS) += mtdutils_install
diff --git a/mk/toolchain.mk b/mk/toolchain.mk
index 88203e6..11e8ca8 100644
--- a/mk/toolchain.mk
+++ b/mk/toolchain.mk
@@ -74,6 +74,10 @@ include $(EMBTK_ROOT)/mk/gcc.mk
#linux kernel headers
include $(EMBTK_ROOT)/mk/linux.mk
+# strace toolchain addon
+include $(EMBTK_ROOT)/mk/strace.mk
+TOOLCHAIN_ADDONS-$(CONFIG_EMBTK_HAVE_STRACE) += strace_install
+
#Autotools
include $(EMBTK_ROOT)/mk/libtool.mk
include $(EMBTK_ROOT)/mk/autoconf.mk
@@ -92,7 +96,7 @@ TOOLCHAIN_DIR := $(EMBTK_GENERATED)/toolchain-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)
TOOLCHAIN_BUILD_DIR := $(TOOLCHAIN_DIR)
TOOLCHAIN_CLIB := $(if $(CONFIG_EMBTK_CLIB_EGLIBC),eglibc,uclibc)
-TOOLCHAIN_PRE_DEPS := mkinitialpath ccache_install $(AUTOTOOLS_INSTALL)
+TOOLCHAIN_PRE_DEPS := ccache_install $(AUTOTOOLS_INSTALL)
TOOLCHAIN_PRE_DEPS += $(EMBTK_CMAKE_INSTALL)
TOOLCHAIN_DEPS := linux_headers_install gmp_host_install
@@ -100,6 +104,10 @@ TOOLCHAIN_DEPS += mpfr_host_install mpc_host_install binutils_install
TOOLCHAIN_DEPS += gcc1_install $(TOOLCHAIN_CLIB)_headers_install
TOOLCHAIN_DEPS += gcc2_install $(TOOLCHAIN_CLIB)_install gcc3_install
+TOOLCHAIN_ADDONS_NAME := toolchain-addons
+TOOLCHAIN_ADDONS_DEPS := $(TOOLCHAIN_ADDONS-y)
+TOOLCHAIN_ADDONS_BUILD_DIR := $(TOOLCHAIN_BUILD_DIR)/.addons
+
include $(EMBTK_ROOT)/mk/$(TOOLCHAIN_CLIB).mk
define __embtk_toolchain_symlinktools
@@ -117,10 +125,9 @@ define __embtk_toolchain_compress
mv $(TOOLCHAIN_PACKAGE) $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PACKAGE)
endef
-define __embtk_toolchain_decompress
- $(call embtk_pinfo,"Decompressing $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain - please wait...")
+define ___embtk_toolchain_decompress
cd $(EMBTK_ROOT) && tar xjf $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PACKAGE)
- $(MAKE) $(TOOLCHAIN_PRE_DEPS)
+ $(MAKE) mkinitialpath $(TOOLCHAIN_PRE_DEPS)
mkdir -p $(GCC3_BUILD_DIR)
touch $(GCC3_BUILD_DIR)/.installed
touch $(GCC3_BUILD_DIR)/.gcc3_post_install
@@ -128,23 +135,50 @@ define __embtk_toolchain_decompress
$(call __embtk_pkg_dotpkgkconfig_f,gcc3)
endef
+define __embtk_toolchain_decompress
+ $(call embtk_pinfo,"Decompressing $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain - please wait...")
+ $(___embtk_toolchain_decompress)
+endef
+
define __embtk_toolchain_build
- $(call embtk_pinfo,"Building new $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain - please wait...")
- $(foreach dep,$(patsubst %_install,%,$(TOOLCHAIN_DEPS)), \
+ $(if $(findstring core,$(1)),
+ $(call embtk_pinfo,"Building new $(GNU_TARGET)/$(EMBTK_MCU_FLAG) CORE toolchain - please wait...")
+ $(foreach dep,$(patsubst %_install,%,$(TOOLCHAIN_DEPS)),
rm -rf $(call __embtk_pkg_builddir,$(dep));)
- $(foreach pkg,$(__embtk_rootfs_packages),$(MAKE) $(pkg)_clean;)
- rm -rf $(SYSROOT)
- $(__embtk_mk_initsysrootdirs)
- $(MAKE) $(TOOLCHAIN_PRE_DEPS) $(TOOLCHAIN_DEPS)
- $(__embtk_toolchain_symlinktools)
- $(__embtk_toolchain_compress)
- touch $(TOOLCHAIN_DIR)/.installed
- $(call embtk_pinfo,"New $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain successfully built!")
+ $(foreach pkg,$(__embtk_rootfs_packages),$(MAKE) $(pkg)_clean;)
+ rm -rf $(SYSROOT)
+ $(__embtk_mk_initsysrootdirs)
+ $(MAKE) mkinitialpath $(TOOLCHAIN_PRE_DEPS) $(TOOLCHAIN_DEPS)
+ touch $(TOOLCHAIN_DIR)/.installed)
+ $(if $(findstring addons,$(1)),
+ $(call embtk_pinfo,"Building new $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain ADDONS - please wait...")
+ $(if $(findstring core,$(1)),,$(___embtk_toolchain_decompress))
+ $(if $(findstring core,$(1)),
+ $(foreach addon,
+ $(patsubst %_install,%,$(TOOLCHAIN_ADDONS-y)),
+ $(MAKE) $(addon)_clean;))
+ $(foreach addon,$(patsubst %_install,%,$(TOOLCHAIN_ADDONS-)),
+ $(MAKE) $(addon)_clean;)
+ $(if $(TOOLCHAIN_ADDONS-y),
+ $(MAKE) $(TOOLCHAIN_PRE_DEPS) $(TOOLCHAIN_ADDONS-y))
+ touch $(TOOLCHAIN_ADDONS_BUILD_DIR)/.installed)
+ $(if $(findstring core,$(1))$(findstring addons,$(1)),
+ $(__embtk_toolchain_symlinktools)
+ $(__embtk_toolchain_compress)
+ $(call embtk_pinfo,"New $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain successfully built!"),
+ $(__embtk_toolchain_decompress))
endef
+__embtk_toolchain_core_inst = $(strip $(if $(call __embtk_pkg_installed-y,toolchain),,core))
+__embtk_toolchain_addons_inst = $(strip $(if $(call __embtk_pkg_installed-y,toolchain_addons),,addons))
+__embtk_toolchain_buildargs = $(__embtk_toolchain_core_inst)
+__embtk_toolchain_buildargs += $(__embtk_toolchain_addons_inst)
+
buildtoolchain:
- $(Q)$(if $(call __embtk_pkg_installed-y,toolchain), \
- $(__embtk_toolchain_decompress),$(__embtk_toolchain_build))
+ $(Q)$(call __embtk_toolchain_build,$(__embtk_toolchain_buildargs))
# Download target for offline build
-packages_fetch:: $(patsubst %_install,download_%,$(TOOLCHAINBUILD))
+TOOLCHAIN_ALL_DEPS := $(TOOLCHAIN_PRE_DEPS) $(TOOLCHAIN_DEPS)
+TOOLCHAIN_ALL_DEPS += $(TOOLCHAIN_ADDONS_DEPS)
+
+packages_fetch:: $(patsubst %_install,download_%,$(TOOLCHAIN_ALL_DEPS))