X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/e3b7b2e97ba5ee1aa354240746700b53faf1f60a..f642dc617471830f6ec520c968d85071fd756347:/toolchain/gdb/Makefile?ds=sidebyside diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 85dfa7164..be3e423a1 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -1,36 +1,30 @@ -# $Id$ - +# +# Copyright (C) 2006-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# include $(TOPDIR)/rules.mk -GDB_NAME:=gdb -GDB_SITE:=http://ftp.gnu.org/gnu/gdb -GDB_VERSION:=6.3 -GDB_SOURCE:=$(GDB_NAME)-$(GDB_VERSION).tar.bz2 -GDB_CAT:=bzcat - -GDB_DIR:=$(TOOL_BUILD_DIR)/$(GDB_NAME)-$(GDB_VERSION) - -$(DL_DIR)/$(GDB_SOURCE): - $(WGET) -P $(DL_DIR) $(GDB_SITE)/$(GDB_SOURCE) +PKG_NAME:=gdb +PKG_VERSION:=6.3 -$(GDB_DIR)/.patched: $(DL_DIR)/$(GDB_SOURCE) - $(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) - - $(PATCH) $(GDB_DIR) ./patches - # Copy a config.sub from gcc. This is only necessary until - # gdb's config.sub supports -linux-uclibc tuples. - # Should probably integrate this into the patch. - touch $(GDB_DIR)/.patched +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=05b928f41fa5b482e49ca2c24762a0ae +PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/gdb +PKG_CAT:=bzcat -# gdb client +STAGING_DIR_HOST:=$(TOOLCHAIN_DIR) +BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN) -GDB_CLIENT_DIR:=$(TOOL_BUILD_DIR)/gdbclient-$(GDB_VERSION) +include $(INCLUDE_DIR)/host-build.mk -$(GDB_CLIENT_DIR)/.configured: $(GDB_DIR)/.patched - mkdir -p $(GDB_CLIENT_DIR) - (cd $(GDB_CLIENT_DIR); \ +define Build/Configure + (cd $(PKG_BUILD_DIR); \ gdb_cv_func_sigsetjmp=yes \ - $(GDB_DIR)/configure \ - --prefix=$(STAGING_DIR) \ + CFLAGS="-O2" \ + $(PKG_BUILD_DIR)/configure \ + --prefix=$(TOOLCHAIN_DIR)/usr \ --build=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \ @@ -40,20 +34,24 @@ $(GDB_CLIENT_DIR)/.configured: $(GDB_DIR)/.patched --without-included-gettext \ --enable-threads \ ); - touch $(GDB_CLIENT_DIR)/.configured - -$(GDB_CLIENT_DIR)/gdb/gdb: $(GDB_CLIENT_DIR)/.configured - $(MAKE) -C $(GDB_CLIENT_DIR) - strip $(GDB_CLIENT_DIR)/gdb/gdb - -$(TARGET_CROSS)gdb: $(GDB_CLIENT_DIR)/gdb/gdb - install -c $(GDB_CLIENT_DIR)/gdb/gdb $(TARGET_CROSS)gdb - cd $(STAGING_DIR)/bin && \ - ln -fs $(GNU_TARGET_NAME)-gdb $(REAL_GNU_TARGET_NAME)-gdb - -source: $(DL_DIR)/$(GDB_SOURCE) -prepare: $(GDB_DIR)/.patched -compile: -install: $(TARGET_CROSS)gdb -clean: - rm -rf $(GDB_CLIENT_DIR) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +define Build/Install + mkdir -p $(TOOLCHAIN_DIR)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb + ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb + strip $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb +endef + +define Build/Clean + rm -rf \ + $(PKG_BUILD_DIR) \ + $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb \ + $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb +endef + +$(eval $(call HostBuild))