From ac4b80be810fc615b426557ad86f0cb8092f5304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Thu, 3 Dec 2020 17:18:03 +0100 Subject: add files --- buch/papers/scripts/mkmakefile | 95 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 buch/papers/scripts/mkmakefile (limited to 'buch/papers/scripts/mkmakefile') 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 <> 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 + -- cgit v1.2.1