I hate the way functions are defined in posix sh
This commit is contained in:
parent
2aff2ff45a
commit
b1f13bdcac
@ -5,23 +5,26 @@ BUILDFLAGS="$CFLAGS -Iinclude"
|
||||
LINTCHECKS="-checks=-*,clang-analyzer-*,bugprone-*,portability-*,cert-*"
|
||||
SOURCE="src/*.c"
|
||||
|
||||
function build() {
|
||||
build() {
|
||||
mkdir -p lib
|
||||
cc $SOURCE -o "lib/libXmd.so" -shared $BUILDFLAGS || \
|
||||
echo "XXX FAIL!"
|
||||
}
|
||||
|
||||
function lint() {
|
||||
lint() {
|
||||
clang-tidy $SOURCE $LINTCHECKS -- $BUILDFLAGS || \
|
||||
echo "XXX FAIL!"
|
||||
}
|
||||
|
||||
function clean() {
|
||||
clean() {
|
||||
rm -f lib/*
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
install)
|
||||
clean; build
|
||||
mkdir -p "$PREFIX/lib"
|
||||
mkdir -p "$PREFIX/include/Xmd"
|
||||
cp lib/*.so "$PREFIX/lib"
|
||||
cp include/Xmd/*.h "$PREFIX/include/Xmd"
|
||||
clean
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
. `dirname $0`/flags.sh
|
||||
|
||||
function build() {
|
||||
build() {
|
||||
if
|
||||
mkdir -p lib && \
|
||||
cc src/*.c -o "lib/$1.so" -shared $CFLAGS
|
||||
@ -15,7 +15,7 @@ function build() {
|
||||
fi
|
||||
}
|
||||
|
||||
function clean() {
|
||||
clean() {
|
||||
rm -f bin/*
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user