summaryrefslogtreecommitdiff
path: root/create_FLD.cpp.sh
blob: e6bce11c46f0577aa1facc8a37646327328147ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
BUILDDIR=build_FLD.cpp
rm -Rf "$BUILDDIR"
mkdir -p "$BUILDDIR"

for FILE in src/FLD.hpp src/*.cpp; do
	grep "^#include <" "$FILE" >>"$BUILDDIR/includes"
	printf '/* %s */\n' "$FILE" >>"$BUILDDIR/sources"
	grep -v '^#include' "$FILE" \
		| grep -v "^#pragma" \
		>>"$BUILDDIR/sources"
done

cp _head.cpp "$BUILDDIR/out"
sort -u "$BUILDDIR/includes" >>"$BUILDDIR/out"
cat "$BUILDDIR/sources" >>"$BUILDDIR/out"
printf '\n' >>"$BUILDDIR/out"
cat _tail.cpp >>"$BUILDDIR/out"
git log -n1 --format="/* commit hash: %H */" >>"$BUILDDIR/out"

cp "$BUILDDIR/out" FLD.cpp