-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (73 loc) · 2.85 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#***************************************************************************
# $Id$
#
# Purpose: makefile for doc. --> generate html and pdf files from an md file
#
#***************************************************************************
#***************************************************************************
.SUFFIXES : .md .html .pdf
#.SILENT :
#***************************************************************************
## get object file names from source file names
PROJECT = linux-server
FILELIST = contents.txt
GENDIR = "Generated/"
PUBDIR = "../deatrich.github.io/linux-home-server/current/"
MDFILE = $(PROJECT).md
MDFILES = $(shell cat ${FILELIST})
HTMLOBJECT = $(MDFILE:.md=.html)
PDFOBJECT = $(MDFILE:.md=.pdf)
PDFVIEWER = evince
HTMLVIEWER = firefox
IMAGES = gitweb-example.png
#***************************************************************************
PRINTOPT =
PANDOC_OPTS = --toc --toc-depth=3 --syntax-definition=console.xml \
--highlight-style=custom-highlight.theme
PANDOC_HTML_OPTS = -c https://latex.now.sh/style.css \
-c https://deatrich.github.io/style.css \
--template template.htm -V lastupdate="`date +'%d %B %Y'`"
PANDOC_PDF_OPTS = --template=template.latex -V geometry:margin=2cm \
--pdf-engine=xelatex
#***************************************************************************
## DEFAULT GOAL
all: $(HTMLOBJECT) $(PDFOBJECT)
test:
echo "$(MDFILES)"
#***************************************************************************
## DEPENDENCIES
$(PDFOBJECT): $(MDFILES) template.latex console.xml custom-highlight.theme \
$(IMAGES)
$(HTMLOBJECT): $(MDFILES) template.htm console.xml custom-highlight.theme \
$(IMAGES)
#***************************************************************************
## GENERAL RULES
html: $(HTMLOBJECT)
pdf: $(PDFOBJECT)
showhtml: $(HTMLOBJECT)
$(HTMLVIEWER) $(HTMLOBJECT)
showpdf: $(PDFOBJECT)
$(PDFVIEWER) $(PDFOBJECT)
copies: $(PDFOBJECT) $(HTMLOBJECT)
cp -upv $(PDFOBJECT) $(IMAGES) $(GENDIR)/
cp -upv $(HTMLOBJECT) $(IMAGES) $(GENDIR)/
publish: $(PDFOBJECT) $(HTMLOBJECT)
cp -iupv $(PDFOBJECT) $(IMAGES) $(PUBDIR)/
cp -iupv $(HTMLOBJECT) $(IMAGES) $(PUBDIR)/
help:
@echo ""
@echo "make all -- update all file types"
@echo "make html -- update the html file"
@echo "make pdf -- update the pdf file"
@echo "make showhtml -- show the html file"
@echo "make showpdf -- show the pdf file"
@echo "make copies -- push html and pdf copies to generated area"
@echo "make publish -- push html and pdf copies to web site"
@echo "make clean -- clean up generated files"
.md.html :
pandoc -s $(MDFILES) $(PANDOC_OPTS) $(PANDOC_HTML_OPTS) -o $(HTMLOBJECT)
.md.pdf :
pandoc -s $(MDFILES) $(PANDOC_OPTS) $(PANDOC_PDF_OPTS) -o $(PDFOBJECT)
## manually clean up generated files from time to time
clean:
-rm -i *.html *.pdf