Commit eb019741 authored by Giulio's avatar Giulio

Add option -C to clean the build-generated s_stuff.h, config.h,...

Add option -C to clean the build-generated s_stuff.h, config.h, pd/src/makefile files. Using `bash -euo pipefail` to make sure the script stops if one command fails. Better handling case here $nwjs_filename exists
parent 9ddde963
Pipeline #1250 failed with stage
in 0 seconds
#!/bin/bash #!/bin/bash -euo pipefail
# super-simplistic installer for l2ork things by Ivica Ico Bukvic <ico@vt.edu> # super-simplistic installer for l2ork things by Ivica Ico Bukvic <ico@vt.edu>
# for info on L2Ork visit http://l2ork.music.vt.edu # for info on L2Ork visit http://l2ork.music.vt.edu
...@@ -22,6 +22,7 @@ then ...@@ -22,6 +22,7 @@ then
echo " -F full tarball installer (complete recompile)" echo " -F full tarball installer (complete recompile)"
echo " -k keep previous build products" echo " -k keep previous build products"
echo " -l do a light build (only essential externals)" echo " -l do a light build (only essential externals)"
echo " -C clean folder and temp files before building"
echo " -n skip package creation (-bB, -fF)" echo " -n skip package creation (-bB, -fF)"
echo " -r build a Raspberry Pi deb (incremental)" echo " -r build a Raspberry Pi deb (incremental)"
echo " -R build a Raspberry Pi deb (complete recompile)" echo " -R build a Raspberry Pi deb (complete recompile)"
...@@ -50,6 +51,7 @@ then ...@@ -50,6 +51,7 @@ then
fi fi
deb=0 deb=0
clean=0
core=0 core=0
full=0 full=0
rpi=0 rpi=0
...@@ -60,7 +62,7 @@ any=0 ...@@ -60,7 +62,7 @@ any=0
clean=1 clean=1
light=0 light=0
while getopts ":bBcfFklnRrTtXzZ" Option while getopts ":bBcCfFklnRrTtXzZ" Option
do case $Option in do case $Option in
b) deb=1 b) deb=1
inst_dir=${inst_dir:-/usr};; inst_dir=${inst_dir:-/usr};;
...@@ -70,6 +72,8 @@ do case $Option in ...@@ -70,6 +72,8 @@ do case $Option in
c) core=1;; c) core=1;;
C) clean=1;;
f) full=1;; f) full=1;;
F) full=2;; F) full=2;;
...@@ -105,6 +109,14 @@ do case $Option in ...@@ -105,6 +109,14 @@ do case $Option in
esac esac
done done
if [ $clean -eq 1 ]
then
rm -rf \
../pd/src/s_stuff.h \
../pd/src/config.h \
../pd/src/makefile
fi
inst_dir=${inst_dir:-/usr/local} inst_dir=${inst_dir:-/usr/local}
# configure a light build if requested # configure a light build if requested
...@@ -200,9 +212,12 @@ if [ ! -d "../pd/nw/nw" ]; then ...@@ -200,9 +212,12 @@ if [ ! -d "../pd/nw/nw" ]; then
nwjs_url=${nwjs_url}/$nwjs_filename nwjs_url=${nwjs_url}/$nwjs_filename
echo "Fetching the nwjs binary from" echo "Fetching the nwjs binary from"
echo "$nwjs_url" echo "$nwjs_url"
wget -nv $nwjs_url # delete any existing file with the same name
rm -rf $nwjs_filename
wget -nv $nwjs_url
if [[ $os == "win" || $os == "osx" ]]; then if [[ $os == "win" || $os == "osx" ]]; then
unzip $nwjs_filename # unzip overwriting existing files
unzip -o $nwjs_filename
else else
tar -xf $nwjs_filename tar -xf $nwjs_filename
fi fi
...@@ -282,7 +297,7 @@ then ...@@ -282,7 +297,7 @@ then
cd Gem/ cd Gem/
export INCREMENTAL="yes" export INCREMENTAL="yes"
fi fi
cd ../pd/src && aclocal && autoconf cd ../pd/src && aclocal && autoconf || false
if [[ $os == "win" ]]; then if [[ $os == "win" ]]; then
cd ../../packages/win32_inno cd ../../packages/win32_inno
elif [[ $os == "osx" ]]; then elif [[ $os == "osx" ]]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment