5 PROGS
="java javac jar make sed"
7 TUI
=be
/nikiroo
/jvcard
/tui
/TuiLauncher
8 JTUI
="-C bin/ com -C bin/ resources"
10 NET
="be/nikiroo/jvcard/remote/Server be/nikiroo/jvcard/remote/Sync"
14 while [ "$*" != "" ]; do
15 key
=`echo "$1" | cut -f1 -d=`
16 val
=`echo "$1" | cut -f2 -d=`
20 --help) # This help message
21 echo The following arguments can be used
:
22 cat "$0" |
grep '^\s*--' |
grep '#' |
while read ln; do
23 cmd
=`echo "$ln" | cut -f1 -d')'`
24 msg
=`echo "$ln" | cut -f2 -d'#'`
28 --prefix) #=PATH Change the prefix to the given path
31 --net) #=no Disable server and sync support
32 [ "$val" = no
-o "$val" = false
] && NET
= && JNET
=
34 --tui) #=no Disable TUI support (Lanterna)
35 [ "$val" = no
-o "$val" = false
] && TUI
= && JTUI
=
38 echo "Unsupported parameter: '$1'" >&2
47 [ $valid = false
] && exit 1
49 MESS
="A required program cannot be found:"
50 for prog
in $PROGS; do
51 out
="`whereis -b "$prog" 2>/dev/null`"
52 if [ "$out" = "$prog:" ]; then
53 echo "$MESS $prog" >&2
58 [ $valid = false
] && exit 2
60 if [ "`whereis tput`" = "tput:" ]; then
65 ok
='"`tput bold`[`tput setf 2` OK `tput init``tput bold`]`tput init`"';
66 ko
='"`tput bold`[`tput setf 4` !! `tput init``tput bold`]`tput init`"';
70 echo "MAIN = be/nikiroo/jvcard/launcher/Main" > Makefile
71 echo "MORE = $NET $TUI" >> Makefile
72 echo "TEST = " >> Makefile
73 echo "TEST_PARAMS = $cols $ok $ko" >> Makefile
74 echo "NAME = jvcard" >> Makefile
75 echo "PREFIX = $PREFIX" >> Makefile
76 echo "JAR_FLAGS += $JNET $JTUI -C bin/ be -C bin/ VERSION" >> Makefile
77 #echo "SJAR_FLAGS += -C src/ com -C src/ be -C ./ LICENSE -C ./ README.md -C ./ VERSION" >> Makefile
79 cat Makefile.base
>> Makefile