Initial commit
This commit is contained in:
27
scripts/buildapp.sh
Executable file
27
scripts/buildapp.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
. `dirname $0`/flags.sh
|
||||
|
||||
function build() {
|
||||
mkdir -p bin
|
||||
cc $CFLAGS -c -o "bin/$1.o" src/*.c && \
|
||||
cc -o "bin/$1" "bin/$1.o" $APP_LIBS || \
|
||||
echo "XXX FAIL!"
|
||||
}
|
||||
|
||||
function clean() {
|
||||
rm -f bin/*
|
||||
}
|
||||
|
||||
case "$2" in
|
||||
install)
|
||||
clean; build "$1"
|
||||
cp "bin/$1" "$PREFIX/bin"
|
||||
clean
|
||||
;;
|
||||
clean)
|
||||
clean
|
||||
;;
|
||||
*)
|
||||
build "$1"
|
||||
esac
|
||||
5
scripts/flags.sh
Normal file
5
scripts/flags.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
CFLAGS="-std=c99 -Wall -Wextra -Werror -fPIC"
|
||||
PREFIX="/usr/local"
|
||||
APP_LIBS="-lXmd -lXm -lXt -lX11"
|
||||
Reference in New Issue
Block a user