]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - lfs/cleanup-toolchain
cmake: update to 3.8.1
[ipfire-2.x.git] / lfs / cleanup-toolchain
index e904bca87a79fb05172da16a0d90205309824d38..91e056ed8348aafac07054824d988913204c47f5 100644 (file)
@@ -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,7 +56,8 @@ md5 :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-ifeq "$(PASS)" "1"
+
+ifeq "$(TOOLCHAIN)" "1"
        # Remove the first cross compiler which is not needed anymore.
        find /tools/ -name "$(CROSSTARGET)*" | xargs rm -rfv
 
@@ -66,9 +72,10 @@ ifeq "$(PASS)" "1"
 
        # Update/create linker cache.
        /tools/sbin/ldconfig
-endif
 
-ifeq "$(PASS)" "2"
+       # 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}
@@ -80,4 +87,5 @@ ifeq "$(PASS)" "2"
                -e '/\*cpp:/{n;s@$$@ -isystem /usr/include@}' > \
                $$(dirname $$(gcc -print-libgcc-file-name))/specs
 endif
+
        @$(POSTBUILD)