summaryrefslogtreecommitdiffstats
path: root/make/uclibc_toolchain_2_95.mk
diff options
context:
space:
mode:
Diffstat (limited to 'make/uclibc_toolchain_2_95.mk')
-rw-r--r--make/uclibc_toolchain_2_95.mk70
1 files changed, 38 insertions, 32 deletions
diff --git a/make/uclibc_toolchain_2_95.mk b/make/uclibc_toolchain_2_95.mk
index 4778d7e63..ff4efb83f 100644
--- a/make/uclibc_toolchain_2_95.mk
+++ b/make/uclibc_toolchain_2_95.mk
@@ -25,6 +25,9 @@ ifeq ($(GCC_2_95_TOOLCHAIN),true)
# hacking on the toolchain...
#
#############################################################
+#Directory in which to build the toolchain
+TOOL_BUILD_DIR:=$(BASE_DIR)/toolchain_build
+
TARGET_LANGUAGES:=c,c++
# If you want multilib enabled, enable this...
@@ -40,35 +43,35 @@ MULTILIB:=--enable-multilib
#############################################################
BINUTILS_SITE:=ftp://ftp.gnu.org/gnu/binutils/
BINUTILS_SOURCE:=binutils-2.13.2.1.tar.bz2
-BINUTILS_DIR:=$(BUILD_DIR)/binutils-2.13.2.1
+BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-2.13.2.1
#
# Perhaps you would perfer to use the older 2.12.1 version?
#BINUTILS_SITE:=ftp://ftp.gnu.org/gnu/binutils/
#BINUTILS_SOURCE:=binutils-2.12.1.tar.bz2
-#BINUTILS_DIR:=$(BUILD_DIR)/binutils-2.12.1
+#BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-2.12.1
ifeq ($(USE_UCLIBC_SNAPSHOT),true)
# Be aware that this changes daily....
-UCLIBC_DIR=$(BUILD_DIR)/uClibc
+UCLIBC_DIR=$(TOOL_BUILD_DIR)/uClibc
UCLIBC_SOURCE=uClibc-snapshot.tar.bz2
UCLIBC_SITE:=ftp://www.uclibc.org/uClibc
else
-UCLIBC_DIR:=$(BUILD_DIR)/uClibc-0.9.17
+UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc-0.9.17
UCLIBC_SOURCE:=uClibc-0.9.17.tar.bz2
UCLIBC_SITE:=http://www.kernel.org/pub/linux/libs/uclibc
endif
GCC_SITE:=http://www.kernel.org/pub/linux/libs/uclibc/toolchain
GCC_SOURCE:=gcc-20011006.tar.bz2
-GCC_DIR:=$(BUILD_DIR)/gcc-20011006
+GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-20011006
ELF2FLT_SITE:=http://www.kernel.org/pub/linux/libs/uclibc/toolchain
ELF2FLT_SOURCE:=elf2flt-20020731.tar.bz2
-ELF2FLT_DIR:=$(BUILD_DIR)/elf2flt
+ELF2FLT_DIR:=$(TOOL_BUILD_DIR)/elf2flt
STLPORT_SITE=http://www.stlport.org/archive
STLPORT_SOURCE=STLport-4.5.3.tar.gz
-STLPORT_DIR=$(BUILD_DIR)/STLport-4.5.3
+STLPORT_DIR=$(TOOL_BUILD_DIR)/STLport-4.5.3
@@ -77,8 +80,8 @@ STLPORT_DIR=$(BUILD_DIR)/STLport-4.5.3
# Setup some initial paths
#
#############################################################
-$(BUILD_DIR)/.setup:
- mkdir -p $(BUILD_DIR)
+$(TOOL_BUILD_DIR)/.setup:
+ mkdir -p $(TOOL_BUILD_DIR)
mkdir -p $(DL_DIR)
mkdir -p $(STAGING_DIR)
mkdir -p $(STAGING_DIR)/include
@@ -89,7 +92,7 @@ $(BUILD_DIR)/.setup:
(cd $(STAGING_DIR)/$(GNU_TARGET_NAME); ln -fs ../include sys-include)
mkdir -p $(STAGING_DIR)/usr/lib
(cd $(STAGING_DIR)/usr/lib; ln -fs ../../lib/gcc-lib)
- touch $(BUILD_DIR)/.setup
+ touch $(TOOL_BUILD_DIR)/.setup
#############################################################
@@ -113,12 +116,12 @@ uclibc_toolchain-dirclean: gcc_final-dirclean uclibc-dirclean gcc_initial-dircle
# build binutils
#
#############################################################
-BINUTILS_DIR1:=$(BUILD_DIR)/binutils-build
+BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-build
$(DL_DIR)/$(BINUTILS_SOURCE):
$(WGET) -P $(DL_DIR) $(BINUTILS_SITE)/$(BINUTILS_SOURCE)
-$(BINUTILS_DIR)/.unpacked: $(BUILD_DIR)/.setup $(DL_DIR)/$(BINUTILS_SOURCE)
- bzcat $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+$(BINUTILS_DIR)/.unpacked: $(TOOL_BUILD_DIR)/.setup $(DL_DIR)/$(BINUTILS_SOURCE)
+ bzcat $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(BINUTILS_DIR)/.unpacked
$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
@@ -185,12 +188,12 @@ binutils-dirclean:
# Next build first pass gcc compiler
#
#############################################################
-GCC_BUILD_DIR1:=$(BUILD_DIR)/gcc-initial
+GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-initial
$(DL_DIR)/$(GCC_SOURCE):
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
-$(GCC_DIR)/.unpacked: $(BUILD_DIR)/.setup $(DL_DIR)/$(GCC_SOURCE)
- bzcat $(DL_DIR)/$(GCC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+$(GCC_DIR)/.unpacked: $(TOOL_BUILD_DIR)/.setup $(DL_DIR)/$(GCC_SOURCE)
+ bzcat $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(GCC_DIR)/.unpacked
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
@@ -245,7 +248,7 @@ $(GCC_DIR)/.gcc_build_hacks: $(GCC_DIR)/.patched
# # the step or libgcc will not build...
$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.gcc_build_hacks
mkdir -p $(GCC_BUILD_DIR1)
- (cd $(GCC_BUILD_DIR1); PATH=$(STAGING_DIR)/bin:$$PATH AR=$(ARCH)-uclibc-ar \
+ (cd $(GCC_BUILD_DIR1); AR=$(ARCH)-uclibc-ar \
RANLIB=$(ARCH)-uclibc-ranlib CC=$(HOSTCC) $(GCC_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--prefix=$(STAGING_DIR) \
@@ -267,13 +270,13 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.gcc_build_hacks
touch $(GCC_BUILD_DIR1)/.configured
$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
- PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) -C $(GCC_BUILD_DIR1) \
+ $(MAKE) -C $(GCC_BUILD_DIR1) \
AR_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ar \
RANLIB_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ranlib
touch $(GCC_BUILD_DIR1)/.compiled
$(GCC_BUILD_DIR1)/.installed: $(GCC_BUILD_DIR1)/.compiled
- PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) -C $(GCC_BUILD_DIR1) install;
+ $(MAKE) -C $(GCC_BUILD_DIR1) install;
#Cleanup then mess when --program-prefix mysteriously fails
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-cpp $(STAGING_DIR)/bin/$(ARCH)-uclibc-cpp
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gcc $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc
@@ -304,11 +307,11 @@ gcc_initial-dirclean:
$(DL_DIR)/$(UCLIBC_SOURCE):
$(WGET) -P $(DL_DIR) $(UCLIBC_SITE)/$(UCLIBC_SOURCE)
-$(UCLIBC_DIR)/.unpacked: $(BUILD_DIR)/.setup $(DL_DIR)/$(UCLIBC_SOURCE)
- bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+$(UCLIBC_DIR)/.unpacked: $(TOOL_BUILD_DIR)/.setup $(DL_DIR)/$(UCLIBC_SOURCE)
+ bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(UCLIBC_DIR)/.unpacked
-$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked $(BUILD_DIR)/linux/.configured
+$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked $(TOOL_BUILD_DIR)/linux/.configured
perl -i -p -e 's,^CROSS=.*,TARGET_ARCH=$(ARCH)\nCROSS=$(TARGET_CROSS),g' \
$(UCLIBC_DIR)/Rules.mak
cp $(SOURCE_DIR)/uClibc.config $(UCLIBC_DIR)/.config
@@ -369,7 +372,7 @@ uclibc-dirclean:
# the newly built shared uClibc library.
#
#############################################################
-GCC_BUILD_DIR2:=$(BUILD_DIR)/gcc-final
+GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-final
$(GCC_DIR)/.g++_build_hacks: $(GCC_DIR)/.patched
#
# Hack up the soname for libstdc++
@@ -395,7 +398,7 @@ $(GCC_DIR)/.g++_build_hacks: $(GCC_DIR)/.patched
$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.g++_build_hacks
mkdir -p $(GCC_BUILD_DIR2)
- (cd $(GCC_BUILD_DIR2); PATH=$(STAGING_DIR)/bin:$$PATH AR=$(TARGET_CROSS)ar \
+ (cd $(GCC_BUILD_DIR2); AR=$(TARGET_CROSS)ar \
RANLIB=$(TARGET_CROSS)ranlib LD=$(TARGET_CROSS)ld NM=$(TARGET_CROSS)nm \
CC=$(HOSTCC) $(GCC_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
@@ -423,14 +426,14 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.g++_build_hacks
touch $(GCC_BUILD_DIR2)/.configured
$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
- PATH=$(STAGING_DIR)/bin:$$PATH CC=$(HOSTCC) \
+ CC=$(HOSTCC) \
AR_FOR_TARGET=$(TARGET_CROSS)ar RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
LD_FOR_TARGET=$(TARGET_CROSS)ld NM_FOR_TARGET=$(TARGET_CROSS)nm \
CC_FOR_TARGET=$(TARGET_CROSS)gcc $(MAKE) -C $(GCC_BUILD_DIR2)
touch $(GCC_BUILD_DIR2)/.compiled
$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled
- PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) -C $(GCC_BUILD_DIR2) install;
+ $(MAKE) -C $(GCC_BUILD_DIR2) install;
touch $(GCC_BUILD_DIR2)/.installed
#Cleanup then mess when --program-prefix mysteriously fails
@@ -459,7 +462,7 @@ $(DL_DIR)/$(STLPORT_SOURCE):
$(WGET) -P $(DL_DIR) $(STLPORT_SITE)/$(STLPORT_SOURCE)
$(STLPORT_DIR)/Makefile: $(DL_DIR)/$(STLPORT_SOURCE) $(STLPORT_PATCH)
- zcat $(DL_DIR)/$(STLPORT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ zcat $(DL_DIR)/$(STLPORT_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
cat $(STLPORT_PATCH) | patch -d $(STLPORT_DIR) -p1
$(STLPORT_DIR)/lib/libstdc++.a: $(STLPORT_DIR)/Makefile
@@ -490,7 +493,7 @@ stlport-dirclean:
# Final cleanups....
#
#############################################################
-$(BUILD_DIR)/.shuffled: $(GCC_BUILD_DIR2)/.fixedup
+$(TOOL_BUILD_DIR)/.shuffled: $(GCC_BUILD_DIR2)/.fixedup
mkdir -p $(STAGING_DIR)/usr/bin;
(set -e; cd $(STAGING_DIR)/usr/bin; \
for i in $(STAGING_DIR)/bin/* ; do \
@@ -504,16 +507,19 @@ $(BUILD_DIR)/.shuffled: $(GCC_BUILD_DIR2)/.fixedup
k=`basename $$i| sed -e "s,$(ARCH)-uclibc-,,g"`; \
ln -fs ../../bin/$$j $$k; \
done)
- touch $(BUILD_DIR)/.shuffled
+ touch $(TOOL_BUILD_DIR)/.shuffled
-$(BUILD_DIR)/.stripped: $(BUILD_DIR)/.shuffled
+$(TOOL_BUILD_DIR)/.stripped: $(TOOL_BUILD_DIR)/.shuffled
# Strip the host binaries
-strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
# Strip the target shared libs
-$(STRIP) --strip-unneeded -R .note -R .comment $(STAGING_DIR)/lib/*.so*;
- touch $(BUILD_DIR)/.stripped
+ touch $(TOOL_BUILD_DIR)/.stripped
+
+$(STAGING_DIR)/bin/$(TARGET_CC): $(GCC_BUILD_DIR2)/.fixedup $(TOOL_BUILD_DIR)/.stripped $(STLPORT_TARGET)
+ cp --remove-destination -a $(STAGING_DIR) $(STAGING_DIR)
-gcc_final: uclibc $(GCC_BUILD_DIR2)/.fixedup $(BUILD_DIR)/.stripped $(STLPORT_TARGET)
+gcc_final: uclibc $(STAGING_DIR)/bin/$(TARGET_CC)
gcc_final-clean:
rm -rf $(GCC_BUILD_DIR2)