d3fe164e63c77bb0e0a689be3bd66d416b835324
[openwrt.git] / toolchain / gdb / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=gdb
10
11 ifeq ($(CONFIG_arc),y)
12 PKG_VERSION:=arc-2015.06-gdb
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2015.06-gdb/
16 PKG_MD5SUM:=d318829bfd2ed62714817f0d25706825
17 GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
18 else
19 PKG_VERSION:=7.10
20
21 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
22 PKG_SOURCE_URL:=@GNU/gdb
23 PKG_MD5SUM:=2a35bac41fa8e10bf04f3a0dd7f7f363
24 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
25 endif
26
27 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
28
29 HOST_BUILD_PARALLEL:=1
30
31 include $(INCLUDE_DIR)/toolchain-build.mk
32
33 HOST_CONFIGURE_VARS += \
34         gdb_cv_func_sigsetjmp=yes
35
36 HOST_CONFIGURE_ARGS = \
37         --prefix=$(TOOLCHAIN_DIR) \
38         --build=$(GNU_HOST_NAME) \
39         --host=$(GNU_HOST_NAME) \
40         --target=$(REAL_GNU_TARGET_NAME) \
41         --disable-werror \
42         --without-uiout \
43         --disable-tui --disable-gdbtk --without-x \
44         --without-included-gettext \
45         --enable-threads \
46         --with-expat \
47         --disable-binutils \
48         --disable-ld \
49         --disable-gas \
50         --disable-sim
51
52 define Host/Install
53         mkdir -p $(TOOLCHAIN_DIR)/bin
54         $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
55         ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
56         strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
57 endef
58
59 define Host/Clean
60         rm -rf \
61                 $(HOST_BUILD_DIR) \
62                 $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \
63                 $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
64 endef
65
66 $(eval $(call HostBuild))