kumquat-buildroot/toolchain/gdb/gdb.mk

251 lines
6.8 KiB
Makefile
Raw Normal View History

######################################################################
2002-05-29 16:24:11 +02:00
#
# gdb
#
######################################################################
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
GDB_VERSION:=$(strip $(subst ",, $(BR2_GDB_VERSION)))
2006-11-17 16:43:51 +01:00
#"))
else
GDB_VERSION:=$(strip $(subst ",, $(BR2_EXT_GDB_VERSION)))
#"))
endif
2002-05-29 16:24:11 +02:00
ifeq ($(GDB_VERSION),snapshot)
# Be aware that this changes daily....
GDB_SITE:=ftp://sources.redhat.com/pub/gdb/snapshots/current
GDB_SOURCE:=gdb.tar.bz2
2006-11-17 16:43:51 +01:00
GDB_CAT:=$(BZCAT)
GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_VERSION)
GDB_PATCH_DIR:=toolchain/gdb/$(GDB_VERSION)
else
2007-07-31 16:59:58 +02:00
2007-08-21 21:33:00 +02:00
ifeq ($(BR2_TOOLCHAIN_NORMAL),y)
GDB_SITE:=http://ftp.gnu.org/gnu/gdb
2007-07-31 16:59:58 +02:00
else
GDB_SITE:=$(VENDOR_SITE)
endif
GDB_OFFICIAL_VERSION:=$(GDB_VERSION)$(VENDOR_SUFFIX)$(VENDOR_GDB_RELEASE)
GDB_SOURCE:=gdb-$(GDB_OFFICIAL_VERSION).tar.bz2
2006-11-17 16:43:51 +01:00
GDB_CAT:=$(BZCAT)
2007-08-21 21:33:00 +02:00
ifeq ($(BR2_TOOLCHAIN_NORMAL),y)
2007-07-31 16:59:58 +02:00
GDB_PATCH_DIR:=toolchain/gdb/$(GDB_OFFICIAL_VERSION)
else
GDB_PATCH_DIR:=$(VENDOR_PATCH_DIR)/gdb-$(GDB_OFFICIAL_VERSION)
endif
GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_OFFICIAL_VERSION)
2002-05-29 16:24:11 +02:00
# NOTE: This option should not be used with gdb versions 6.4 and above.
ifeq ($(GDB_VERSION),6.2.1)
DISABLE_GDBMI:=--disable-gdbmi
endif
ifeq ($(GDB_VERSION),6.3)
DISABLE_GDBMI:=--disable-gdbmi
endif
endif
2002-05-29 16:24:11 +02:00
$(DL_DIR)/$(GDB_SOURCE):
$(WGET) -P $(DL_DIR) $(GDB_SITE)/$(GDB_SOURCE)
2002-05-29 16:24:11 +02:00
2005-12-02 23:31:12 +01:00
gdb-unpacked: $(GDB_DIR)/.unpacked
$(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
2007-07-31 16:59:58 +02:00
mkdir -p $(TOOL_BUILD_DIR)
2004-10-11 16:01:07 +02:00
$(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
ifeq ($(GDB_VERSION),snapshot)
GDB_REAL_DIR=$(shell \
tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1)
ln -sf $(TOOL_BUILD_DIR)/$(shell tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1) $(GDB_DIR)
endif
2007-07-31 16:59:58 +02:00
toolchain/patch-kernel.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch
$(CONFIG_UPDATE) $(GDB_DIR)
2007-06-22 12:42:07 +02:00
touch $@
2005-12-02 23:31:12 +01:00
gdb-dirclean:
rm -rf $(GDB_DIR)
######################################################################
#
# gdb target
#
######################################################################
GDB_TARGET_DIR:=$(BUILD_DIR)/gdb-$(GDB_VERSION)-target
GDB_TARGET_CONFIGURE_VARS:= \
ac_cv_type_uintptr_t=yes \
gt_cv_func_gettext_libintl=yes \
ac_cv_func_dcgettext=yes \
gdb_cv_func_sigsetjmp=yes \
bash_cv_func_strcoll_broken=no \
bash_cv_must_reinstall_sighandlers=no \
bash_cv_func_sigsetjmp=present \
bash_cv_have_mbstate_t=yes
$(GDB_TARGET_DIR)/.configured: $(GDB_DIR)/.unpacked
mkdir -p $(GDB_TARGET_DIR)
2007-08-22 11:56:41 +02:00
(cd $(GDB_TARGET_DIR); rm -rf config.cache; \
2004-09-30 02:51:53 +02:00
gdb_cv_func_sigsetjmp=yes \
$(TARGET_CONFIGURE_OPTS) \
2007-06-26 16:32:10 +02:00
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_LDFLAGS) -Wno-error" \
CFLAGS="$(TARGET_CFLAGS) $(TARGET_LDFLAGS) -Wno-error" \
$(GDB_TARGET_CONFIGURE_VARS) \
$(GDB_DIR)/configure \
--build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--prefix=/usr \
$(DISABLE_NLS) \
--without-uiout $(DISABLE_GDBMI) \
--disable-tui --disable-gdbtk --without-x \
--disable-sim --enable-gdbserver \
--without-included-gettext \
2007-06-26 16:32:10 +02:00
--disable-werror \
)
ifeq ($(BR2_ENABLE_LOCALE),y)
-$(SED) "s,^INTL *=.*,INTL = -lintl,g;" $(GDB_DIR)/gdb/Makefile
endif
2007-06-22 12:42:07 +02:00
touch $@
$(GDB_TARGET_DIR)/gdb/gdb: $(GDB_TARGET_DIR)/.configured
$(MAKE) CC=$(TARGET_CC) MT_CFLAGS="$(TARGET_CFLAGS)" \
-C $(GDB_TARGET_DIR)
$(STRIP) $(GDB_TARGET_DIR)/gdb/gdb
$(TARGET_DIR)/usr/bin/gdb: $(GDB_TARGET_DIR)/gdb/gdb
install -c -D $(GDB_TARGET_DIR)/gdb/gdb $(TARGET_DIR)/usr/bin/gdb
gdb_target: ncurses $(TARGET_DIR)/usr/bin/gdb
gdb_target-source: $(DL_DIR)/$(GDB_SOURCE)
2004-10-10 03:16:29 +02:00
gdb_target-clean:
2007-06-22 12:42:07 +02:00
-$(MAKE) -C $(GDB_DIR) clean
2004-10-10 03:16:29 +02:00
gdb_target-dirclean:
rm -rf $(GDB_DIR)
######################################################################
#
# gdbserver
#
######################################################################
GDB_SERVER_DIR:=$(BUILD_DIR)/gdbserver-$(GDB_VERSION)
$(GDB_SERVER_DIR)/.configured: $(GDB_DIR)/.unpacked
mkdir -p $(GDB_SERVER_DIR)
2007-08-22 11:56:41 +02:00
(cd $(GDB_SERVER_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
2004-09-30 02:51:53 +02:00
gdb_cv_func_sigsetjmp=yes \
2007-05-15 13:33:08 +02:00
bash_cv_have_mbstate_t=yes \
$(GDB_DIR)/gdb/gdbserver/configure \
--build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share \
--localstatedir=/var \
--mandir=/usr/man \
--infodir=/usr/info \
--includedir=$(STAGING_DIR)/usr/include \
$(DISABLE_NLS) \
--without-uiout $(DISABLE_GDBMI) \
--disable-tui --disable-gdbtk --without-x \
--without-included-gettext \
)
2007-06-22 12:42:07 +02:00
touch $@
2002-05-29 16:24:11 +02:00
$(GDB_SERVER_DIR)/gdbserver: $(GDB_SERVER_DIR)/.configured
$(MAKE) CC=$(TARGET_CC) MT_CFLAGS="$(TARGET_CFLAGS)" \
-C $(GDB_SERVER_DIR)
$(STRIP) $(GDB_SERVER_DIR)/gdbserver
$(TARGET_DIR)/usr/bin/gdbserver: $(GDB_SERVER_DIR)/gdbserver
ifeq ($(strip $(BR2_CROSS_TOOLCHAIN_TARGET_UTILS)),y)
mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils
install -c $(GDB_SERVER_DIR)/gdbserver \
$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/target_utils/gdbserver
endif
install -c -D $(GDB_SERVER_DIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver
2002-05-29 16:24:11 +02:00
gdbserver: $(TARGET_DIR)/usr/bin/gdbserver
2002-05-29 16:24:11 +02:00
2004-10-10 03:16:29 +02:00
gdbserver-clean:
2007-06-22 12:42:07 +02:00
-$(MAKE) -C $(GDB_SERVER_DIR) clean
2004-10-10 03:16:29 +02:00
gdbserver-dirclean:
rm -rf $(GDB_SERVER_DIR)
######################################################################
#
# gdb on host
#
######################################################################
GDB_HOST_DIR:=$(TOOL_BUILD_DIR)/gdbhost-$(GDB_VERSION)
$(GDB_HOST_DIR)/.configured: $(GDB_DIR)/.unpacked
mkdir -p $(GDB_HOST_DIR)
2007-08-22 11:56:41 +02:00
(cd $(GDB_HOST_DIR); rm -rf config.cache; \
2004-09-30 02:51:53 +02:00
gdb_cv_func_sigsetjmp=yes \
2007-05-15 13:33:08 +02:00
bash_cv_have_mbstate_t=yes \
$(GDB_DIR)/configure \
--prefix=$(STAGING_DIR) \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
$(DISABLE_NLS) \
--without-uiout $(DISABLE_GDBMI) \
--disable-tui --disable-gdbtk --without-x \
--without-included-gettext \
2004-09-30 02:51:53 +02:00
--enable-threads \
)
2007-06-22 12:42:07 +02:00
touch $@
$(GDB_HOST_DIR)/gdb/gdb: $(GDB_HOST_DIR)/.configured
$(MAKE) -C $(GDB_HOST_DIR)
strip $(GDB_HOST_DIR)/gdb/gdb
$(TARGET_CROSS)gdb: $(GDB_HOST_DIR)/gdb/gdb
install -c $(GDB_HOST_DIR)/gdb/gdb $(TARGET_CROSS)gdb
ln -snf ../../bin/$(REAL_GNU_TARGET_NAME)-gdb \
2007-06-22 12:42:07 +02:00
$(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/gdb
ln -snf $(REAL_GNU_TARGET_NAME)-gdb \
2007-06-22 12:42:07 +02:00
$(STAGING_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb
gdbhost: $(TARGET_CROSS)gdb
gdbhost-clean:
2007-06-22 12:42:07 +02:00
-$(MAKE) -C $(GDB_HOST_DIR) clean
gdbhost-dirclean:
rm -rf $(GDB_HOST_DIR)
2002-05-29 16:24:11 +02:00
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_GDB)),y)
TARGETS+=gdb_target
endif
ifeq ($(strip $(BR2_PACKAGE_GDB_SERVER)),y)
TARGETS+=gdbserver
endif
ifeq ($(strip $(BR2_PACKAGE_GDB_HOST)),y)
TARGETS+=gdbhost
endif