X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=lfs%2Fcleanup-toolchain;h=91e056ed8348aafac07054824d988913204c47f5;hb=a158a5a62d70a1b1928d62a4ed479b068997b455;hp=0b3252f9f4f23185f2696d32e88d1ad543f7f718;hpb=0d3e1e8c1da5b0ae9e56ac320be02bdb043485d4;p=ipfire-2.x.git diff --git a/lfs/cleanup-toolchain b/lfs/cleanup-toolchain index 0b3252f9f4..91e056ed83 100644 --- a/lfs/cleanup-toolchain +++ b/lfs/cleanup-toolchain @@ -27,7 +27,12 @@ include Config VER = ipfire THISAPP = cleanup-toolchain -TARGET = $(DIR_INFO)/$(THISAPP)-$(PASS)-tools + +ifeq "$(TOOLCHAIN)" "1" + TARGET = $(DIR_INFO)/$(THISAPP)-tools +else + TARGET = $(DIR_INFO)/$(THISAPP) +endif GCC_VER = 4.1.2 @@ -51,14 +56,8 @@ md5 : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) -ifeq "$(PASS)" "1" - SPECS=$$(dirname $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name))/specs; \ - /tools/bin/$(CROSSTARGET)-gcc -dumpspecs | sed \ - -e 's@/lib\(64\)\?/ld@/tools&@g' \ - -e "/^\*cpp:$$/{n;s,$$, -isystem /tools/include,}" > $$SPECS -endif -ifeq "$(PASS)" "2" +ifeq "$(TOOLCHAIN)" "1" # Remove the first cross compiler which is not needed anymore. find /tools/ -name "$(CROSSTARGET)*" | xargs rm -rfv @@ -73,9 +72,10 @@ ifeq "$(PASS)" "2" # Update/create linker cache. /tools/sbin/ldconfig -endif -ifeq "$(PASS)" "3" + # Set a marker when the toolchain was successfully built + touch /tools/.toolchain-successful +else mv -v /tools/bin/{ld,ld-old} mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old} mv -v /tools/bin/{ld-new,ld} @@ -87,4 +87,5 @@ ifeq "$(PASS)" "3" -e '/\*cpp:/{n;s@$$@ -isystem /usr/include@}' > \ $$(dirname $$(gcc -print-libgcc-file-name))/specs endif + @$(POSTBUILD)