#!/bin/sh cd "$(dirname "$0")" #******************************************************************************# # Defaults # #******************************************************************************# # Project variables name="$(make -s getname)" version="$(make -s getversion)" # Author author="$(make -s getauthor)" author_name="$(make -s getauthor_name)" # Target target="" # Make options make_full_log= # Build options default_zoom=8 default_storage=fls0 # Installation directories root='' prefix='${root}/usr' bindir='${prefix}/bin' mandir='${prefix}/share/man' # Installation options install_manpages=yes #******************************************************************************# # Help message # #******************************************************************************# usage() { cat </dev/null ]; then echo "--default-zoom: a number is expected (got \"$zoom\")" >&2 elif [ $zoom -lt 1 ]; then echo "--default-zoom: should be 1 or more (got $zoom)" >&2 elif [ $zoom -gt 16 ]; then echo "--default-zoom: should be 16 or less (got $zoom)" >&2 else default_zoom=$zoom; fi ;; --default-storage=*) storage="${arg#*=}" # check if 4 chars long if [ ! $(echo "$storage" | wc -c ) -eq 5 ]; then echo "$0: --default-storage: must be 4 characters long" continue fi # then set default_storage="$storage" ;; --noinstall-manpages) install_manpages= ;; --root=*) root="${arg#*=}" ;; --prefix=*) prefix="${arg#*=}" ;; --bindir=*) bindir="${arg#*=}" ;; --mandir=*) mandir="${arg#*=}" ;; *) echo "$arg: didn't read" ;; esac; done #******************************************************************************# # Evaluate variables # #******************************************************************************# for var in prefix bindir mandir; do eval $var'='$(eval 'echo $'$var) done #******************************************************************************# # Create Makefile configuration # #******************************************************************************# exec 3>&1 1>Makefile.cfg cat <&3 3>&- chmod +x Makefile.cfg #******************************************************************************# # Finish # #******************************************************************************# echo "Configuration loaded, you can make now." # End of file.