2021-08-01 08:43:34 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cmd=${1}
|
|
|
|
package=wavelib
|
2021-08-02 22:01:43 +08:00
|
|
|
address=/opt/stow
|
|
|
|
targetdir=/usr/local
|
2021-08-01 08:43:34 +08:00
|
|
|
|
|
|
|
if [[ ${cmd} == "configure" && ! -d "build/" ]]; then
|
2021-08-02 22:01:43 +08:00
|
|
|
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/${package} -DCMAKE_BUILD_TYPE=Release
|
2021-08-01 08:43:34 +08:00
|
|
|
elif [[ ${cmd} == "configure" ]]; then
|
2021-08-02 22:01:43 +08:00
|
|
|
cd build && rm -rf * && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/${package} -DCMAKE_BUILD_TYPE=Release
|
2021-08-01 08:43:34 +08:00
|
|
|
elif [[ ${cmd} == "build" ]]; then
|
|
|
|
cd build && make
|
|
|
|
elif [[ ${cmd} == "install" ]]; then
|
|
|
|
cd build && sudo make install
|
2021-08-02 22:01:43 +08:00
|
|
|
sudo stow --dir=${address} --target=${targetdir} ${package}
|
2021-08-01 08:43:34 +08:00
|
|
|
fi
|