summaryrefslogtreecommitdiffstats
path: root/plugins/examples/host-toolchain/binutils-host.mk
blob: 72d9acd4a156c014e67c3672cbb76e0fe965baa0 (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
# This file is part of MXE.
# See index.html for further information.

PKG             := binutils-host
$(PKG)_IGNORE    = $(binutils_IGNORE)
$(PKG)_VERSION   = $(binutils_VERSION)
$(PKG)_CHECKSUM  = $(binutils_CHECKSUM)
$(PKG)_SUBDIR    = $(binutils_SUBDIR)
$(PKG)_FILE      = $(binutils_FILE)
$(PKG)_URL       = $(binutils_URL)
$(PKG)_URL_2     = $(binutils_URL_2)
$(PKG)_DEPS     := gcc

define $(PKG)_UPDATE
    echo $(binutils_VERSION)
endef

$(PKG)_PROGS := addr2line ar as c++filt dlltool dllwrap elfedit gprof \
                ld.bfd ld nm objcopy objdump ranlib readelf size strings \
                strip windmc windres

define $(PKG)_BUILD
    $(subst --disable-werror,\
            --disable-werror \
            --prefix='$(PREFIX)/$(TARGET)' \
            --program-prefix='$(TARGET)-' \
            --host='$(TARGET)',\
    $(subst install, install-strip,\
    $(binutils_BUILD)))

    # install unprefixed versions also
    for p in $($(PKG)_PROGS); do \
        cp "$(PREFIX)/$(TARGET)/bin/$(TARGET)-$$p.exe" \
           "$(PREFIX)/$(TARGET)/bin/$$p.exe" ; \
    done

    # tools seem to be duplicates of '$(PREFIX)/$(TARGET)'
    rm -rf '$(PREFIX)/$(TARGET)/$(TARGET)'
endef