summaryrefslogtreecommitdiff
path: root/sysinfo/version.sh
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-26 08:48:48 -0500
committermidipix <writeonce@midipix.org>2018-12-30 17:55:41 -0500
commit2189ad980eae15916143975e774bd06f62a0b387 (patch)
tree9626599f00ee860428122672cef9c85de7063632 /sysinfo/version.sh
parentb06316c0af4fda72fd23feb4bdaddc904c28aa76 (diff)
downloadapimagic-2189ad980eae15916143975e774bd06f62a0b387.tar.bz2
apimagic-2189ad980eae15916143975e774bd06f62a0b387.tar.xz
build system: major overhaul: removed sysinfo, integrated ccenv.
Diffstat (limited to 'sysinfo/version.sh')
-rwxr-xr-xsysinfo/version.sh72
1 files changed, 0 insertions, 72 deletions
diff --git a/sysinfo/version.sh b/sysinfo/version.sh
deleted file mode 100755
index f510a32..0000000
--- a/sysinfo/version.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/sh
-
-set -eu
-
-usage()
-{
-cat << EOF >&2
-
-Usage:
- -h show this HELP message
- -s SRCDIR set source directory
- -o OUTPUT set output header
- -p PREFIX set macro prefix
-
-EOF
-exit 1
-}
-
-
-# one
-workdir=$(pwd)
-srcdir=
-output=
-prefix=
-
-
-while getopts "hs:o:p:" opt; do
- case $opt in
- h)
- usage
- ;;
- s)
- srcdir="$OPTARG"
- ;;
- o)
- output="$OPTARG"
- ;;
- p)
- prefix="$OPTARG"
- ;;
- \?)
- printf "Invalid option: -%s" "$OPTARG" >&2
- usage
- ;;
- esac
-done
-
-
-# two
-if [ -z "$srcdir" ] || [ -z "$output" ] || [ -z "$prefix" ]; then
- usage
-fi
-
-cd "$srcdir"
-
-gitver=$(git rev-parse --verify HEAD 2>/dev/null) || gitver="unknown"
-cvdate=$(git show -s --format=%ci $gitver 2>/dev/null) || cvdate=$(date)
-
-vmacro=$(printf '%s' "$prefix"'_GIT_VERSION' | tr '[:lower:]' '[:upper:]')
-dmacro=$(printf '%s' "$prefix"'_GIT_DATE ' | tr '[:lower:]' '[:upper:]')
-
-cd "$workdir"
-
-
-# three
-printf '#define %s "%s"\n#define %s "%s"\n' \
- "$vmacro" "$gitver" \
- "$dmacro" "$cvdate" \
- > "$output"
-
-# all done
-exit 0