I hate the way functions are defined in posix sh

This commit is contained in:
Sasha Koshka 2024-01-18 02:28:43 +00:00
parent 2aff2ff45a
commit b1f13bdcac
2 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -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/*
}