From 7a987eb05eea31a6c70575eaf2af241b8b25dfd8 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Sat, 6 Nov 2021 08:07:12 +0100 Subject: [PATCH] Standardized Makefiles. --- Makefile | 77 +++++-------------------------------------------- Makefile.custom | 11 ------- Makefile.in | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 80 deletions(-) delete mode 100644 Makefile.custom create mode 100644 Makefile.in diff --git a/Makefile b/Makefile index 645d802..3ec813b 100644 --- a/Makefile +++ b/Makefile @@ -1,72 +1,11 @@ -SRC ?= haskelltut +SRC ?= universe-from-nothing +ODIR ?= /tmp -ODIR ?= . +export ODIR SRC +include Makefile.in -BIBLIOGRAPHY ?= bibliography -ALLSRC = $(shell find . -name "*.ms") +upload: + scp $(RAM)/$(SRC).pdf tacos:/var/www/htdocs/t.karchnu.fr/doc/ -SOELIM_OPTS ?= -SOELIM = soelim $(SOELIM_OPTS) - -SPECHAR = ./bin/utf8-to-ms.sh - -PRECONV_OPTS ?= -e utf-8 -PRECONV = preconv $(PRECONV_OPTS) - -EQN_OPTS ?= -Tpdf -EQN = eqn $(EQN_OPTS) - -# source-highlight stuff -# GH_INTRO: instructions before each source code provided by source-highlight -# GH_OUTRO: ------------ after ---- ------ ---- -------- -- ---------------- -# GH_INTRO/GH_OUTRO: values are separated by ';' -# -GH_INTRO := .b1;.nr DI 0;.DS I;.fam C -GH_OUTRO := .fam;.DE;.b2 -# -export GH_INTRO -export GH_OUTRO -# -# SHOPTS: cmd line parameter given to source-highlight -SHOPTS = --outlang-def=./.source-highlight_groff-output-definition -export SHOPTS - -# ghighlight brings `source-highlight` to troff -GHIGHLIGHT_OPTS ?= -GHIGHLIGHT = ghighlight $(GHIGHLIGHT_OPTS) - -GRAP_OPTS ?= -GRAP = grap $(GRAP_OPTS) - -PIC_OPTS ?= -PIC = pic $(PIC_OPTS) - -# -P => move ponctuation after reference -# -S => label and bracket-label options -# -e => accumulate (use a reference section) -# -p bib => bibliography file -REFER_OPTS ?= -PS -e -p $(BIBLIOGRAPHY) -REFER = refer $(REFER_OPTS) - -# -k => iconv conversion (did it ever worked?) -# -ms => ms macro -# -Tpdf => output device is PDF -GROFF_OPTS ?= -ms -t -Tpdf -GROFF = groff $(GROFF_OPTS) - -$(SRC).pdf: - cat $(SRC).ms |\ - $(SOELIM) |\ - $(SPECHAR) |\ - $(PRECONV) |\ - $(EQN) |\ - $(GHIGHLIGHT) |\ - $(GRAP) |\ - $(PIC) |\ - $(REFER) |\ - $(GROFF) > $(ODIR)/$@ - -# Keep options in memory for the recursive 'make' call -export SOELIM_OPTS PRECONV_OPTS EQN_OPTS GHIGHLIGHT_OPTS GRAP_OPTS PIC_OPTS REFER_OPTS -serve: - find . -name "*.ms" | entr gmake -B $(SRC).pdf +# VIEWER_OPTS = - +# VIEWER = zathura $(VIEWER_OPTS) diff --git a/Makefile.custom b/Makefile.custom deleted file mode 100644 index 63deaa6..0000000 --- a/Makefile.custom +++ /dev/null @@ -1,11 +0,0 @@ -SRC ?= universe-from-nothing -ODIR ?= /tmp - -export ODIR SRC -include Makefile - -upload: - scp $(RAM)/$(SRC).pdf tacos:/var/www/htdocs/t.karchnu.fr/doc/ - -# VIEWER_OPTS = - -# VIEWER = zathura $(VIEWER_OPTS) diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..385d368 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,74 @@ +SRC ?= haskelltut + +ODIR ?= . + +BIBLIOGRAPHY ?= bibliography +ALLSRC = $(shell find . -name "*.ms") + +SOELIM_OPTS ?= +SOELIM = soelim $(SOELIM_OPTS) + +SPECHAR = ./bin/utf8-to-ms.sh + +PRECONV_OPTS ?= -e utf-8 +PRECONV = preconv $(PRECONV_OPTS) + +EQN_OPTS ?= -Tpdf +EQN = eqn $(EQN_OPTS) + +# source-highlight stuff +# GH_INTRO: instructions before each source code provided by source-highlight +# GH_OUTRO: ------------ after ---- ------ ---- -------- -- ---------------- +# GH_INTRO/GH_OUTRO: values are separated by ';' +# +GH_INTRO := .b1;.nr DI 0;.DS I;.fam C +GH_OUTRO := .fam;.DE;.b2 +# +export GH_INTRO +export GH_OUTRO +# +# SHOPTS: cmd line parameter given to source-highlight +SHOPTS = --outlang-def=.source-highlight_groff-output-definition +export SHOPTS + +# ghighlight brings `source-highlight` to troff +GHIGHLIGHT_OPTS ?= +GHIGHLIGHT = ./bin/ghighlight $(GHIGHLIGHT_OPTS) + +GRAP_OPTS ?= +GRAP = grap $(GRAP_OPTS) + +PIC_OPTS ?= -Tpdf +PIC = pic $(PIC_OPTS) + +# -P => move ponctuation after reference +# -S => label and bracket-label options +# -e => accumulate (use a reference section) +# -p bib => bibliography file +REFER_OPTS ?= -PS -e -p $(BIBLIOGRAPHY) +REFER = refer $(REFER_OPTS) + +# -k => iconv conversion (did it ever worked?) +# -ms => ms macro +# -U => unsafe (because of PDF inclusion) +# -Tpdf => output device is PDF +# -mspdf => include PDF (so, images converted in PDF) in the document +GROFF_OPTS ?= -ms -t -Tpdf -U -mspdf -mpdfmark +GROFF = groff $(GROFF_OPTS) + +$(SRC).pdf: + cat $(SRC).ms |\ + $(SOELIM) |\ + $(SPECHAR) |\ + $(PRECONV) |\ + $(EQN) |\ + $(GHIGHLIGHT) |\ + $(GRAP) |\ + $(PIC) |\ + $(REFER) |\ + $(GROFF) > $(ODIR)/$@ + +# Keep options in memory for the recursive 'make' call +export SOELIM_OPTS PRECONV_OPTS EQN_OPTS GHIGHLIGHT_OPTS GRAP_OPTS PIC_OPTS REFER_OPTS +serve: + find . -name "*.ms" | entr gmake -B $(SRC).pdf