aboutsummaryrefslogtreecommitdiffstats
path: root/buch/papers/scripts/mkmakefile
diff options
context:
space:
mode:
authorAndreas Müller <andreas.mueller@hsr.ch>2020-12-03 17:18:03 +0100
committerAndreas Müller <andreas.mueller@hsr.ch>2020-12-03 17:18:03 +0100
commitac4b80be810fc615b426557ad86f0cb8092f5304 (patch)
tree2afe81a7f8a178fa479a91bec4cf61a54f8eae9f /buch/papers/scripts/mkmakefile
parentsome more ideas (diff)
downloadSeminarMatrizen-ac4b80be810fc615b426557ad86f0cb8092f5304.tar.gz
SeminarMatrizen-ac4b80be810fc615b426557ad86f0cb8092f5304.zip
add files
Diffstat (limited to 'buch/papers/scripts/mkmakefile')
-rw-r--r--buch/papers/scripts/mkmakefile95
1 files changed, 95 insertions, 0 deletions
diff --git a/buch/papers/scripts/mkmakefile b/buch/papers/scripts/mkmakefile
new file mode 100644
index 0000000..9590119
--- /dev/null
+++ b/buch/papers/scripts/mkmakefile
@@ -0,0 +1,95 @@
+#
+# mkmakefile -- build the Makefile.inc for all the papers
+#
+# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+#
+
+#
+# Header of the Makefile.inc
+#
+cat >common/Makefile.inc <<EOF
+#
+# Makefile.inc -- Makefile Targets und Variablen für Papers
+#
+# Achtung: dieses File wird erzeugt vom Skript scripts/mkmakefile
+#
+# (c) 2020 Prof Dr Andreas Müller, Hochschule Rapperswil
+#
+EOF
+
+#
+# add dependency variables for the main paper files
+#
+awk 'BEGIN {
+ printf("PAPERFILES = \\\n")
+ printf("\tpapers/part2.tex \\\n")
+ printf("\tpapers/uebersicht.tex \\\n")
+}
+{
+ printf("\tpapers/%s/main.tex \\\n", $1)
+}
+END {
+ printf("\t\n")
+}' common/paperlist >> common/Makefile.inc
+
+#
+# generate bibliographic dependency variables and commands
+#
+awk 'BEGIN {
+ counter=1
+}
+{
+ printf("buch%d-blx.bbl:\tbuch%d-blx.aux\n", counter, counter)
+ printf("\tbibtex buch%d-blx\n\n", counter)
+ counter++
+}
+END {
+ printf("buch%d-blx.bbl:\tbuch%d-blx.aux\n", counter, counter)
+ printf("\tbibtex buch%d-blx\n\n", counter)
+ printf("BLXFILES = buch.bbl \\\n")
+ for (i = 1; i <= counter; i++) {
+ printf("\tbuch%d-blx.bbl \\\n", i)
+ }
+ #printf("\tbuch%d-blx.bbl\n", i)
+ printf("\n")
+}' common/paperlist >> common/Makefile.inc
+
+#
+# generate a directory list for
+#
+awk 'BEGIN {
+ printf("PAPER_DIRECTORIES = \\\n")
+}
+{
+ printf("\t%s \\\n", $1)
+}
+END {
+ printf("\t\n")
+}' common/paperlist >> common/Makefile.inc
+
+#
+# generate a list of Makefile.inc to be used by the top level makefile
+#
+awk 'BEGIN {
+ printf("PAPER_MAKEFILEINC = \\\n")
+}
+{
+ printf("\tpapers/%s/Makefile.inc \\\n", $1)
+}
+END {
+ printf("\t\n")
+}' common/paperlist >> common/Makefile.inc
+
+#
+# add include directives for all papers
+#
+awk '{
+ printf("include papers/%s/Makefile.inc\n", $1)
+ texfiles = sprintf("%s\t$(dependencies-%s) \\\n", texfiles, $1);
+}
+END {
+ printf("\n")
+ printf("TEXFILES = \\\n")
+ printf("%s\n", texfiles)
+}' common/paperlist > common/includes.inc
+