1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
30 THISAPP = $(PKG_NAME)-$(VER)
31 DL_FILE = $(THISAPP).tar.bz2
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
34 ifeq "$(STAGE)" "toolchain"
35 ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
36 TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
38 TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-cross
41 TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
44 ###############################################################################
46 ###############################################################################
48 objects = $(DL_FILE) $(THISAPP)-configure-1.patch \
49 $(THISAPP)-uClibc-1.patch \
50 $(THISAPP)-ld_makefile.patch
59 ###############################################################################
60 # Installation Details
61 ###############################################################################
65 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
66 -mkdir -v $(DIR_SRC)/binutils-build
67 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-configure-1.patch
69 ifeq "$(STAGE)" "toolchain"
70 ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
76 ifeq "$(MACHINE)" "$(MACHINE_REAL)"
77 cd $(DIR_SRC)/binutils-build && CC="gcc -B/usr/bin/" ../$(THISAPP)/configure \
78 --prefix=$(TOOLS_DIR) \
81 cd $(DIR_SRC)/binutils-build && make $(PARALLELISMFLAGS)
82 cd $(DIR_SRC)/binutils-build && make install
83 cd $(DIR_SRC)/binutils-build && make -C ld clean
84 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=$(TOOLS_DIR)/lib
85 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin
90 cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
91 --prefix=$(TOOLS_DIR) \
93 --host=${IFS_TARGET} \
94 --target=${IFS_TARGET} \
98 cd $(DIR_SRC)/binutils-build && make configure-host
99 cd $(DIR_SRC)/binutils-build && make $(PARALLELISMFLAGS)
100 cd $(DIR_SRC)/binutils-build && make install
105 cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
106 --prefix=$(TOOLS_DIR) \
108 --with-lib-path=$(TOOLS_DIR)/lib
109 cd $(DIR_SRC)/binutils-build && make $(PARALLELISMFLAGS)
110 cd $(DIR_SRC)/binutils-build && make install
112 cd $(DIR_SRC)/binutils-build && make -C ld clean
113 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
114 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin
122 cd $(DIR_SRC)/binutils-build && AR=ar AS=as ../$(THISAPP)/configure \
123 --prefix=$(CTOOLS_DIR) \
125 --target=${IFS_TARGET} \
126 --with-lib-path=$(TOOLS_DIR)/lib \
130 cd $(DIR_SRC)/binutils-build && make configure-host
131 cd $(DIR_SRC)/binutils-build && make $(PARALLELISMFLAGS)
132 cd $(DIR_SRC)/binutils-build && make install
134 -mkdir -p $(TOOLS_DIR)/include
135 cp -fv $(DIR_APP)/include/libiberty.h $(TOOLS_DIR)/include
139 ifeq "$(STAGE)" "base"
140 cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure --prefix=/usr \
142 cd $(DIR_SRC)/binutils-build && make tooldir=/usr $(PARALLELISMFLAGS)
143 cd $(DIR_SRC)/binutils-build && make tooldir=/usr install
145 cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
148 ifeq "$(STAGE)" "installer"
149 cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
150 --target=$(UCLIBC_TARGET) \
151 --prefix=$(UCLIBC_DIR) \
152 --with-sysroot=$(UCLIBC_SYSROOT_DIR) \
156 cd $(DIR_SRC)/binutils-build && make $(PARALLELISMFLAGS)
157 cd $(DIR_SRC)/binutils-build && make install
159 for t in ar as ld strip; do \
160 ln -sfv $(UCLIBC_DIR)/bin/$(UCLIBC_TARGET)-$${t} \
161 $(UCLIBC_CC_CORE_STATIC_DIR)/$(UCLIBC_TARGET)/bin/$${t}; \
162 ln -sfv $(UCLIBC_DIR)/bin/$(UCLIBC_TARGET)-$${t} \
163 $(UCLIBC_CC_CORE_STATIC_DIR)/bin/$(UCLIBC_TARGET)-$${t}; \
167 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build