Improve the process for GNU tools

Split the process to fetch GNU tools (until now embedded
within tools/Makefile.gnuhost) into a new Makefile.fetchgnu,
MINIX-specific hence relocated, which is to be also used
to fetch sources even when not building the tools.
Use it for binutils too.
Improve documentation.

Also do not run configure on each run when MKUPDATE=yes
The .WAIT serialization instruction between fetching and other
configure sources was raising a new run of configure at each
compilation. Avoid it by using two rules.

Change-Id: Ie24950ccbb5c5067f3c1ea57b7bd8294e4c9445e
This commit is contained in:
Antoine Leca
2016-08-29 13:48:31 +02:00
committed by Lionel Sambuc
parent 76c7f3dac9
commit a150b26ee8
9 changed files with 126 additions and 49 deletions

View File

@@ -27,27 +27,7 @@ MAKE_PROGRAM?= ${MAKE}
GNUHOSTDIST?= ${.CURDIR}/../../gnu/dist/${MODULE}
.if defined(__MINIX)
# AL - MINIX /usr/src does not have the sources for the GNU utilities
# in-tree (they are much bigger than Minix itself!) So to successfully
# use them while cross-compiling, we have to fetch them. The success of
# that operation is indicated by the presence of a .gitignore file in
# the corresponding ${.CURDIR}, which also conveniently hides from git.
.if exists(${GNUHOSTDIST:H}/fetch.sh)
${GNUHOSTDIST:H}/.gitignore: ${GNUHOSTDIST:H}/fetch.sh
SED=${TOOL_SED} ${HOST_SH} ${GNUHOSTDIST:H}/fetch.sh
@test -e ${GNUHOSTDIST}/configure
@echo "${MODULE:U${.CURDIR:T}:C,gcc[0-9]*,gcc,:C,gmake*,make,}-*.tar.*z*" >> $@
@echo ${GNUHOSTDIST:T} >> $@
_gnu_get_src=${GNUHOSTDIST:H}/.gitignore
.endif # exists(GNUHOSTDIST:H/fetch.sh) on MINIX
# AL - Special target for MINIX, reset the source tree as pristine
.if ${CLEANFETCHED:Uno} == "yes" && exists(${GNUHOSTDIST:H}/fetch.sh)
cleandir: clean_gnu_src
clean_gnu_src:
-rm -r -f ${GNUHOSTDIST} ${GNUHOSTDIST:H}/.gitignore
# XXX CHECKME: could have used the content of .gitignore as well?
.endif # CLEANFETCHED == yes
.include "../minix/Makefile.fetchgnu"
.endif # defined(__MINIX)
FIND_ARGS+= \! \( -type d \( \
@@ -134,7 +114,7 @@ configure_cleanup=configure_cleanup
.endif
# AL For MINIX, fetch the source if not there
.configure_done: ${_gnu_get_src} .WAIT ${_GNU_CFGSRC} ${.CURDIR}/Makefile ${configure_cleanup}
.configure_done: ${fetch_done} ${_GNU_CFGSRC} ${.CURDIR}/Makefile ${configure_cleanup}
@mkdir build 2>/dev/null || true
@(cd build && ${CONFIGURE_ENV} ${HOST_SH} ${GNUHOSTDIST}/configure ${CONFIGURE_ARGS})
@echo ${BUILD_PLATFORM} > $@

View File

@@ -16,12 +16,15 @@ CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
--disable-werror \
${BRANDING}
.if !defined(__MINIX)
build/gas/m68k-parse.c: ${GNUHOSTDIST}/gas/m68k-parse.c
.else
.if defined(__MINIX) && ! exists(${GNUHOSTDIST}/gas/m68k-parse.c)
# MINIX: LSC: Make sure we trigger the fetch rule
build/gas/m68k-parse.c: ${GNUHOSTDIST:H}/.gitignore .WAIT ${GNUHOSTDIST}/gas/m68k-parse.c
.endif # !defined(__MINIX)
.include "${.CURDIR}/../../minix/Makefile.fetchgnu"
${GNUHOSTDIST}/gas/m68k-parse.c: ${fetch_done}
@true
.endif # defined(__MINIX)
build/gas/m68k-parse.c: ${GNUHOSTDIST}/gas/m68k-parse.c
@mkdir build 2>/dev/null || true
@mkdir build/gas 2>/dev/null || true
cat ${GNUHOSTDIST}/gas/m68k-parse.c > ${.TARGET}