From 960860c98a0db98781da3e912f2c8e3e3c3354ae Mon Sep 17 00:00:00 2001 From: Abdoulaye Walsimou Gaye Date: Thu, 5 Jan 2012 22:34:25 +0100 Subject: Build system: move some targets in mk/buildsystem.mk Signed-off-by: Abdoulaye Walsimou Gaye --- Makefile | 72 ++--------------------------------------- mk/buildsystem.mk | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++- mk/macros.mk | 32 +----------------- mk/macros.packages.mk | 2 +- 4 files changed, 93 insertions(+), 102 deletions(-) diff --git a/Makefile b/Makefile index 1e13c2c..69e0a2a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ################################################################################ # EmbToolkit -# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. +# Copyright(C) 2009-2012 Abdoulaye Walsimou GAYE. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -78,80 +78,14 @@ export Q -include .config -J := -j$(CONFIG_EMBTK_NUMBER_BUILD_JOBS) - -ifeq ($(CONFIG_EMBTK_DOWNLOAD_DIR),) -DOWNLOAD_DIR := $(EMBTK_ROOT)/dl -endif - -ifeq ($(CONFIG_EMBTK_DOTCONFIG),) -EMBTK_BUILD := xconfig -else -EMBTK_BUILD := startbuild -endif +EMBTK_BUILD := $(if $(CONFIG_EMBTK_DOTCONFIG),startbuild,xconfig) All: $(EMBTK_BUILD) -xconfig: basic -ifeq ($(CONFIG_EMBTK_DOTCONFIG),y) - $(Q)make -f scripts/Makefile.build obj=scripts/kconfig \ - EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ - EMBTK_VERSION=$(EMBTK_VERSION) xconfig -else - $(Q)if [ -e $(EMBTK_DOTCONFIG).old ]; then \ - cp $(EMBTK_DOTCONFIG).old $(EMBTK_DOTCONFIG); \ - make -f scripts/Makefile.build obj=scripts/kconfig \ - EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ - EMBTK_VERSION=$(EMBTK_VERSION) xconfig; \ - else \ - make -f scripts/Makefile.build obj=scripts/kconfig \ - EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ - EMBTK_VERSION=$(EMBTK_VERSION) xconfig; \ - fi -endif - -menuconfig: basic - $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/kconfig \ - EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ - EMBTK_VERSION=$(EMBTK_VERSION) menuconfig - -randconfig: basic - $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/kconfig \ - EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ - EMBTK_VERSION=$(EMBTK_VERSION) randconfig - -basic: - $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/basic - -clean: rmallpath - $(Q)$(MAKE) -f scripts/Makefile.clean obj=scripts/kconfig - $(Q)$(MAKE) -f scripts/Makefile.clean obj=scripts/basic - $(Q)rm -rf .config kbuild.log .fakeroot* - -startbuild: - @if [ -e $(GCC3_BUILD_DIR)/.installed ]; then \ - echo "#################### Embtoolkit Warning ######################"; \ - echo "# Warning trying to restart all the build while it is already"; \ - echo "# done. Please use the correct make target !!!"; \ - echo "##############################################################"; \ - echo; \ - make -s help; \ - else \ - echo "################## Embtoolkit build start ####################"; \ - echo "# Starting build of selected features.."; \ - echo "##############################################################"; \ - echo; \ - make buildtoolchain host_packages_build symlink_tools rootfs_build \ - successful_build; \ - fi - +include mk/buildsystem.mk include mk/macros.mk include mk/target-mcu.mk -include mk/buildsystem.mk include mk/toolchain.mk include mk/packages.mk include mk/rootfs.mk include mk/help.mk - -distclean: clean - $(Q)rm -rf dl/* src/eglibc* host-tools* .config.old diff --git a/mk/buildsystem.mk b/mk/buildsystem.mk index 9951ffd..ef053e1 100644 --- a/mk/buildsystem.mk +++ b/mk/buildsystem.mk @@ -1,6 +1,6 @@ ################################################################################ # Embtoolkit -# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. +# Copyright(C) 2009-2012 Abdoulaye Walsimou GAYE. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,6 +32,93 @@ EMBTK_GENERATED := $(EMBTK_ROOT)/generated ROOTFS := $(EMBTK_GENERATED)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) HOSTTOOLS := $(EMBTK_ROOT)/host-tools-$(EMBTK_MCU_FLAG) DOWNLOAD_DIR := $(patsubst %/,%,$(subst ",,$(strip $(CONFIG_EMBTK_DOWNLOAD_DIR)))) +J := -j$(CONFIG_EMBTK_NUMBER_BUILD_JOBS) + +xconfig: basic +ifeq ($(CONFIG_EMBTK_DOTCONFIG),y) + $(Q)make -f scripts/Makefile.build obj=scripts/kconfig \ + EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ + EMBTK_VERSION=$(EMBTK_VERSION) xconfig +else + $(Q)if [ -e $(EMBTK_DOTCONFIG).old ]; then \ + cp $(EMBTK_DOTCONFIG).old $(EMBTK_DOTCONFIG); \ + make -f scripts/Makefile.build obj=scripts/kconfig \ + EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ + EMBTK_VERSION=$(EMBTK_VERSION) xconfig; \ + else \ + make -f scripts/Makefile.build obj=scripts/kconfig \ + EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ + EMBTK_VERSION=$(EMBTK_VERSION) xconfig; \ + fi +endif + +menuconfig: basic + $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/kconfig \ + EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ + EMBTK_VERSION=$(EMBTK_VERSION) menuconfig + +randconfig: basic + $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/kconfig \ + EMBTK_DEFAULT_DL="$(EMBTK_ROOT)/dl/" \ + EMBTK_VERSION=$(EMBTK_VERSION) randconfig + +basic: + $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/basic + +clean: rmallpath + $(Q)$(MAKE) -f scripts/Makefile.clean obj=scripts/kconfig + $(Q)$(MAKE) -f scripts/Makefile.clean obj=scripts/basic + $(Q)rm -rf .config kbuild.log .fakeroot* + +distclean: clean + $(Q)rm -rf dl/* src/eglibc* host-tools* .config.old + +startbuild: + @if [ -e $(GCC3_BUILD_DIR)/.installed ]; then \ + echo "#################### Embtoolkit Warning ######################"; \ + echo "# Warning trying to restart all the build while it is already"; \ + echo "# done. Please use the correct make target !!!"; \ + echo "##############################################################"; \ + echo; \ + make -s help; \ + else \ + echo "################## Embtoolkit build start ####################"; \ + echo "# Starting build of selected features.."; \ + echo "##############################################################"; \ + echo; \ + make buildtoolchain host_packages_build symlink_tools rootfs_build \ + successful_build; \ + fi + +# Successful build of EmbToolkit message +successful_build: + $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~ ") + $(call embtk_echo_blue,"| Toolchain build log |") + $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~ ") + $(call embtk_echo_blue,"You successfully build your toolchain for $(GNU_TARGET)") + $(call embtk_echo_blue,"Tools built (GCC compiler, Binutils, etc.) are located in:") + $(call embtk_echo_blue," $(TOOLS)/bin") + @echo + $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") + $(call embtk_echo_blue,"| Root file system build log |") + $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") +ifeq ($(CONFIG_EMBTK_HAVE_ROOTFS),y) + $(call embtk_echo_blue,"You also successfully build root filesystem(s) located in the") + $(call embtk_echo_blue,"'generated' sub-directory of EmbToolkit.") +else + $(call embtk_echo_green,"Build of root filesystem not selected.") +endif + @echo + $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") + $(call embtk_echo_blue,"| Embedded systems Toolkit |") + $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") + $(call embtk_echo_blue,"Hope that EmbToolkit will be useful for your project !!!") + $(call embtk_echo_blue,"Please report any bugs/suggestion at:") + $(call embtk_echo_blue," http://www.embtoolkit.org/issues/projects/show/embtoolkit") + $(call embtk_echo_blue,"You can also visit the wiki at:") + $(call embtk_echo_blue," http://www.embtoolkit.org") + @echo + $(call embtk_echo_blue,$(__embtk_msg_h)) mkinitialpath: $(Q)mkdir -p $(SYSROOT) diff --git a/mk/macros.mk b/mk/macros.mk index b2879d1..50f3b50 100644 --- a/mk/macros.mk +++ b/mk/macros.mk @@ -1,6 +1,6 @@ ################################################################################ # Embtoolkit -# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. +# Copyright(C) 2009-2012 Abdoulaye Walsimou GAYE. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -72,35 +72,5 @@ embtk_pwarning = $(call embtk_echo_yellow,"$(__embtk_msg_h)\\n~~ EmbToolkit ~~ W embtk_perror = $(call embtk_echo_red,"$(__embtk_msg_h)\\n~~ EmbToolkit ~~ ERROR: $(1)\\n$(__embtk_msg_h)") embtk_pinfo = $(call embtk_echo_blue,"$(__embtk_msg_h)\n~~ EmbToolkit ~~ $(1)\n$(__embtk_msg_h)") -# Successful build of EmbToolkit message -successful_build: - $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~ ") - $(call embtk_echo_blue,"| Toolchain build log |") - $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~ ") - $(call embtk_echo_blue,"You successfully build your toolchain for $(GNU_TARGET)") - $(call embtk_echo_blue,"Tools built (GCC compiler, Binutils, etc.) are located in:") - $(call embtk_echo_blue," $(TOOLS)/bin") - @echo - $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") - $(call embtk_echo_blue,"| Root file system build log |") - $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") -ifeq ($(CONFIG_EMBTK_HAVE_ROOTFS),y) - $(call embtk_echo_blue,"You also successfully build root filesystem(s) located in the") - $(call embtk_echo_blue,"'generated' sub-directory of EmbToolkit.") -else - $(call embtk_echo_green,"Build of root filesystem not selected.") -endif - @echo - $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") - $(call embtk_echo_blue,"| Embedded systems Toolkit |") - $(call embtk_echo_blue," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") - $(call embtk_echo_blue,"Hope that EmbToolkit will be useful for your project !!!") - $(call embtk_echo_blue,"Please report any bugs/suggestion at:") - $(call embtk_echo_blue," http://www.embtoolkit.org/issues/projects/show/embtoolkit") - $(call embtk_echo_blue,"You can also visit the wiki at:") - $(call embtk_echo_blue," http://www.embtoolkit.org") - @echo - $(call embtk_echo_blue,$(__embtk_msg_h)) - # Packages management macros include $(EMBTK_ROOT)/mk/macros.packages.mk diff --git a/mk/macros.packages.mk b/mk/macros.packages.mk index 521f362..24e1c8c 100644 --- a/mk/macros.packages.mk +++ b/mk/macros.packages.mk @@ -1,6 +1,6 @@ ################################################################################ # Embtoolkit -# Copyright(C) 2011 Abdoulaye Walsimou GAYE. +# Copyright(C) 2011-2012 Abdoulaye Walsimou GAYE. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.3