summaryrefslogtreecommitdiff
path: root/build-common/packages/binutils-gdb
blob: 8d091b7ccb27ba44347945d816de3a8296fb0292 (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
## Build a binutils-gdb package

BINUTILS_SRC?=$(BUILDSYS_SOURCES)/binutils-gdb
BINUTILS_BUILD=$(BUILDSYS_BUILD)/$(ARCH)/binutils-gdb
BINUTILS_INSTALL=$(BUILDSYS_INSTALL)/$(ARCH)/binutils-gdb

$(BINUTILS_BUILD) $(BINUTILS_INSTALL):
	@mkdir -p $@

BINUTILS_GIT?=git://sourceware.org/git/binutils-gdb.git
BINUTILS_BRANCH?=master

$(BINUTILS_SRC):
	git clone $(BINUTILS_GIT) -b $(BINUTILS_BRANCH) $(BINUTILS_SRC)


binutils-gdb: binutils-gdb-build binutils-gdb-install-host

BINUTILS_CONF_EXT_arm:= \
		--with-sysroot=/opt/STM/STLinux-2.4/devkit/armv7/target \
		--with-separate-debug-dir=/opt/STM/STLinux-2.4/devkit/armv7/target/usr/lib/debug

# Configure packages

binutils-gdb-configure-help: | $(BINUTILS_SRC) $(BINUTILS_BUILD) $(BINUTILS_SRC)/configure
	cd $(BINUTILS_BUILD) && \
	$(BINUTILS_SRC)/configure \
		--help

binutils-gdb-configure $(BINUTILS_BUILD)/Makefile: | $(BINUTILS_SRC) $(BINUTILS_BUILD) $(BINUTILS_SRC)/configure
	cd $(BINUTILS_BUILD) && \
	CC="gcc -m32" \
	$(BINUTILS_SRC)/configure \
		--prefix=/usr \
		--target=$(ARCH)-linux \
		--program-prefix=$(ARCH)-linux- \
		--disable-nls \
                --enable-linux-kernel-aware \
		--enable-shtdi \
		--enable-tui \
		--with-python=yes \
		$(BINUTILS_CONF_EXT_$(ARCH))

binutils-gdb-build: $(BINUTILS_BUILD)/Makefile
	$(MAKE) -j 8 -C $(BINUTILS_BUILD)

binutils-gdb-install: $(BINUILS_INSTALL)
	$(MAKE) -j 8 -C $(BINUTILS_BUILD) install DESTDIR=$(BINUTILS_INSTALL)

binutils-gdb-install-host: BINUTILS_INSTALL=$(BUILDSYS_HOST)
binutils-gdb-install-host: binutils-gdb-install

binutils-gdb-distclean:
	rm -rf $(BINUTILS_BUILD)


## Helpers to use the built and installed GDB

GDB?=$(shell PATH=$(PATH) which $(ARCH)-linux-gdb)

gdb-version:
	@echo "Using GDB from : $(GDB)"
	$(GDB) --version