diff --git a/dump-commands.xsl b/dump-commands.xsl index 393b7b4..40ea810 100644 --- a/dump-commands.xsl +++ b/dump-commands.xsl @@ -61,7 +61,9 @@ + not(contains(string(),'EOF')) and + not(contains(string(),'check')) and + not(ancestor::sect1[@id='ch-tools-stripping'])"> && @@ -71,12 +73,12 @@ - make -k - && + diff --git a/jhalfs b/jhalfs index 0095f68..f53667e 100755 --- a/jhalfs +++ b/jhalfs @@ -22,8 +22,9 @@ Options: DIR/jhalfs -D, --download-client=CLIENT use CLIENT as the program for retrieving packages - -T, --no-testsuites don't run the package's testsuites - -P, --have-packages don't download the packages + -T, --testsuites run the optional testsuites + -P, --get-packages download the packages + -M, --run-make run make on the generated Makefile " help="\ @@ -79,18 +80,21 @@ while test $# -gt 0 ; do shift ;; - --no-testsuites | -T ) - shift + --testsuites | -T ) TEST=1 shift ;; - --have-packages | -P ) - shift + --get-packages | -P ) HPKG=1 shift ;; + --run-make | -M ) + RUNMAKE=1 + shift + ;; + * ) echo "$usage" exit 1 @@ -230,7 +234,7 @@ download() { get_sources() { # Test if the packages must be downloaded - if [ -z $HPKG ] ; then + if [ "$HPKG" = "1" ] ; then # This variable is necessary to make sure the `cat $JHALFSDIR/packages` # separates each iteration by lines. It is necessary to have the second @@ -309,8 +313,8 @@ build_Makefile() { echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp fi - # Dump the path to the Binutils and TCL sources - if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then + # Dump the path to the Binutils or TCL sources directory. + if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" -o "$i" = "036-binutils-pass2" ] ; then echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp fi @@ -319,7 +323,7 @@ build_Makefile() { # For the Adjusting phase we must to cd to the binutils-build directory. if [ "$i" = "031-adjusting" ] ; then - echo -e "\techo \"PKGDIR=\`cat sources-dir\`\" > envars && \\" >> $MKFILE.tmp + echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp fi @@ -340,33 +344,37 @@ build_Makefile() { echo -e "\ttouch \$@" >> $MKFILE.tmp # Remove the build directory(ies) even if the package build fails, except for - # Binutils pass1 and TCL. In that cases the sources directories are removed + # Binutils and TCL. In that cases the sources directories are removed # only if the build fails. if [ "$vrs" != "" ] ; then - if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] ; then + if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] && [ "$i" != "036-binutils-pass2" ] ; then echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp - echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp - echo -e "\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp + echo -e "\tif [ -e \$(LFS)\$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp + echo -e "\t\trm -r \$(LFS)\$(SRC)/$name-build; \\" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp fi fi - if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then + if [ "$i" = "027-binutils-pass1" -o "$i" = "036-binutils-pass2" ] ; then echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp echo -e "\t\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp - echo -e "\t\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp - echo -e "\t\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp - echo -e "\t\tfi;" >> $MKFILE.tmp + echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build; \\" >> $MKFILE.tmp + echo -e "\tfi;" >> $MKFILE.tmp + fi + if [ "$i" = "032-tcl" ] ; then + echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp + echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp + echo -e "\t\trm -r \$(LFS)\$(SRC)/\$\$ROOT; \\" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp fi - # Remove the Binutils sources after a sucessfull adjusting phase. + # Remove the Binutils pass 1 sources after a sucessfull Adjusting phase. if [ "$i" = "031-adjusting" ] ; then echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp - echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build; && \\" >> $MKFILE.tmp - echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp + echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build && \\" >> $MKFILE.tmp + echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp fi @@ -374,7 +382,7 @@ build_Makefile() { if [ "$i" = "033-expect" ] ; then echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp - echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp + echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp echo -e "\tfi;" >> $MKFILE.tmp fi @@ -459,11 +467,14 @@ build_Makefile() { } run_make() { - # Build the system - if [ -e $MKFILE ] ; then - echo -ne "Building the LFS system\n" - cd $JHALFSDIR && make - echo -ne "done\n" + # Test if make must be run. + if [ "$RUNMAKE" = "1" ] ; then + # Build the system + if [ -e $MKFILE ] ; then + echo -ne "Building the LFS system\n" + cd $JHALFSDIR && make + echo -ne "done\n" + fi fi }