build system refactoring in preparation for allowing packages to do host-build steps
[openwrt/openwrt.git] / toolchain / gdb / Makefile
1 #
2 # Copyright (C) 2006-2009 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 PKG_VERSION:=6.3
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
13 PKG_MD5SUM:=05b928f41fa5b482e49ca2c24762a0ae
14 PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/gdb
15 PKG_CAT:=bzcat
16
17 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
18 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
19
20 include $(INCLUDE_DIR)/host-build.mk
21
22 define Host/Configure
23 (cd $(HOST_BUILD_DIR); \
24 gdb_cv_func_sigsetjmp=yes \
25 CFLAGS="-O2" \
26 $(HOST_BUILD_DIR)/configure \
27 --prefix=$(TOOLCHAIN_DIR)/usr \
28 --build=$(GNU_HOST_NAME) \
29 --host=$(GNU_HOST_NAME) \
30 --target=$(REAL_GNU_TARGET_NAME) \
31 $(DISABLE_NLS) \
32 --without-uiout --disable-gdbmi \
33 --disable-tui --disable-gdbtk --without-x \
34 --without-included-gettext \
35 --enable-threads \
36 );
37 endef
38
39 define Host/Compile
40 $(MAKE) -C $(HOST_BUILD_DIR)
41 endef
42
43 define Host/Install
44 mkdir -p $(TOOLCHAIN_DIR)/usr/bin
45 $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb
46 ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb
47 strip $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb
48 endef
49
50 define Host/Clean
51 rm -rf \
52 $(HOST_BUILD_DIR) \
53 $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb \
54 $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb
55 endef
56
57 $(eval $(call HostBuild))