]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Cleanup makefiles by using the new TOOLCHAIN variable
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Apr 2017 18:27:32 +0000 (20:27 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 18 May 2017 11:00:19 +0000 (12:00 +0100)
No functional changes

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/gcc
lfs/linux
make.sh

diff --git a/lfs/gcc b/lfs/gcc
index 3b0d8d5c3e03ae0ed2e583ffc990b9e9c1f63628..82a6732b285a935968d07e68b0e7113487cec476 100644 (file)
--- a/lfs/gcc
+++ b/lfs/gcc
@@ -207,7 +207,12 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
        @mkdir $(DIR_SRC)/gcc-build
 
-ifneq "$(ROOT)" ""
+       cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
+       cd $(DIR_APP) && sed -i gcc/Makefile.in \
+               -e 's@\./fixinc\.sh@-c true@' \
+               -e 's/^T_CFLAGS =$$/& -fomit-frame-pointer/'
+
+ifeq "$(TOOLCHAIN)" "1"
        # Build gmp and mpfr internally in toolchain.
        cd $(DIR_APP) && tar xfa $(DIR_DL)/gmp-$(GMP_VER).tar.bz2
        cd $(DIR_APP) && mv -v gmp-$(GMP_VER) gmp
@@ -216,23 +221,11 @@ ifneq "$(ROOT)" ""
        cd $(DIR_APP) && tar xfa $(DIR_DL)/mpc-$(MPC_VER).tar.gz
        cd $(DIR_APP) && mv -v mpc-$(MPC_VER) mpc
 
-ifeq    "$(PASS)" "1"
-       for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \
-                       -o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h -o -name aarch64-linux.h); do \
-               echo "Processing $${file}..."; \
-               sed -i $${file} \
-                       -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-                       -e 's@/usr@/tools@g'; \
-               echo '#undef STANDARD_STARTFILE_PREFIX_1' >> $${file}; \
-               echo '#undef STANDARD_STARTFILE_PREFIX_2' >> $${file}; \
-               echo '#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"' >> $${file}; \
-               echo '#define STANDARD_STARTFILE_PREFIX_2 ""' >> $${file}; \
-       done
-endif
-
-ifeq    "$(PASS)" "2"
+ifeq "$(PASS)" "2"
        cd $(DIR_APP) && cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
                        `dirname $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name)`/include-fixed/limits.h
+endif
+
        for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \
                        -o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h -o -name aarch64-linux.h); do \
                echo "Processing $${file}..."; \
@@ -244,15 +237,9 @@ ifeq    "$(PASS)" "2"
                echo '#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"' >> $${file}; \
                echo '#define STANDARD_STARTFILE_PREFIX_2 ""' >> $${file}; \
        done
-endif
 endif
 
-       cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
-       cd $(DIR_APP) && sed -i gcc/Makefile.in \
-               -e 's@\./fixinc\.sh@-c true@' \
-               -e 's/^T_CFLAGS =$$/& -fomit-frame-pointer/'
-
-ifeq    "$(PASS)" "L"
+ifeq "$(PASS)" "L"
        # libstdc++ pass
        cd $(DIR_SRC)/gcc-build && \
                $(EXTRA_ENV) \
@@ -261,8 +248,6 @@ ifeq    "$(PASS)" "L"
        cd $(DIR_SRC)/gcc-build && make $(EXTRA_MAKE)
        cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
 
-       # Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70936
-       sed -e "s/^#include_next/#include/" -i /tools/$(CROSSTARGET)/include/c++/$(VER)/cstdlib
 else
        # The actual build.
        cd $(DIR_SRC)/gcc-build && \
@@ -273,19 +258,28 @@ else
        cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
 endif
 
-ifeq "$(ROOT)" ""
-       ln -svf ../usr/bin/cpp /lib
-       ln -svf gcc /usr/bin/cc
-       # remove gdb python files from libdir
-       rm -rf /usr/lib/*-gdb.py
-else
-ifeq    "$(PASS)" "1"
+ifeq "$(TOOLCHAIN)" "1"
+ ifeq "$(PASS)" "1"
        ln -svf libgcc.a $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/')
-else
+ endif
+
+ ifeq "$(PASS)" "2"
        ln -svf gcc /tools/bin/cc
        # remove gdb python files from libdir
        rm -rf /tools/lib/*-gdb.py
+ endif
+
+ ifeq "$(PASS)" "L"
+       # Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70936
+       sed -e "s/^#include_next/#include/" -i /tools/$(CROSSTARGET)/include/c++/$(VER)/cstdlib
+ endif
+
+else # NON-TOOLCHAIN
+       ln -svf ../usr/bin/cpp /lib
+       ln -svf gcc /usr/bin/cc
+       # remove gdb python files from libdir
+       rm -rf /usr/lib/*-gdb.py
 endif
-endif
+
        @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build
        @$(POSTBUILD)
index 3c85a23bad155d0700b04ed85952f3e99a709bc9..ec005550f1d4ac8e4b6afd12a6a26288df2f1ee0 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
@@ -48,7 +48,7 @@ endif
 
 VERSUFIX=ipfire$(KCFG)
 
-ifeq "$(TOOLS)" "1"
+ifeq "$(TOOLCHAIN)" "1"
        TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)-tools
        HEADERS_PREFIX = /tools
 else
diff --git a/make.sh b/make.sh
index e8af68a2ccf42d2944fca3c9c361041383e0b959..5c290d54f780be42a9477e1133a56a7b9777f92b 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -282,7 +282,7 @@ buildtoolchain() {
     lfsmake1 ccache                    PASS=1
     lfsmake1 binutils                  PASS=1
     lfsmake1 gcc                       PASS=1
-    lfsmake1 linux                     TOOLS=1 KCFG="-headers"
+    lfsmake1 linux                     KCFG="-headers"
     lfsmake1 glibc
     lfsmake1 cleanup-toolchain         PASS=1
     lfsmake1 gcc                       PASS=L