5 PROGS
="java javac jar make sed"
7 CLI
=be
/nikiroo
/fanfix
/reader
/CliReader
8 TUI
=be
/nikiroo
/fanfix
/reader
/TuiReader
9 GUI
=be
/nikiroo
/fanfix
/reader
/GuiReader
15 while [ "$*" != "" ]; do
16 key
=`echo "$1" | cut -f1 -d=`
17 val
=`echo "$1" | cut -f2 -d=`
21 --help) # This help message
22 echo The following arguments can be used
:
23 cat "$0" |
grep '^\s*--' |
grep '#' |
while read ln; do
24 cmd
=`echo "$ln" | cut -f1 -d')'`
25 msg
=`echo "$ln" | cut -f2 -d'#'`
29 --prefix) #=PATH Change the prefix to the given path
32 --cli) #=no Disable CLI support (System.out)
33 [ "$val" = no
-o "$val" = false
] && CLI
= && JCLI
=
35 --tui) #=no Disable TUI support (Jexer)
36 [ "$val" = no
-o "$val" = false
] && TUI
= && JTUI
=
38 --gui) #=no Disable GUI support (Swing)
39 [ "$val" = no
-o "$val" = false
] && GUI
= && JGUI
=
42 echo "Unsupported parameter: '$1'" >&2
51 [ $valid = false
] && exit 1
53 MESS
="A required program cannot be found:"
54 for prog
in $PROGS; do
55 out
="`whereis -b "$prog" 2>/dev/null`"
56 if [ "$out" = "$prog:" ]; then
57 echo "$MESS $prog" >&2
62 [ $valid = false
] && exit 2
64 if [ "`whereis tput`" = "tput:" ]; then
69 ok
='"`tput bold`[`tput setf 2` OK `tput init``tput bold`]`tput init`"';
70 ko
='"`tput bold`[`tput setf 4` !! `tput init``tput bold`]`tput init`"';
74 echo "MAIN = be/nikiroo/fanfix/Main" > Makefile
75 echo "MORE = $CLI $TUI $GUI" >> Makefile
76 echo "TEST = be/nikiroo/fanfix/test/Test" >> Makefile
77 echo "TEST_PARAMS = $cols $ok $ko" >> Makefile
78 echo "NAME = fanfix" >> Makefile
79 echo "PREFIX = $PREFIX" >> Makefile
80 echo "JAR_FLAGS += -C bin/ org $JCLI $JTUI $JGUI -C bin/ be -C bin/ VERSION" >> Makefile
81 #echo "SJAR_FLAGS += -C src/ org -C src/ jexer -C src/ be -C ./ LICENSE -C ./ README.md -C ./ VERSION" >> Makefile
83 cat Makefile.base
>> Makefile