summaryrefslogtreecommitdiffstats
path: root/rules/binutils.make
blob: ea7d8e542ddd9a37129874083e8ed82a4e41b895 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2006 by Robert Schwebel
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_BINUTILS) += binutils

#
# Paths and names
#
BINUTILS_VERSION	:= $(shell $(CROSS_LD) -v | sed -e 's/.* \(.*\)$$/\1/g')
BINUTILS		:= binutils-$(BINUTILS_VERSION)
BINUTILS_SUFFIX		:= tar.bz2
BINUTILS_URL		:= $(PTXCONF_SETUP_GNUMIRROR)/binutils/$(BINUTILS).$(BINUTILS_SUFFIX)
BINUTILS_SOURCE		:= $(SRCDIR)/$(BINUTILS).$(BINUTILS_SUFFIX)
BINUTILS_DIR		:= $(BUILDDIR)/$(BINUTILS)


# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

$(BINUTILS_SOURCE):
	@$(call targetinfo)
	@$(call get, BINUTILS)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

binutils_prepare: $(STATEDIR)/binutils.prepare

BINUTILS_PATH	:=  PATH=$(CROSS_PATH)
BINUTILS_ENV 	:=  $(CROSS_ENV)

#
# autoconf
#
BINUTILS_AUTOCONF :=  $(CROSS_AUTOCONF_USR) \
	--target=$(PTXCONF_GNU_TARGET) \
	--enable-targets=$(PTXCONF_GNU_TARGET) \
	--disable-nls \
	--enable-commonbfdlib \
	--enable-install-libiberty \
	--disable-multilib

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/binutils.targetinstall:
	@$(call targetinfo)

	@$(call install_init,  binutils)
	@$(call install_fixup, binutils,PACKAGE,binutils)
	@$(call install_fixup, binutils,PRIORITY,optional)
	@$(call install_fixup, binutils,VERSION,$(BINUTILS_VERSION))
	@$(call install_fixup, binutils,SECTION,base)
	@$(call install_fixup, binutils,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup, binutils,DEPENDS,)
	@$(call install_fixup, binutils,DESCRIPTION,missing)

ifdef PTXCONF_BINUTILS_READELF
	@$(call install_copy, binutils, 0, 0, 0755, \
		$(BINUTILS_DIR)/binutils/readelf, \
		/usr/bin/readelf \
	)
endif
ifdef PTXCONF_BINUTILS_OBJDUMP
	@$(call install_copy, binutils, 0, 0, 0755, \
		$(BINUTILS_DIR)/binutils/objdump, \
		/usr/bin/objdump \
	)
endif
	@$(call install_finish, binutils)


	@$(call touch)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

binutils_clean:
	rm -rf $(STATEDIR)/binutils.*
	rm -rf $(PKGDIR)/binutils_*
	rm -rf $(BINUTILS_DIR)

# vim: syntax=make