Xmd/scripts/buildreplicant.sh

35 lines
390 B
Bash
Raw Normal View History

2023-11-13 17:05:51 -07:00
#!/bin/sh
. `dirname $0`/flags.sh
build() {
2023-11-13 17:05:51 -07:00
if
mkdir -p lib && \
cc src/*.c -o "lib/$1.so" -shared $CFLAGS
then
echo ".// ok"
return 0
else
echo "XXX FAIL!"
return 1
fi
}
clean() {
2023-11-13 17:05:51 -07:00
rm -f bin/*
}
case "$2" in
install)
clean; build "$1"
mkdir -p "$PREFIX/lib/Xmd/replicants"
cp "lib/$1.so" "$PREFIX/lib/Xmd/replicants"
clean
;;
clean)
clean
;;
*)
build "$1"
esac