5 PROGS
="java javac jar make sed"
7 IMG
=be
/nikiroo
/utils
/ui
/ImageUtilsAwt
8 CLI
=be
/nikiroo
/fanfix
/reader
/cli
/CliReader
9 TUI
=be
/nikiroo
/fanfix
/reader
/tui
/TuiReader
10 GUI
=be
/nikiroo
/fanfix
/reader
/ui
/GuiReader
17 while [ "$*" != "" ]; do
18 key
=`echo "$1" | cut -f1 -d=`
19 val
=`echo "$1" | cut -f2 -d=`
23 --help) # This help message
24 echo The following arguments can be used
:
25 cat "$0" |
grep '^\s*--' |
grep '#' |
while read ln; do
26 cmd
=`echo "$ln" | cut -f1 -d')'`
27 msg
=`echo "$ln" | cut -f2 -d'#'`
31 --prefix) #=PATH Change the prefix to the given path
34 --cli) #=no Disable CLI support (System.out)
35 [ "$val" = no
-o "$val" = false
] && CLI
= && JCLI
=
37 --tui) #=no Enable TUI support (Jexer)
38 [ "$val" = no
-o "$val" = false
] && TUI
= && JTUI
=
40 --gui) #=no Disable GUI support (Swing)
41 [ "$val" = no
-o "$val" = false
] && GUI
= && JGUI
=
44 echo "Unsupported parameter: '$1'" >&2
53 [ $valid = false
] && exit 1
55 MESS
="A required program cannot be found:"
56 for prog
in $PROGS; do
57 out
="`whereis -b "$prog" 2>/dev/null`"
58 if [ "$out" = "$prog:" ]; then
59 echo "$MESS $prog" >&2
64 [ $valid = false
] && exit 2
66 if [ "`whereis tput`" = "tput:" ]; then
71 ok
='"`tput bold`[`tput setf 2` OK `tput init``tput bold`]`tput init`"';
72 ko
='"`tput bold`[`tput setf 4` !! `tput init``tput bold`]`tput init`"';
76 echo "MAIN = be/nikiroo/fanfix/Main" > Makefile
77 echo "MORE = $CLI $TUI $GUI $IMG" >> Makefile
78 echo "TEST = be/nikiroo/fanfix/test/Test" >> Makefile
79 echo "TEST_PARAMS = $cols $ok $ko" >> Makefile
80 echo "NAME = fanfix" >> Makefile
81 echo "PREFIX = $PREFIX" >> Makefile
82 echo "JAR_FLAGS += -C bin/ org $JCLI $JTUI $JGUI -C bin/ be -C bin/ VERSION" >> Makefile
83 echo "RM_FOR_ANDROID = jexer be/nikiroo/utils/ui/* be/nikiroo/fanfix/reader/tui/* be/nikiroo/fanfix/reader/ui/*" >> Makefile
84 echo "ID_FOR_ANDROID = be.nikiroo.fanfix.reader.android" >> Makefile
85 #echo "SJAR_FLAGS += -C src/ org -C src/ jexer -C src/ be -C ./ LICENSE -C ./ README.md -C ./ VERSION" >> Makefile
87 cat Makefile.base
>> Makefile