aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_head.c1
-rw-r--r--_tail.c21
-rwxr-xr-xcreate_TZR.c.sh4
-rwxr-xr-xcreate_TZR.h.sh2
4 files changed, 27 insertions, 1 deletions
diff --git a/_head.c b/_head.c
new file mode 100644
index 0000000..afa4308
--- /dev/null
+++ b/_head.c
@@ -0,0 +1 @@
+/* Licensing information can be found at the end of the file. */
diff --git a/_tail.c b/_tail.c
new file mode 100644
index 0000000..fd8ac30
--- /dev/null
+++ b/_tail.c
@@ -0,0 +1,21 @@
+/*
+** Copyright (c) 2023 kdx
+**
+** Permission is hereby granted, free of charge, to any person obtaining a copy
+** of this software and associated documentation files (the "Software"), to
+** deal in the Software without restriction, including without limitation the
+** rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+** sell copies of the Software, and to permit persons to whom the Software is
+** furnished to do so, subject to the following conditions:
+**
+** The above copyright notice and this permission notice shall be included in
+** all copies or substantial portions of the Software.
+**
+** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+** IN THE SOFTWARE.
+*/
diff --git a/create_TZR.c.sh b/create_TZR.c.sh
index 0057a60..edccc09 100755
--- a/create_TZR.c.sh
+++ b/create_TZR.c.sh
@@ -10,10 +10,12 @@ for FILE in sources/*.h sources/*.c; do
grep -v '^#include' "$FILE" | grep -v "^#pragma" >>"$BUILDDIR/sources"
done
-sort -u "$BUILDDIR/includes" >"$BUILDDIR/out"
+cp _head.c "$BUILDDIR/out"
+sort -u "$BUILDDIR/includes" >>"$BUILDDIR/out"
printf '\n' >>"$BUILDDIR/out"
cat "$BUILDDIR/sources" >>"$BUILDDIR/out"
printf '\n' >>"$BUILDDIR/out"
+cat _tail.c >>"$BUILDDIR/out"
git log -n1 --format="/* commit hash: %H */" >>"$BUILDDIR/out"
cp "$BUILDDIR/out" TZR.c
diff --git a/create_TZR.h.sh b/create_TZR.h.sh
index 393ccaa..695ae42 100755
--- a/create_TZR.h.sh
+++ b/create_TZR.h.sh
@@ -20,6 +20,7 @@ HEADER=TZR_light ProcessHeader
HEADER=TZR_keystate ProcessHeader
HEADER=TZR ProcessHeader
+cp _head.c "$BUILDDIR/out"
printf '#pragma once\n' >>"$BUILDDIR/out"
sort -u "$BUILDDIR/includes" >>"$BUILDDIR/out"
cat <<EOF >>"$BUILDDIR/out"
@@ -30,6 +31,7 @@ EOF
printf '\n' >>"$BUILDDIR/out"
cat "$BUILDDIR/sources" >>"$BUILDDIR/out"
printf '\n' >>"$BUILDDIR/out"
+cat _tail.c >>"$BUILDDIR/out"
git log -n1 --format="/* commit hash: %H */" >>"$BUILDDIR/out"
cp "$BUILDDIR/out" TZR.h