aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-05-25 01:48:20 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-05-25 01:48:20 -0400
commit97ebb43d26d3e452f6ac8995f212ba971aefc231 (patch)
treebbb7554dd0534b02c21944cba3281737f9faf1c2 /build.sh
parent2ac8f0c609bf52dce1ea2ec6d42182ac9ce982fb (diff)
downloaddm-97ebb43d26d3e452f6ac8995f212ba971aefc231.tar.gz
uglify build script
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh23
1 files 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