summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-03-24 01:20:33 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-03-24 01:20:33 +0100
commitdf5c5e8a1455d1fff1455ec094e9a1cbc1dc6686 (patch)
tree6d20ef576e55059091a9cb73593bebb64a5db128 /mk
parent9ae69cf6a69d57831713f456bd49e759c2726eda (diff)
downloadembtoolkit-df5c5e8a1455d1fff1455ec094e9a1cbc1dc6686.tar.gz
embtoolkit-df5c5e8a1455d1fff1455ec094e9a1cbc1dc6686.tar.bz2
embtoolkit-df5c5e8a1455d1fff1455ec094e9a1cbc1dc6686.tar.xz
Build system: rework __embtk_pkg_installed-y and where it is used
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/buildsystem.mk5
-rw-r--r--mk/eglibc.mk2
-rw-r--r--mk/macros.packages.mk9
-rw-r--r--mk/toolchain.mk78
4 files changed, 58 insertions, 36 deletions
diff --git a/mk/buildsystem.mk b/mk/buildsystem.mk
index b58cd27..85c2e3f 100644
--- a/mk/buildsystem.mk
+++ b/mk/buildsystem.mk
@@ -152,6 +152,11 @@ define __embtk_mk_inittoolsdirs
mkdir -p $(embtk_toolsb)
endef
+define __embtk_mk_initpkgdirs
+ mkdir -p $(EMBTK_ROOT)/build
+ mkdir -p $(embtk_pkgb)
+endef
+
define __embtk_mk_inithosttoolsdirs
mkdir -p $(embtk_htools)
mkdir -p $(embtk_htools)/usr
diff --git a/mk/eglibc.mk b/mk/eglibc.mk
index 6e5c197..fab3087 100644
--- a/mk/eglibc.mk
+++ b/mk/eglibc.mk
@@ -103,6 +103,7 @@ define __embtk_install_eglibc_headers
cp $(EGLIBC_HEADERS_BUILD_DIR)/csu/crtn.o $(embtk_sysroot)/usr/$(LIBDIR)/
$(__embtk_install_eglibc_dummy)
touch $(call __embtk_pkg_dotinstalled_f,eglibc_headers)
+ $(call __embtk_pkg_gen_dotkconfig_f,eglibc_headers)
endef
define embtk_install_eglibc_headers
@@ -140,6 +141,7 @@ define __embtk_install_eglibc
PATH=$(PATH):$(embtk_tools)/bin/ $(MAKE) -C $(EGLIBC_BUILD_DIR) \
install_root=$(embtk_sysroot) install
touch $(call __embtk_pkg_dotinstalled_f,eglibc)
+ $(call __embtk_pkg_gen_dotkconfig_f,eglibc)
endef
define embtk_install_eglibc
diff --git a/mk/macros.packages.mk b/mk/macros.packages.mk
index fbbb5e9..062ca25 100644
--- a/mk/macros.packages.mk
+++ b/mk/macros.packages.mk
@@ -265,9 +265,6 @@ __embtk_pkg_installed-y = $(shell \
if [ "x$$?" = "x0" ]; then \
echo y; \
fi; \
- else \
- mkdir -p $(__embtk_pkg_builddir); \
- $(call __embtk_pkg_gen_dotkconfig_f,$(1)); \
fi;)
#
@@ -420,6 +417,7 @@ define __embtk_install_pkg_make
$(call embtk_pinfo,"Compile/Install $(__embtk_pkg_name)-$(__embtk_pkg_version) in your root filesystem...")
$(call embtk_download_pkg,$(1))
$(call embtk_decompress_pkg,$(1))
+ mkdir -p $(__embtk_pkg_builddir)
$(if $(embtk_beforeinstall_$(pkgv)),$(embtk_beforeinstall_$(pkgv)))
$(if $(__embtk_autotoolspkg-y),$(call embtk_configure_pkg,$(1)))
$(if $(__embtk_pkg_makedirs), \
@@ -432,12 +430,14 @@ define __embtk_install_pkg_make
$(call __embtk_fix_libtool_files)
$(call __embtk_fix_pkgconfig_files))
touch $(__embtk_pkg_dotinstalled_f)
+ $(call __embtk_pkg_gen_dotkconfig_f,$(1))
endef
define __embtk_install_hostpkg_make
$(Q)$(if $(__embtk_pkg_deps),$(MAKE) $(__embtk_pkg_deps))
$(call embtk_pinfo,"Compile/Install $(__embtk_pkg_name)-$(__embtk_pkg_version) for host...")
$(call embtk_download_pkg,$(1))
$(call embtk_decompress_pkg,$(1))
+ mkdir -p $(__embtk_pkg_builddir)
$(if $(embtk_beforeinstall_$(pkgv)),$(embtk_beforeinstall_$(pkgv)))
$(if $(__embtk_autotoolspkg-y),$(call embtk_configure_hostpkg,$(1)))
$(if $(__embtk_pkg_makedirs), \
@@ -446,7 +446,8 @@ define __embtk_install_hostpkg_make
$(if $(__embtk_pkg_makedirs), \
$(__embtk_multi_make_hostinstall), \
$(__embtk_single_make_hostinstall))
- $(Q)touch $(__embtk_pkg_dotinstalled_f)
+ touch $(__embtk_pkg_dotinstalled_f)
+ $(call __embtk_pkg_gen_dotkconfig_f,$(1))
endef
#
diff --git a/mk/toolchain.mk b/mk/toolchain.mk
index 7ea02b3..dff3275 100644
--- a/mk/toolchain.mk
+++ b/mk/toolchain.mk
@@ -185,9 +185,13 @@ TOOLCHAIN_ADDONS_SRC_DIR := $(TOOLCHAIN_BUILD_DIR)/.addons
-include mk/$(embtk_clib).mk
define __embtk_toolchain_mkinitdirs
+ mkdir -p $(embtk_generated)
+ mkdir -p $(TOOLCHAIN_DIR)
+ mkdir -p $(TOOLCHAIN_ADDONS_BUILD_DIR)
$(__embtk_mk_initsysrootdirs)
$(__embtk_mk_inittoolsdirs)
$(__embtk_mk_inithosttoolsdirs)
+ $(__embtk_mk_initpkgdirs)
endef
define __embtk_toolchain_symlinktools
@@ -217,7 +221,7 @@ endef
define __embtk_toolchain_decompress
$(if $(call __embtk_mk_pathnotexist,$(call __embtk_pkg_dotdecompressed_f,toolchain)),
- $(call embtk_pinfo,"Decompressing $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain - please wait...")
+ $(call embtk_pinfo,"Decompressing cached $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain - please wait...")
$(___embtk_toolchain_decompress)
touch $(call __embtk_pkg_dotdecompressed_f,toolchain))
endef
@@ -229,39 +233,49 @@ __embtk_toolchain_addons-n = $(patsubst %_install,%,$(TOOLCHAIN_ADDONS-))
__embtk_toolchain_built_msg = $(call embtk_pinfo,"New $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain successfully built!")
__embtk_toolchain_building_msg = $(call embtk_pinfo,"Building new $(GNU_TARGET)/$(EMBTK_MCU_FLAG) CORE toolchain - please wait...")
__embtk_toolsaddons_build_msg = $(call embtk_pinfo,"Building new $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain ADDONS - please wait...")
-define __embtk_toolchain_build
+
+define __embtk_toolchain_build_core
+ $(__embtk_toolchain_building_msg)
+ rm -rf $(call __embtk_pkg_dotinstalled_f,toolchain)
+ rm -rf $(call __embtk_pkg_dotdecompressed_f,toolchain)
+ $(foreach dep,$(__embtk_toolchain_deps-y),
+ $(call embtk_cleanup_pkg,$(dep)))
+ $(foreach pkg,$(__embtk_rootfs_pkgs-y),
+ $(call embtk_cleanup_pkg,$(pkg)))
+ rm -rf $(embtk_sysroot) $(embtk_tools)
+ $(__embtk_toolchain_mkinitdirs)
+ $(foreach pdep,$(__embtk_toolchain_predeps-y),
+ $(call embtk_install_xpkg,$(pdep)))
+ $(foreach dep,$(__embtk_toolchain_deps-y),
+ $(call embtk_install_xpkg,$(dep)))
+ touch $(call __embtk_pkg_dotinstalled_f,toolchain)
+ $(call __embtk_pkg_gen_dotkconfig_f,toolchain)
+endef
+
+define __embtk_toolchain_build_addons
+ $(__embtk_toolsaddons_build_msg)
+ rm -rf $(call __embtk_pkg_dotinstalled_f,toolchain_addons)
+ rm -rf $(call __embtk_pkg_dotdecompressed_f,toolchain_addons)
+ $(__embtk_toolchain_mkinitdirs)
+ $(if $(findstring core,$(1)),,$(___embtk_toolchain_decompress))
$(if $(findstring core,$(1)),
- $(__embtk_toolchain_building_msg)
- rm -rf $(call __embtk_pkg_dotinstalled_f,toolchain)
- rm -rf $(call __embtk_pkg_dotdecompressed_f,toolchain)
- $(foreach dep,$(__embtk_toolchain_deps-y),
- $(call embtk_cleanup_pkg,$(dep)))
- $(foreach pkg,$(__embtk_rootfs_pkgs-y),
- $(call embtk_cleanup_pkg,$(pkg)))
- rm -rf $(embtk_sysroot) $(embtk_tools)
- $(__embtk_toolchain_mkinitdirs)
+ $(foreach addon,$(__embtk_toolchain_addons-y),
+ $(call embtk_cleanup_pkg,$(addon))))
+ $(if $(TOOLCHAIN_ADDONS-),
+ $(foreach addon,$(__embtk_toolchain_addons-n),
+ $(call embtk_cleanup_pkg,$(addon))))
+ $(if $(TOOLCHAIN_ADDONS-y),
$(foreach pdep,$(__embtk_toolchain_predeps-y),
- $(call embtk_install_xpkg,$(pdep)))
- $(foreach dep,$(__embtk_toolchain_deps-y),
- $(call embtk_install_xpkg,$(dep)))
- touch $(call __embtk_pkg_dotinstalled_f,toolchain))
- $(if $(findstring addons,$(1)),
- $(__embtk_toolsaddons_build_msg)
- rm -rf $(call __embtk_pkg_dotinstalled_f,toolchain_addons)
- rm -rf $(call __embtk_pkg_dotdecompressed_f,toolchain_addons)
- $(if $(findstring core,$(1)),,$(___embtk_toolchain_decompress))
- $(if $(findstring core,$(1)),
- $(foreach addon,$(__embtk_toolchain_addons-y),
- $(call embtk_cleanup_pkg,$(addon))))
- $(if $(TOOLCHAIN_ADDONS-),
- $(foreach addon,$(__embtk_toolchain_addons-n),
- $(call embtk_cleanup_pkg,$(addon))))
- $(if $(TOOLCHAIN_ADDONS-y),
- $(foreach pdep,$(__embtk_toolchain_predeps-y),
- $(call embtk_install_xpkg,$(pdep)))
- $(foreach addon,$(__embtk_toolchain_addons-y),
- $(call embtk_install_xpkg,$(addon))))
- touch $(call __embtk_pkg_dotinstalled_f,toolchain_addons))
+ $(call embtk_install_xpkg,$(pdep)))
+ $(foreach addon,$(__embtk_toolchain_addons-y),
+ $(call embtk_install_xpkg,$(addon))))
+ touch $(call __embtk_pkg_dotinstalled_f,toolchain_addons)
+ $(call __embtk_pkg_gen_dotkconfig_f,toolchain_addons)
+endef
+
+define __embtk_toolchain_build
+ $(if $(findstring core,$(1)),$(__embtk_toolchain_build_core))
+ $(if $(findstring addons,$(1)),$(__embtk_toolchain_build_addons))
$(if $(findstring core,$(1))$(findstring addons,$(1)),
$(__embtk_toolchain_symlinktools)
$(__embtk_toolchain_compress)