forked from hcmiya/opuscomment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·51 lines (46 loc) · 938 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
set -e
if [ -n "$DEFAULT_NLS_PATH" ]
then CFLAGS="$CFLAGS -DDEFAULT_NLS_PATH=\\\"$DEFAULT_NLS_PATH\\\""
fi
dir=$(dirname "$0")
CC="${CC:-c99}"
MAKE="${MAKE:-make}"
case "$1" in
release)
CFLAGS="$CFLAGS -DNDEBUG"
$MAKE -C "$dir" CFLAGS="$CFLAGS" CC="$CC"
;;
debug)
CFLAGS="$CFLAGS -O0 -g -Wall -Wno-pointer-sign -Wno-parentheses -Wno-switch"
$MAKE -C "$dir" CFLAGS="$CFLAGS" CC="$CC"
;;
clean)
$MAKE -C "$dir" clean
rm "$dir"/nls/*/opuscomment.cat 2>/dev/null || :
;;
catalog)
shift
(
cd "$dir"/nls
if [ -z "$1" -o x"$1" = xall ]
then list="$(ls)"
else list="$*"
fi
for lang in $list
do
ls $lang |grep -v -e opuscomment.cat -e README |sort -n |sed "s|^|$lang/|" \
|xargs env LANG=$lang gencat $lang/opuscomment.cat
done
)
;;
*)
cat <<_heredoc
Synopsys:
$0 {release|debug|clean}
$0 catalog [lang]...
Environment Variables:
CC, CFLAGS, MAKE, DEFAULT_NLS_PATH
_heredoc
;;
esac