summaryrefslogtreecommitdiff
path: root/package/binutils/Makefile
blob: c66ab6d2d34b5db060edb3058905b18f1d9f9a97 (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
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

include ${TOPDIR}/rules.mk
include ${TOPDIR}/toolchain/binutils/Makefile.inc

PKG_NAME:=		binutils
PKG_DESCR:=		binary utilities (nm, objdump, as, ..)
PKG_SECTION:=		lang
PKG_DEPENDS:=		libbfd
PKG_OPTS:=		dev

PKG_SUBPKGS:=		BINUTILS LIBBFD
PKGSD_LIBBFD:=		Binary File Descriptor library
PKGSC_LIBBFD:=		libs

PKG_HOST_DEPENDS:=      !cygwin
PKG_ARCH_DEPENDS:=	!avr32

ifeq ($(ADK_STATIC),y)
PKG_OPTS+=		libmix
endif

include ${TOPDIR}/mk/package.mk

$(eval $(call PKG_template,BINUTILS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
$(eval $(call PKG_template,LIBBFD,libbfd,${PKG_VERSION}-${PKG_RELEASE},,${PKGSD_LIBBFD},${PKGSC_LIBBFD},${PKG_OPTS}))

ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
CONFIGURE_ARGS+=	--enable-multilib
else
CONFIGURE_ARGS+=	--disable-multilib
endif

TARGET_CFLAGS:=         $(filter-out -flto,$(TARGET_CFLAGS))
TARGET_CFLAGS+=		-fPIC
ifeq ($(ADK_NATIVE),)
CONFIGURE_ARGS+=	--disable-werror \
			--host=$(REAL_GNU_TARGET_NAME) \
			--target=$(REAL_GNU_TARGET_NAME)
else
CONFIGURE_ARGS+=	--disable-werror
endif

post-build:
	$(CP) ${WRKBUILD}/libiberty/libiberty.a $(STAGING_TARGET_DIR)/usr/lib

libbfd-install:
	${INSTALL_DIR} ${IDIR_LIBBFD}/usr/lib
	$(CP) ${WRKINST}/usr/lib/*.so* ${IDIR_LIBBFD}/usr/lib

binutils-install:
	${INSTALL_DIR} ${IDIR_BINUTILS}/usr/bin
	${INSTALL_BIN} ${WRKINST}/usr/bin/{ar,as,ld,strip,strings,size,nm} \
		${IDIR_BINUTILS}/usr/bin/
	${INSTALL_BIN} ${WRKINST}/usr/bin/{objcopy,ranlib,readelf,objdump} \
		 ${IDIR_BINUTILS}/usr/bin/

include ${TOPDIR}/mk/pkg-bottom.mk