diff --git a/Makefile b/Makefile index 03c86eba4a..26aa6d8dfa 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ SUBDIRS := $(shell find */* -name "Makefile" | xargs dirname) all: $(SUBDIRS) $(SUBDIRS): .FORCE - $(MAKE) -j -k -C $@ || true + @echo "* Preparing subdirectory $*" + @$(MAKE) -j -k -C $@ # ----------------------------------------------------------------------------- # Handle local menus diff --git a/build/buildrun.sh b/build/buildrun.sh index 0199c99179..8a6f0ae312 100755 --- a/build/buildrun.sh +++ b/build/buildrun.sh @@ -7,46 +7,48 @@ inc_buildrun=true [ -z "$inc_misc" ] && . "$basedir/build/misc.sh" build_into(){ + set -o pipefail + + printf %s "$start_time" > "$(logname start_time)" + ncpu="$(grep -c ^processor /proc/cpuinfo)" [ -n "$statusdir" ] && cp "$basedir/build/status.html.sh" "$statusdir/index.cgi" - printf %s "$start_time" |logstatus start_time + [ -f "$(logname lasterror)" ] && rm "$(logname lasterror)" [ -f "$(logname debug)" ] && rm "$(logname debug)" forcelog Makefile - ( - # Make sure that the following pipe exits with a nonzero exit code if the - # make run fails. - set -o pipefail - - make -C "$basedir" | t_logstatus premake - ) || exit 1 + { + echo "Starting phase 1" \ + && make -C "$basedir" --no-print-directory 2>&1 \ + && echo "Finishing phase 1" \ + || die "Error during phase 1" + } | t_logstatus phase_1 || exit 1 dir_maker "$basedir" "$stagedir" || exit 1 - tree_maker "$basedir" "$stagedir" > "$(logname Makefile)" || exit 1 + { + tree_maker "$basedir" "$stagedir" 2>&1 \ + || die "Error during phase 2 Makefile generation" + } > "$(logname Makefile)" || exit 1 - ( - # Make sure that the following pipe exits with a nonzero exit code if the - # make run fails. - set -o pipefail - - if ! make -j $ncpu -f "$(logname Makefile)" all 2>&1; then - die "See buildlog for errors reported by Make" - fi | t_logstatus buildlog - ) || exit 1 + { + echo "Starting phase 2" \ + && make -j $ncpu -f "$(logname Makefile)" 2>&1 \ + && echo "Finishing phase 2" \ + || die "Error during phase 2" + } | t_logstatus phase_2 || exit 1 if [ "$stagedir" != "$target" ]; then rsync -av --del "$stagedir/" "$target/" | t_logstatus stagesync fi - date +%s | logstatus end_time + date +%s > "$(logname end_time)" + if [ -n "$statusdir" ]; then - cd "$statusdir" - ./index.cgi |tail -n+3 >status_$(date +%s).html - cd - + ( cd "$statusdir"; ./index.cgi | tail -n+3 > status_$(date +%s).html ) fi } diff --git a/build/makerules.sh b/build/makerules.sh index 5f9be8cdbc..5c8ba670b2 100755 --- a/build/makerules.sh +++ b/build/makerules.sh @@ -254,4 +254,3 @@ clean: EOF } - diff --git a/build/status.html.sh b/build/status.html.sh index 54e727accd..33bb6c09fa 100755 --- a/build/status.html.sh +++ b/build/status.html.sh @@ -37,12 +37,11 @@ htmlcat(){ } start_time=$(cat "start_time" || stat -c %Y "$0" || echo 0) -t_svnupdate=$(stat -c %Y "SVNlatest" ||echo 0) t_gitupdate=$(stat -c %Y "GITlatest" ||echo 0) -t_premake=$(stat -c %Y "premake" ||echo 0) +t_phase_1=$(stat -c %Y "phase_1" ||echo 0) t_makefile=$(stat -c %Y "Makefile" ||echo 0) +t_phase_2=$(stat -c %Y "phase_2" ||echo 0) t_manifest=$(stat -c %Y "manifest" ||echo 0) -t_makerun=$(stat -c %Y "buildlog" ||echo 0) t_stagesync=$(stat -c %Y "stagesync" ||echo 0) end_time=$(cat "end_time" || echo 0) duration=$(($end_time - $start_time)) @@ -192,54 +191,43 @@ label { )" ) -

VCS changes

$( +

GIT changes

$( if [ ${start_time} -le ${t_gitupdate} ]; then web_tab VCS_tab "at $(timestamp ${t_gitupdate})" "
$(htmlcat GITlatest)
" checked - elif [ ${start_time} -le ${t_svnupdate} ]; then - web_tab VCS_tab "at $(timestamp ${t_svnupdate})" "
$(htmlcat SVNlatest)
" checked else web_tab VCS_tab "Unconditional build, changes ignored" "" fi)

Phase 1

$( - if [ $start_time -lt $t_premake -a $start_time -lt $t_gitupdate ]; then - web_tab Premaketab "Premake run time $(duration $(($t_premake - $t_gitupdate)))" "
$(tail premake |htmlcat)
full log" - elif [ $start_time -lt $t_premake -a $start_time -lt $t_svnupdate ]; then - web_tab Premaketab "Premake run time $(duration $(($t_premake - $t_svnupdate)))" "
$(tail premake |htmlcat)
full log" - elif [ $start_time -lt $t_premake ]; then - web_tab Premaketab "Premake run time $(duration $(($t_premake - $start_time)))" "
$(tail premake |htmlcat)
full log" + if [ $start_time -lt $t_phase_1 -a $start_time -lt $t_gitupdate ]; then + web_tab Premaketab "Premake run time $(duration $(($t_phase_1 - $t_gitupdate)))" "
$(tail phase_1 |htmlcat)
full log" + elif [ $start_time -lt $t_phase_1 ]; then + web_tab Premaketab "Premake run time $(duration $(($t_phase_1 - $start_time)))" "
$(tail phase_1 |htmlcat)
full log" else web_tab Premaketab "waiting..." "" fi)

Phase 2 Makefile

$( if [ $start_time -lt $t_makefile ]; then - web_tab Makefiletab "Generation time: $(duration $(($t_makefile - $t_premake)) )" " - "view" + web_tab Makefiletab "Generation time: $(duration $(($t_makefile - $t_phase_1)) )" \ + "view" else web_tab Makefiletab "waiting..." "" fi)

Phase 2

$( - if [ $start_time -lt $t_makerun ]; then - web_tab Makeruntab "Build time: $(duration $(($t_makerun - $t_makefile)) )" "
$(tail buildlog |htmlcat)
view full" + if [ $start_time -lt $t_phase_2 ]; then + web_tab Makeruntab "Build time: $(duration $(($t_phase_2 - $t_makefile)) )" "
$(tail phase_2 |htmlcat)
view full" else web_tab Makeruntab "waiting..." "" fi) -

Errors

$( - if [ -f lasterror ]; then - web_tab Errortab "There were errors" "
$(htmlcat lasterror)
" - else - web_tab Errortab "none" "" - fi) -

File Manifest

$( if [ $start_time -lt $t_manifest ]; then web_tab Manifesttab "Number of files: $(wc -l manifest | cut -d\ -f1)" " view" else - web_tab Makeruntab "waiting..." "" + web_tab Manifesttab "waiting..." "" fi)

Files updated

$( @@ -251,6 +239,12 @@ label { web_tab Updatedtab "-" "" fi) +

Errors

$( + if [ -f lasterror ]; then + web_tab Errortab "There were errors" "
$(htmlcat lasterror)
" + else + web_tab Errortab "none" "" + fi) diff --git a/news/Makefile b/news/Makefile index 1b072d394f..513bf25ab4 100644 --- a/news/Makefile +++ b/news/Makefile @@ -20,7 +20,7 @@ GENERATED_XML_SOURCES := $(patsubst %.xml,%.xhtml,$(subst /.,/,$(GENERATED_XML)) all: $(GENERATED_XML_SOURCES) %.xhtml: - @echo '* Removing $(subst /,/.,$*).xml' + @echo '* Removing $(subst /,/.,$*).xml' @rm '$(subst /,/.,$*).xml' # ----------------------------------------------------------------------------- @@ -38,5 +38,5 @@ XML := $(patsubst %.xhtml,%.xml,$(subst /,/.,$(XHTML))) all: $(XML) XMLSOURCE = $(patsubst %.xml,%.xhtml,$(subst /.,/,$@)) %.xml: $$(XMLSOURCE) xhtml2xml.xsl - @echo '* Generating $@' + @echo '* Generating $@' @xsltproc --stringparam link '/news/$(basename $(basename $<)).html' xhtml2xml.xsl '$<' > '$@'