From 6044a3bac4433e9ce8d114bdbc180ca7b48b2344 Mon Sep 17 00:00:00 2001 From: kdx Date: Fri, 28 Apr 2023 12:41:18 +0200 Subject: embed license in out files --- _head.c | 1 + _tail.c | 21 +++++++++++++++++++++ create_TZR.c.sh | 4 +++- create_TZR.h.sh | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 _head.c create mode 100644 _tail.c 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 <>"$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 -- cgit v1.2.3