@ -119,8 +119,14 @@ MUSL_CC_FOR_TARGET ?= $(MUSL_TUPLE)-gcc
MUSL_CXX_FOR_TARGET ?= $( MUSL_TUPLE) -g++
CONFIGURE_HOST = @configure_host@
PREPARATION_STAMP := stamps/check-write-permission
all : @default_target @
i f e q ( @ e n a b l e _ h o s t _ g c c @ , - - e n a b l e - h o s t - g c c )
PREPARATION_STAMP += stamps/install-host-gcc
PATH := $( builddir) /install-host-gcc/bin:$( PATH)
GCC_CHECKING_FLAGS := $( GCC_CHECKING_FLAGS) --enable-werror-always
e n d i f
newlib : stamps /build -gcc -newlib -stage 2
linux : stamps /build -gcc -linux -stage 2
i f n e q ( , $( findstring riscv 32,$ ( MUSL_TUPLE ) ) )
@ -324,11 +330,25 @@ $(srcdir)/%/.git:
flock ` git rev-parse --git-dir` /config git submodule init $( dir $@ ) && \
flock ` git rev-parse --git-dir` /config git submodule update $( dir $@ )
stamps/install-host-gcc : $( GCC_SRCDIR ) $( GCC_SRC_GIT )
if test -f $</contrib/download_prerequisites && test "@NEED_GCC_EXTERNAL_LIBRARIES@" = "true" ; then cd $< && ./contrib/download_prerequisites; fi
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
cd $( notdir $@ ) && $</configure \
--prefix= $( builddir) /install-host-gcc \
@with_system_zlib@ \
--enable-languages= c,c++ \
--disable-bootstrap \
--disable-multilib
$( MAKE) -C $( notdir $@ )
$( MAKE) -C $( notdir $@ ) install
mkdir -p $( dir $@ ) && touch $@
#
# GLIBC
#
stamps/build-binutils-linux : $( BINUTILS_SRCDIR ) $( BINUTILS_SRC_GIT ) stamps /check -write -permission
stamps/build-binutils-linux : $( BINUTILS_SRCDIR ) $( BINUTILS_SRC_GIT ) $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
# CC_FOR_TARGET is required for the ld testsuite.
@ -351,7 +371,7 @@ stamps/build-binutils-linux: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamps/check
$( MAKE) -C $( notdir $@ ) install
mkdir -p $( dir $@ ) && touch $@
stamps/build-gdb-linux : $( GDB_SRCDIR ) $( GDB_SRC_GIT )
stamps/build-gdb-linux : $( GDB_SRCDIR ) $( GDB_SRC_GIT ) $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
# CC_FOR_TARGET is required for the ld testsuite.
@ -498,7 +518,7 @@ stamps/build-gcc-linux-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) $(addprefix stamps/b
cp -a $( INSTALL_DIR) /$( LINUX_TUPLE) /lib* $( SYSROOT)
mkdir -p $( dir $@ ) && touch $@
stamps/build-binutils-linux-native : $( BINUTILS_SRCDIR ) $( BINUTILS_SRC_GIT ) stamps /build -gcc -linux -stage 2 stamps /check -write -permission
stamps/build-binutils-linux-native : $( BINUTILS_SRCDIR ) $( BINUTILS_SRC_GIT ) stamps /build -gcc -linux -stage 2 $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
cd $( notdir $@ ) && $</configure \
@ -555,7 +575,7 @@ stamps/build-gcc-linux-native: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-gcc-lin
# NEWLIB
#
stamps/build-binutils-newlib : $( BINUTILS_SRCDIR ) $( BINUTILS_SRC_GIT ) stamps /check -write -permission
stamps/build-binutils-newlib : $( BINUTILS_SRCDIR ) $( BINUTILS_SRC_GIT ) $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
# CC_FOR_TARGET is required for the ld testsuite.
@ -575,7 +595,7 @@ stamps/build-binutils-newlib: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamps/chec
$( MAKE) -C $( notdir $@ ) install
mkdir -p $( dir $@ ) && touch $@
stamps/build-gdb-newlib : $( GDB_SRCDIR ) $( GDB_SRC_GIT )
stamps/build-gdb-newlib : $( GDB_SRCDIR ) $( GDB_SRC_GIT ) $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
# CC_FOR_TARGET is required for the ld testsuite.
@ -741,7 +761,7 @@ stamps/build-gcc-newlib-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-newlib
# MUSL
#
stamps/build-binutils-musl : $( BINUTILS_SRCDIR ) $( BINUTILS_SRC_GIT ) stamps /check -write -permission
stamps/build-binutils-musl : $( BINUTILS_SRCDIR ) $( BINUTILS_SRC_GIT ) $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
# CC_FOR_TARGET is required for the ld testsuite.
@ -870,7 +890,7 @@ stamps/build-gcc-musl-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-musl-lin
cp -a $( INSTALL_DIR) /$( MUSL_TUPLE) /lib* $( SYSROOT)
mkdir -p $( dir $@ ) && touch $@
stamps/build-spike : $( SPIKE_SRCDIR ) $( SPIKE_SRC_GIT )
stamps/build-spike : $( SPIKE_SRCDIR ) $( SPIKE_SRC_GIT ) $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
cd $( notdir $@ ) && $</configure \
@ -906,7 +926,7 @@ stamps/build-pk64: $(PK_SRCDIR) $(PK_SRC_GIT) stamps/build-gcc-newlib-stage2
mkdir -p $( dir $@ )
date > $@
stamps/build-qemu : $( QEMU_SRCDIR ) $( QEMU_SRC_GIT )
stamps/build-qemu : $( QEMU_SRCDIR ) $( QEMU_SRC_GIT ) $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
cd $( notdir $@ ) && $</configure \
@ -971,7 +991,7 @@ stamps/build-llvm-newlib: $(LLVM_SRCDIR) $(LLVM_SRC_GIT) stamps/build-gcc-newlib
ln -s -f clang++ $( NEWLIB_TUPLE) -clang++
mkdir -p $( dir $@ ) && touch $@
stamps/build-dejagnu : $( DEJAGNU_SRCDIR ) $( DEJAGNU_SRC_GIT )
stamps/build-dejagnu : $( DEJAGNU_SRCDIR ) $( DEJAGNU_SRC_GIT ) $( PREPARATION_STAMP )
rm -rf $@ $( notdir $@ )
mkdir $( notdir $@ )
cd $( notdir $@ ) && $</configure \
@ -1101,7 +1121,7 @@ report-binutils-linux: stamps/check-binutils-linux
` find build-binutils-linux/ -name *.sum | paste -sd "," -`
clean :
rm -rf build-* stamps install-newlib-nano
rm -rf build-* install-* stamps install-newlib-nano
.PHONY : report -gdb -newlib report -gdb -newlib -nano
report-gdb-newlib : stamps /check -gdb -newlib