3 # ax-make: Alex' Simple Makefile System
4 # Copyright (c)2014 Alexander Barton (alex@barton.de)
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
14 [ -n "$1" ] && LIB_D="$1" || LIB_D="."
16 if [ -r "/usr/local/share/ax-make/Makefile.ax" ]; then
17 MAKEFILE_AX="/usr/local/share/ax-make/Makefile.ax"
18 elif [ -r "/usr/share/ax-make/Makefile.ax" ]; then
19 MAKEFILE_AX="/usr/share/ax-make/Makefile.ax"
21 echo "$NAME: No source \"Makefile.ax\" found!"
22 echo "$NAME: Please check your installation of \"ax-make\" and try again."
28 [ ! -d "$LIB_D" ] && mkdir -pv "$LIB_D"
29 if [ "$MAKEFILE_AX" -nt "$LIB_D/`basename "$MAKEFILE_AX"`" ]; then
30 echo "Updating \"$LIB_D/`basename "$MAKEFILE_AX"`\" ..."
31 cp -v "$MAKEFILE_AX" "$LIB_D/`basename "$MAKEFILE_AX"`" || exit 1
33 echo "Makefile \"$LIB_D/`basename "$MAKEFILE_AX"`\" is up to date."
36 # -- Project Makefile's ---
38 if [ ! -e "Makefile" ]; then
39 echo "Creating \"Makefile\" ..."
40 [ "$LIB_D" != "." ] && subdirs="$LIB_D" || subdirs=""
48 include $LIB_D/Makefile.ax
52 if [ "$LIB_D" != "." -a ! -e "$LIB_D/Makefile" ]; then
53 echo "Creating \"$LIB_D/Makefile\" ..."
54 cat >"$LIB_D/Makefile" <<EOF
63 # --- Standard project files ---
65 for f in AUTHORS COPYING README; do
66 if [ ! -e "$f" ]; then
67 echo "Creating empty \"$f\" ..."