Update toolchains a bit forther so that after blowing away the 'build'

directory we do not need to rebuild the toolchain (which now is built under
'toolchain_build').  Should help prevent a bunch of unnecessary toolchain
rebuilds.
 -Erik
This commit is contained in:
Eric Andersen 2003-02-12 10:39:09 +00:00
parent de2ae8dcf3
commit d4ef2a6a25
2 changed files with 123 additions and 126 deletions

View File

@ -72,7 +72,7 @@ GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-3.2.2
# Setup some initial paths
#
#############################################################
$(TOOL_BUILD_DIR)/.setup:
$(STAGING_DIR)/.setup:
mkdir -p $(TOOL_BUILD_DIR)
mkdir -p $(DL_DIR)
mkdir -p $(STAGING_DIR)
@ -85,7 +85,7 @@ $(TOOL_BUILD_DIR)/.setup:
(cd $(STAGING_DIR)/$(GNU_TARGET_NAME); ln -fs ../include)
(cd $(STAGING_DIR)/$(GNU_TARGET_NAME); ln -fs ../include sys-include)
(cd $(STAGING_DIR)/usr/lib; ln -fs ../../lib/gcc-lib)
touch $(TOOL_BUILD_DIR)/.setup
touch $(STAGING_DIR)/.setup
#############################################################
@ -110,7 +110,7 @@ BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-build
$(DL_DIR)/$(BINUTILS_SOURCE):
$(WGET) -P $(DL_DIR) $(BINUTILS_SITE)/$(BINUTILS_SOURCE)
$(BINUTILS_DIR)/.unpacked: $(TOOL_BUILD_DIR)/.setup $(DL_DIR)/$(BINUTILS_SOURCE)
$(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
bzcat $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(BINUTILS_DIR)/.unpacked
@ -197,7 +197,7 @@ GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-initial
$(DL_DIR)/$(GCC_SOURCE):
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
$(GCC_DIR)/.unpacked: $(TOOL_BUILD_DIR)/.setup $(DL_DIR)/$(GCC_SOURCE)
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
zcat $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(GCC_DIR)/.unpacked
@ -301,7 +301,7 @@ gcc_initial-dirclean:
$(DL_DIR)/$(UCLIBC_SOURCE):
$(WGET) -P $(DL_DIR) $(UCLIBC_SITE)/$(UCLIBC_SOURCE)
$(UCLIBC_DIR)/.unpacked: $(TOOL_BUILD_DIR)/.setup $(DL_DIR)/$(UCLIBC_SOURCE)
$(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
touch $(UCLIBC_DIR)/.unpacked
@ -458,7 +458,7 @@ $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++: $(GCC_BUILD_DIR2)/.compiled
fi; \
done;
gcc_final: binutils gcc_initial uclibc $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++
gcc_final: $(STAGING_DIR)/.setup binutils gcc_initial uclibc $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++
gcc_final-clean:
rm -rf $(GCC_BUILD_DIR2)

View File

@ -26,7 +26,7 @@ ifeq ($(GCC_2_95_TOOLCHAIN),true)
#
#############################################################
#Directory in which to build the toolchain
TOOL_BUILD_DIR:=$(BASE_DIR)/toolchain_build
TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build
TARGET_LANGUAGES:=c,c++
@ -52,11 +52,11 @@ BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-2.13.2.1
ifeq ($(USE_UCLIBC_SNAPSHOT),true)
# Be aware that this changes daily....
UCLIBC_DIR=$(TOOL_BUILD_DIR)/uClibc
UCLIBC_DIR=$(BUILD_DIR)/uClibc
UCLIBC_SOURCE=uClibc-snapshot.tar.bz2
UCLIBC_SITE:=http://www.uclibc.org/downloads/snapshots
else
UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc-0.9.17
UCLIBC_DIR:=$(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
@ -86,11 +86,12 @@ $(TOOL_BUILD_DIR)/.setup:
mkdir -p $(STAGING_DIR)
mkdir -p $(STAGING_DIR)/include
mkdir -p $(STAGING_DIR)/lib/gcc-lib
mkdir -p $(STAGING_DIR)/usr/lib
mkdir -p $(STAGING_DIR)/usr/bin;
mkdir -p $(STAGING_DIR)/$(GNU_TARGET_NAME)/
(cd $(STAGING_DIR)/$(GNU_TARGET_NAME); ln -fs ../lib)
(cd $(STAGING_DIR)/$(GNU_TARGET_NAME); ln -fs ../include)
(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 $(TOOL_BUILD_DIR)/.setup
@ -142,7 +143,8 @@ $(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
mkdir -p $(BINUTILS_DIR1)
(cd $(BINUTILS_DIR1); CC=$(HOSTCC) $(BINUTILS_DIR)/configure \
(cd $(BINUTILS_DIR1); CC=$(HOSTCC) \
$(BINUTILS_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--prefix=$(STAGING_DIR) \
--exec-prefix=$(STAGING_DIR) \
@ -167,6 +169,20 @@ $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin/ld: $(BINUTILS_DIR1)/binutils/objdump
$(MAKE) -C $(BINUTILS_DIR1) install
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
mkdir -p $(STAGING_DIR)/usr/bin;
set -e; \
for app in addr2line ar as c++filt gprof ld nm objcopy \
objdump ranlib readelf size strings strip ; \
do \
if [ -x $(STAGING_DIR)/bin/$(ARCH)-uclibc-$${app} ] ; then \
(cd $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin; \
ln -fs ../../bin/$(ARCH)-uclibc-$${app} $${app}; \
); \
(cd $(STAGING_DIR)/usr/bin; \
ln -fs ../../bin/$(ARCH)-uclibc-$${app} $${app}; \
); \
fi; \
done;
$(STAGING_DIR)/lib/libg.a:
$(STAGING_DIR)/$(GNU_TARGET_NAME)/bin/ar rv $(STAGING_DIR)/lib/libg.a;
@ -249,7 +265,8 @@ $(GCC_DIR)/.gcc_build_hacks: $(GCC_DIR)/.patched
$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.gcc_build_hacks
mkdir -p $(GCC_BUILD_DIR1)
(cd $(GCC_BUILD_DIR1); AR=$(ARCH)-uclibc-ar \
RANLIB=$(ARCH)-uclibc-ranlib CC=$(HOSTCC) $(GCC_DIR)/configure \
RANLIB=$(ARCH)-uclibc-ranlib CC=$(HOSTCC) \
$(GCC_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--prefix=$(STAGING_DIR) \
--exec-prefix=$(STAGING_DIR) \
@ -275,7 +292,7 @@ $(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
RANLIB_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ranlib
touch $(GCC_BUILD_DIR1)/.compiled
$(GCC_BUILD_DIR1)/.installed: $(GCC_BUILD_DIR1)/.compiled
$(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc: $(GCC_BUILD_DIR1)/.compiled
$(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
@ -283,9 +300,8 @@ $(GCC_BUILD_DIR1)/.installed: $(GCC_BUILD_DIR1)/.compiled
rm -f $(STAGING_DIR)/bin/gccbug $(STAGING_DIR)/bin/gcov
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
touch $(GCC_BUILD_DIR1)/.installed
gcc_initial: binutils $(UCLIBC_DIR)/.configured $(GCC_BUILD_DIR1)/.installed
gcc_initial: binutils $(UCLIBC_DIR)/.configured $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc
gcc_initial-clean:
rm -rf $(GCC_BUILD_DIR1)
@ -308,10 +324,10 @@ $(DL_DIR)/$(UCLIBC_SOURCE):
$(WGET) -P $(DL_DIR) $(UCLIBC_SITE)/$(UCLIBC_SOURCE)
$(UCLIBC_DIR)/.unpacked: $(TOOL_BUILD_DIR)/.setup $(DL_DIR)/$(UCLIBC_SOURCE)
bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
touch $(UCLIBC_DIR)/.unpacked
$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked $(TOOL_BUILD_DIR)/linux/.configured
$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked $(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
@ -349,11 +365,13 @@ $(TARGET_DIR)/lib/libc.so.0: $(STAGING_DIR)/lib/libc.a
$(TARGET_DIR)/usr/bin/ldd: $(TARGET_DIR)/lib/libc.so.0
$(MAKE) -C $(UCLIBC_DIR) PREFIX=$(TARGET_DIR) install_target_utils
(cd $(TARGET_DIR)/sbin; ln -s /bin/true ldconfig)
UCLIBC_TARGETS=$(TARGET_DIR)/lib/libc.so.0 $(TARGET_DIR)/usr/bin/ldd
endif
uclibc: gcc_initial $(STAGING_DIR)/lib/libc.a $(UCLIBC_TARGETS)
uclibc: $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc $(STAGING_DIR)/lib/libc.a \
$(UCLIBC_TARGETS)
uclibc-clean:
-$(MAKE) -C $(UCLIBC_DIR) clean
@ -366,92 +384,6 @@ uclibc-dirclean:
#############################################################
#
# second pass compiler build. Build the compiler targeting
# the newly built shared uClibc library.
#
#############################################################
GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-final
$(GCC_DIR)/.g++_build_hacks: $(GCC_DIR)/.patched
#
# Hack up the soname for libstdc++
#
#perl -i -p -e "s,\.so\.1,.so.0.9.9,g;" $(GCC_DIR)/gcc/config/t-slibgcc-elf-ver;
#perl -i -p -e "s,-version-info.*[0-9]:[0-9]:[0-9],-version-info 9:9:0,g;" \
# $(GCC_DIR)/libstdc++-v3/src/Makefile.am $(GCC_DIR)/libstdc++-v3/src/Makefile.in;
#perl -i -p -e "s,3\.0\.0,9.9.0,g;" $(GCC_DIR)/libstdc++-v3/acinclude.m4 \
# $(GCC_DIR)/libstdc++-v3/aclocal.m4 $(GCC_DIR)/libstdc++-v3/configure;
#
# For now, we don't support locale-ified ctype (we will soon),
# so bypass that problem for now...
#
#perl -i -p -e "s,defined.*_GLIBCPP_USE_C99.*,1,g;" \
# $(GCC_DIR)/libstdc++-v3/config/locale/generic/c_locale.cc;
#cp $(GCC_DIR)/libstdc++-v3/config/os/generic/bits/ctype_base.h \
# $(GCC_DIR)/libstdc++-v3/config/os/gnu-linux/bits/
#cp $(GCC_DIR)/libstdc++-v3/config/os/generic/bits/ctype_inline.h \
# $(GCC_DIR)/libstdc++-v3/config/os/gnu-linux/bits/
#cp $(GCC_DIR)/libstdc++-v3/config/os/generic/bits/ctype_noninline.h \
# $(GCC_DIR)/libstdc++-v3/config/os/gnu-linux/bits/
touch $(GCC_DIR)/.g++_build_hacks
$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.g++_build_hacks
mkdir -p $(GCC_BUILD_DIR2)
(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) \
--prefix=$(STAGING_DIR) \
--exec-prefix=$(STAGING_DIR) \
--bindir=$(STAGING_DIR)/bin \
--sbindir=$(STAGING_DIR)/sbin \
--sysconfdir=$(STAGING_DIR)/etc \
--datadir=$(STAGING_DIR)/share \
--localstatedir=$(STAGING_DIR)/var \
--mandir=$(STAGING_DIR)/man \
--infodir=$(STAGING_DIR)/info \
--with-local-prefix=$(STAGING_DIR)/usr/local \
--libdir=$(STAGING_DIR)/lib \
--includedir=$(STAGING_DIR)/include \
--with-gxx-include-dir=$(STAGING_DIR)/include/c++ \
--oldincludedir=$(STAGING_DIR)/include \
--enable-shared $(MULTILIB) \
--enable-target-optspace --disable-nls \
--with-gnu-ld --disable-__cxa_atexit \
--enable-languages=$(TARGET_LANGUAGES) \
$(EXTRA_GCC_CONFIG_OPTIONS) \
--program-prefix=$(ARCH)-uclibc- \
);
touch $(GCC_BUILD_DIR2)/.configured
$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
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
$(MAKE) -C $(GCC_BUILD_DIR2) install;
touch $(GCC_BUILD_DIR2)/.installed
#Cleanup then mess when --program-prefix mysteriously fails
$(GCC_BUILD_DIR2)/.fixedup: $(GCC_BUILD_DIR2)/.installed
-mv $(STAGING_DIR)/bin/gcc $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin;
-mv $(STAGING_DIR)/bin/protoize $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin;
-mv $(STAGING_DIR)/bin/unprotoize $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin;
-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
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++ $(STAGING_DIR)/bin/$(ARCH)-uclibc-c++
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-g++ $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++filt $(STAGING_DIR)/bin/$(ARCH)-uclibc-c++filt
rm -f $(STAGING_DIR)/bin/cpp $(STAGING_DIR)/bin/gcov $(STAGING_DIR)/bin/*gccbug
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
touch $(GCC_BUILD_DIR2)/.fixedup
#############################################################
#
# STLport -- an alternative C++ library
@ -490,36 +422,101 @@ stlport-dirclean:
#############################################################
#
# Final cleanups....
# second pass compiler build. Build the compiler targeting
# the newly built shared uClibc library.
#
#############################################################
$(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 \
j=`basename $$i`; \
k=`basename $$i| sed -e "s,$(ARCH)-uclibc-,,g"`; \
ln -fs ../../bin/$$j $$k; \
done)
(set -e; cd $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin; \
for i in $(STAGING_DIR)/bin/* ; do \
j=`basename $$i`; \
k=`basename $$i| sed -e "s,$(ARCH)-uclibc-,,g"`; \
ln -fs ../../bin/$$j $$k; \
done)
touch $(TOOL_BUILD_DIR)/.shuffled
GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-final
$(GCC_DIR)/.g++_build_hacks: $(GCC_DIR)/.patched
#
# Hack up the soname for libstdc++
#
#perl -i -p -e "s,\.so\.1,.so.0.9.9,g;" $(GCC_DIR)/gcc/config/t-slibgcc-elf-ver;
#perl -i -p -e "s,-version-info.*[0-9]:[0-9]:[0-9],-version-info 9:9:0,g;" \
# $(GCC_DIR)/libstdc++-v3/src/Makefile.am $(GCC_DIR)/libstdc++-v3/src/Makefile.in;
#perl -i -p -e "s,3\.0\.0,9.9.0,g;" $(GCC_DIR)/libstdc++-v3/acinclude.m4 \
# $(GCC_DIR)/libstdc++-v3/aclocal.m4 $(GCC_DIR)/libstdc++-v3/configure;
#
# For now, we don't support locale-ified ctype (we will soon),
# so bypass that problem for now...
#
#perl -i -p -e "s,defined.*_GLIBCPP_USE_C99.*,1,g;" \
# $(GCC_DIR)/libstdc++-v3/config/locale/generic/c_locale.cc;
#cp $(GCC_DIR)/libstdc++-v3/config/os/generic/bits/ctype_base.h \
# $(GCC_DIR)/libstdc++-v3/config/os/gnu-linux/bits/
#cp $(GCC_DIR)/libstdc++-v3/config/os/generic/bits/ctype_inline.h \
# $(GCC_DIR)/libstdc++-v3/config/os/gnu-linux/bits/
#cp $(GCC_DIR)/libstdc++-v3/config/os/generic/bits/ctype_noninline.h \
# $(GCC_DIR)/libstdc++-v3/config/os/gnu-linux/bits/
touch $(GCC_DIR)/.g++_build_hacks
$(TOOL_BUILD_DIR)/.stripped: $(TOOL_BUILD_DIR)/.shuffled
$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.g++_build_hacks
mkdir -p $(GCC_BUILD_DIR2)
(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) \
--prefix=$(STAGING_DIR) \
--exec-prefix=$(STAGING_DIR) \
--bindir=$(STAGING_DIR)/bin \
--sbindir=$(STAGING_DIR)/sbin \
--sysconfdir=$(STAGING_DIR)/etc \
--datadir=$(STAGING_DIR)/share \
--localstatedir=$(STAGING_DIR)/var \
--mandir=$(STAGING_DIR)/man \
--infodir=$(STAGING_DIR)/info \
--with-local-prefix=$(STAGING_DIR)/usr/local \
--libdir=$(STAGING_DIR)/lib \
--includedir=$(STAGING_DIR)/include \
--with-gxx-include-dir=$(STAGING_DIR)/include/c++ \
--oldincludedir=$(STAGING_DIR)/include \
--enable-shared $(MULTILIB) \
--enable-target-optspace --disable-nls \
--with-gnu-ld --disable-__cxa_atexit \
--enable-languages=$(TARGET_LANGUAGES) \
$(EXTRA_GCC_CONFIG_OPTIONS) \
--program-prefix=$(ARCH)-uclibc- \
);
touch $(GCC_BUILD_DIR2)/.configured
$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
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
touch $(GCC_BUILD_DIR2)/.installed
$(STAGING_DIR)/bin/$(ARCH)-uclibc-g++: $(GCC_BUILD_DIR2)/.compiled
$(MAKE) -C $(GCC_BUILD_DIR2) install;
-mv $(STAGING_DIR)/bin/gcc $(STAGING_DIR)/usr/bin;
-mv $(STAGING_DIR)/bin/protoize $(STAGING_DIR)/usr/bin;
-mv $(STAGING_DIR)/bin/unprotoize $(STAGING_DIR)/usr/bin;
-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
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++ $(STAGING_DIR)/bin/$(ARCH)-uclibc-c++
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-g++ $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++filt $(STAGING_DIR)/bin/$(ARCH)-uclibc-c++filt
rm -f $(STAGING_DIR)/bin/cpp $(STAGING_DIR)/bin/gcov $(STAGING_DIR)/bin/*gccbug
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
# 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 $(TOOL_BUILD_DIR)/.stripped
set -e;
for app in cc gcc c89 cpp c++ g++ ; do \
if [ -x $(STAGING_DIR)/bin/$(ARCH)-uclibc-$${app} ] ; then \
(cd $(STAGING_DIR)/usr/bin; \
ln -fs ../../bin/$(ARCH)-uclibc-$${app} $${app}; \
); \
fi; \
done;
$(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 $(STAGING_DIR)/bin/$(TARGET_CC)
gcc_final: binutils gcc_initial uclibc $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++ $(STLPORT_TARGET)
gcc_final-clean:
rm -rf $(GCC_BUILD_DIR2)