build.sh: support multiple arguments
@@ -40,7 +40,6 @@ dependencies() {
DEPS="{meson,gcc,g++,libX11-devel,glslang,python-mako,mesa-libGL-devel}"
install
- unset DEPS
unset INSTALL
DEPS="{glibc-devel.i686,libstdc++-devel.i686,libX11-devel.i686}"
install
@@ -83,11 +82,17 @@ configure() {
}
build() {
+ if [[ ! -d build/meson64 ]]; then
+ configure
+ fi
ninja -C build/meson32 install
ninja -C build/meson64 install
}
package() {
+ if [[ ! -f build/release/usr/lib64/libMangoHud.so ]]; then
+ build
+ fi
mkdir -p $INSTALL_DIR/{MangoHud,vulkan/implicit_layer.d}
cp build/release/usr/lib32/libMangoHud.so $INSTALL_DIR/MangoHud/libMangoHud32.so
@@ -117,15 +122,18 @@ uninstall() {
rm $IMPLICIT_LAYER_DIR/{mangohud64,mangohud32}.json
}
-case $1 in
+for a in $@; do
+ case $a in
"") configure; build;;
+ "pull") git pull;;
+ "configure") configure;;
"build") configure; build;;
- "install") package; install;;
- "update") git pull &> /dev/null; configure; build; install;;
"package") package;;
+ "install") package; install;;
"clean") clean;;
"uninstall") uninstall;;
*)
- echo "Unrecognized command argument: $1"
- echo 'Accepted arguments: "", "build", "install", "update", "package", "clean", "uninstall".'
+ echo "Unrecognized command argument: $a"
+ echo 'Accepted arguments: "pull", "configure", "build", "package", "install", "clean", "uninstall".'
esac
+done
