NAME=`basename "$0"`
+Usage() {
+ echo "Usage: $NAME [<lib-dir>]"
+ echo
+ echo " <lib-dir> Library directory. Default: current working directory."
+ echo
+ exit 2
+}
+
+while true; do
+ case "$1" in
+ "-"*)
+ Usage
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+[ $# -gt 1 ] && Usage
+
[ -n "$1" ] && LIB_D="$1" || LIB_D="."
if [ -r "/usr/local/share/ax-make/Makefile.ax" ]; then
# -- Makefile.ax --
-[ ! -d "$LIB_D" ] && mkdir -pv "$LIB_D"
+if [ ! -d "$LIB_D" ]; then
+ mkdir -pv "$LIB_D" || exit 1
+fi
target="$LIB_D/`basename "$MAKEFILE_AX"`"
if [ ! -e "$target" -o "$MAKEFILE_AX" -nt "$target" ]; then
# --- Standard project files ---
+if [ ! -e AUTHORS ]; then
+ if git --version >/dev/null 2>&1; then
+ echo "Creating \"AUTHORS\" file ..."
+ echo "`git config user.name` <`git config user.email`>" >>AUTHORS
+ fi
+fi
+
for f in AUTHORS COPYING README; do
if [ ! -e "$f" ]; then
- echo "Creating empty \"$f\" ..."
+ echo "Creating empty \"$f\" file ..."
touch "$f"
fi
done