From 6680dd14efd826606d2505395c91fa3426ce9270 Mon Sep 17 00:00:00 2001 From: Itms Date: Tue, 27 Dec 2016 09:49:41 +0000 Subject: [PATCH] Small updates to build scripts, refs #4419. Tweak the coverage script. Update the clean-workspaces script to be able to avoid rebuilding libraries. Differential Revision: https://code.wildfiregames.com/D2 This was SVN commit r19074. --- build/coverage/gen.sh | 14 ++++++++------ build/workspaces/clean-workspaces.sh | 23 ++++++++++++++++------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/build/coverage/gen.sh b/build/coverage/gen.sh index e15d49acff..f015d87962 100755 --- a/build/coverage/gen.sh +++ b/build/coverage/gen.sh @@ -1,16 +1,16 @@ -#!/bin/bash +#!/bin/sh # Run "update-workspaces.sh --coverage" (in the appropriate directory) then -# do "make test Collada", before running this script. +# do "make test Collada config=debug", before running this script. # Also make sure you don't build via ccache. Also you might need a patch like # http://ltp.cvs.sourceforge.net/viewvc/ltp/utils/analysis/lcov/bin/lcov?r1=1.33&r2=1.34 rm -f app.info for APPDIR in ../workspaces/gcc/obj/*; do - lcov -d $APPDIR --zerocounters - lcov -d $APPDIR -b ../workspaces/gcc --capture --initial -o temp.info - if [[ -e app.info ]]; then + lcov -d "$APPDIR" --zerocounters + lcov -d "$APPDIR" -b ../workspaces/gcc --capture --initial -o temp.info + if [ -e app.info ]; then lcov -a app.info -a temp.info -o app.info else mv temp.info app.info @@ -20,12 +20,14 @@ done (cd ../../binaries/system/; ./test_dbg) for APPDIR in ../workspaces/gcc/obj/*; do - lcov -d $APPDIR -b ../workspaces/gcc --capture -o temp.info && + lcov -d "$APPDIR" -b ../workspaces/gcc --capture -o temp.info && lcov -a app.info -a temp.info -o app.info done lcov -r app.info '/usr/*' -o app.info lcov -r app.info '*/libraries/*' -o app.info +lcov -r app.info '*/third_party/*' -o app.info +rm -rf output mkdir output (cd output; genhtml ../app.info) diff --git a/build/workspaces/clean-workspaces.sh b/build/workspaces/clean-workspaces.sh index 49e2803ac8..57e405813d 100755 --- a/build/workspaces/clean-workspaces.sh +++ b/build/workspaces/clean-workspaces.sh @@ -11,6 +11,15 @@ case "`uname -s`" in ;; esac +# Check the preserve-libs CL option +preserve_libs=false + +for i in "$@"; do + case "$i" in + --preserve-libs ) preserve_libs=true ;; + esac +done + # (We don't attempt to clean up every last file here - output in # binaries/system/ will still be there, etc. This is mostly just # to quickly fix problems in the bundled dependencies.) @@ -18,20 +27,20 @@ esac cd "$(dirname $0)" # Now in build/workspaces/ (where we assume this script resides) -# We don't want to clean bundled libs on OS X -if [ "`uname -s`" != "Darwin" ]; then +if [ "$preserve_libs" != "true" ]; then echo "Cleaning bundled third-party dependencies..." (cd ../../libraries/source/fcollada/src && rm -rf ./output) + (cd ../../libraries/source/nvtt/src && rm -rf ./build) (cd ../../libraries/source/spidermonkey && rm -f .already-built) (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-38.0.0) -# Still delete the directory of the previous SpiderMonkey version to -# avoid wasting disk space if people clean workspaces after updating. - (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs31) - (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs24) - (cd ../../libraries/source/nvtt/src && rm -rf ./build) fi +# Still delete the directory of previous SpiderMonkey versions to +# avoid wasting disk space if people clean workspaces after updating. +(cd ../../libraries/source/spidermonkey && rm -rf ./mozjs31) +(cd ../../libraries/source/spidermonkey && rm -rf ./mozjs24) + (cd ../premake/premake4/build/gmake.bsd && ${MAKE} clean) (cd ../premake/premake4/build/gmake.macosx && ${MAKE} clean) (cd ../premake/premake4/build/gmake.unix && ${MAKE} clean)