From 97ebb43d26d3e452f6ac8995f212ba971aefc231 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sat, 25 May 2019 01:48:20 -0400 Subject: uglify build script --- build.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index ca680cf..5611238 100755 --- a/build.sh +++ b/build.sh @@ -6,8 +6,13 @@ DFLAGS="-w -g -O" build_tinyendian() { pushd ${extern} - git clone --recursive https://github.com/dlang-community/tinyendian + [ ! -d "tinyendian" ] && git clone --recursive https://github.com/dlang-community/tinyendian pushd tinyendian + if [[ $(find . -name '*.a') ]]; then + popd + popd + return + fi git checkout v0.2.0 dmd ${DFLAGS} -lib -oflibtinyendian.a \ $(find source -type f -name '*.d') @@ -17,8 +22,13 @@ build_tinyendian() { build_dyaml() { pushd ${extern} - git clone --recursive https://github.com/dlang-community/D-YAML + [ ! -d "D-YAML" ] && git clone --recursive https://github.com/dlang-community/D-YAML pushd D-YAML + if [[ $(find . -name '*.a') ]]; then + popd + popd + return + fi git checkout v0.7.1 dmd ${DFLAGS} -lib -oflibdyaml.a \ -I../tinyendian/source \ @@ -28,6 +38,15 @@ build_dyaml() { popd } +clean() { + rm -rf ${extern} + rm -rf *.o +} + +if [ "$1" == "clean" ]; then + clean + exit 0 +fi mkdir -p ${extern} build_tinyendian -- cgit