summaryrefslogtreecommitdiff
path: root/core/toolchain/addons.mk
blob: 259e805e0f3509329563794fdbdb85ab1cb3eed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
################################################################################
# Embtoolkit
# Copyright(C) 2009-2014 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
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
#
# \file         addons.mk
# \brief	Toolchain addons part
# \author	Abdoulaye Walsimou GAYE <awg@embtoolkit.org>
# \date		September 2014
################################################################################

TOOLCHAIN_ADDONS_NAME		:= toolchain_addons
TOOLCHAIN_ADDONS_SRC_DIR	:= $(TOOLCHAIN_DIR)/.embtk-toolchain_addons
TOOLCHAIN_ADDONS_BUILD_DIR	:= $(TOOLCHAIN_DIR)/.embtk-toolchain_addons

# Include .kconfig symbols if any
-include $(call __embtk_pkg_dotkconfig_f,toolchain_addons)
__embtk_toolchain_addons_installed := $(__embtk_toolchain_addons_runrecipe-y)

#
# Toolchain addons build recipe
#
__embtk_toolchain_addons-y    = $(patsubst %_install,%,$(EMBTK_TOOLCHAIN_ADDONS_DEPS-y))
__embtk_toolchain_addons-n    = $(patsubst %_install,%,$(EMBTK_TOOLCHAIN_ADDONS_DEPS-))

define __embtk_toolchain_addons_build
	$(__embtk_toolsaddons_build_msg)
	$(call __embtk_unsetinstalled_pkg,toolchain_addons)
	$(call __embtk_unsetdecompressed_pkg,toolchain_addons)
	$(__embtk_toolchain_mkinitdirs)
	$(if $(findstring core,$(1)),,
		$(foreach rootfspkg,$(__embtk_rootfs_pkgs-y),
				$(call embtk_cleanup_pkg,$(rootfspkg)))
		$(foreach rootfsnpkg,$(__embtk_rootfs_pkgs-n),
				$(call embtk_cleanup_pkg,$(rootfsnpkg)))
		$(___embtk_toolchain_decompress))
	$(if $(findstring core,$(1)),
		$(foreach addon,$(__embtk_toolchain_addons-y),
				$(call embtk_cleanup_pkg,$(addon))))
	$(if $(EMBTK_TOOLCHAIN_ADDONS_DEPS-),
		$(foreach addon,$(__embtk_toolchain_addons-n),
				$(call embtk_cleanup_pkg,$(addon))))
	$(if $(EMBTK_TOOLCHAIN_ADDONS_DEPS-y),
		$(foreach addon,$(__embtk_toolchain_addons-y),
				$(call embtk_install_xpkg,$(addon))))
	$(call __embtk_setinstalled_pkg,toolchain_addons)
	$(call __embtk_pkg_gen_dotkconfig_f,toolchain_addons)
	$(call __embtk_pkg_setkconfigured,toolchain_addons)
endef

#
# Toolchain addons dependencies
#
embtk_pkgincdir := core/toolchain/addons

# ltrace
$(call embtk_include_xtoolpkg,ltrace,toolchain_addons_deps)

# strace
$(call embtk_include_xtoolpkg,strace,toolchain_addons_deps)

# Addon: gdb
embtk_pkgincdir := core/toolchain/addons/gdb
ifeq ($(CONFIG_EMBTK_HAVE_GDBSERVER)$(CONFIG_EMBTK_HAVE_GDB),y)
include core/toolchain/addons/gdb/common.mk
endif
$(call embtk_include_xtoolpkg,gdbserver,toolchain_addons_deps)
$(call embtk_include_xtoolpkg,gdb,toolchain_addons_deps)
$(call embtk_include_xtoolpkg,gdb_host,toolchain_addons_deps)

TOOLCHAIN_ADDONS_DEPS := $(EMBTK_TOOLCHAIN_ADDONS_DEPS-y)