From 6619ca9f2121a1d94e2860f686f642085489d3bc Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 28 May 2014 12:52:08 +0200 Subject: [PATCH] Add "axify" script to the project --- Makefile | 2 ++ scripts/Makefile | 19 +++++++++++++ scripts/axify | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 scripts/Makefile create mode 100755 scripts/axify diff --git a/Makefile b/Makefile index 4a26dff..0bf501e 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,8 @@ # (at your option) any later version. # +SUBDIRS = scripts + include Makefile.ax install-local: diff --git a/scripts/Makefile b/scripts/Makefile new file mode 100644 index 0000000..94d80ee --- /dev/null +++ b/scripts/Makefile @@ -0,0 +1,19 @@ +# +# ax-make: Alex' Simple Makefile System +# Copyright (c)2014 Alexander Barton (alex@barton.de) +# +# This library is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# + +ALL = axify + +include ../Makefile.ax + +install-local: + install -d -o $(USER) -g $(GROUP) -m 755 \ + $(DESTDIR)$(PREFIX)/bin + install -p -o $(USER) -g $(GROUP) -m 755 axify \ + $(DESTDIR)$(PREFIX)/bin/axify diff --git a/scripts/axify b/scripts/axify new file mode 100755 index 0000000..b40d918 --- /dev/null +++ b/scripts/axify @@ -0,0 +1,72 @@ +#!/bin/sh +# +# ax-make: Alex' Simple Makefile System +# Copyright (c)2014 Alexander Barton (alex@barton.de) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# + +NAME=`basename "$0"` + +[ -n "$1" ] && LIB_D="$1" || LIB_D="." + +if [ -r "/usr/local/share/ax-make/Makefile.ax" ]; then + MAKEFILE_AX="/usr/local/share/ax-make/Makefile.ax" +elif [ -r "/usr/share/ax-make/Makefile.ax" ]; then + MAKEFILE_AX="/usr/share/ax-make/Makefile.ax" +else + echo "$NAME: No source \"Makefile.ax\" found!" + echo "$NAME: Please check your installation of \"ax-make\" and try again." + exit 1 +fi + +# -- Makefile.ax -- + +[ ! -d "$LIB_D" ] && mkdir -pv "$LIB_D" +if [ "$MAKEFILE_AX" -nt "$LIB_D/`basename "$MAKEFILE_AX"`" ]; then + echo "Updating \"$LIB_D/`basename "$MAKEFILE_AX"`\" ..." + cp -v "$MAKEFILE_AX" "$LIB_D/`basename "$MAKEFILE_AX"`" || exit 1 +else + echo "Makefile \"$LIB_D/`basename "$MAKEFILE_AX"`\" is up to date." +fi + +# -- Project Makefile's --- + +if [ ! -e "Makefile" ]; then +echo "Creating \"Makefile\" ..." +[ "$LIB_D" != "." ] && subdirs="$LIB_D" || subdirs="" +cat >"Makefile" <"$LIB_D/Makefile" <