make/meson: Generate a `version.h'
Using a header file allows us to keep the version string out of the
compiler command line. This should heavily increase direct hits with
ccache. Specifying the compiler argument for a single source file is
rather clumsy with Meson, hence the more pompous header file.
Change-Id: If6c4e33e4944d2b264252dbcd2fd69ecf7bd8905
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/355
Reviewed-by: Felix Singer <felixsinger@posteo.net>
diff --git a/include/version.h.in b/include/version.h.in
new file mode 100644
index 0000000..1bb7fd4
--- /dev/null
+++ b/include/version.h.in
@@ -0,0 +1,20 @@
+/*
+ * This file is part of the flashprog project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef FLASHPROG_VERSION_H
+#define FLASHPROG_VERSION_H
+
+#define FLASHPROG_VERSION "@VERSION@"
+
+#endif