-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
102 lines (79 loc) · 2.23 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
98
99
100
101
# This Makefile renders the RestructuredText (.rst) content to HTML,
# renders the .svg files to .png images, and otherwise prepares the
# presentation for viewing.
# COMMAND PATHS
#
# There are here so that we can override them on the commandline if
# necessary (e.g., on OS X, where Inkscape might be
# /Applications/Inkscape.app/MacOS/Resources/bin/inkscape or something).
RST2HTML = rst2html.py
RST2S5 = rst2slides
INKSCAPE = inkscape
# S5 CONFIGURATION
THEME = seas
#THEME_ARG = --theme-url ui/$(THEME)
#THEME_ARG = --stylesheet-dirs=ui/$(THEME)
# SOURCE FILES
#
# These are the "sources" for our presentation.
RSTDOCS = \
rst/git.rst \
rst/history_of_vc.rst \
rst/intro.rst \
rst/seealso.rst \
rst/subversion.rst \
rst/vc_models.rst \
rst/version-control.rst \
rst/why_use_vc.rst \
rst/vocabulary.rst
SVGDOCS = $(shell ls images/*.svg)
# GENERATED CONTENT
#
# These are things we generate.
HTMLDOCS = index.html slides.html README.html
PNGDOCS = $(SVGDOCS:.svg=.png)
# STATIC CONTENT
#
# These are files that we use as-is.
STATIC = \
images/git-transport.png \
ui/seas/star.png \
ui/seas/seas-logo.png \
ui/seas/framing.css \
ui/seas/pretty.css \
ui/seas/print.css \
ui/seas/iepngfix.htc \
ui/seas/blank.gif \
ui/seas/slides.js \
ui/seas/opera.css \
ui/seas/outline.css \
ui/seas/s5-core.css \
ui/seas/slides.css
# Where to install the rendered presentation.
DESTDIR = ./output
# A list of all generated documents (so we can remove them).
#GENERATED = $(HTMLDOCS) $(PNGDOCS)
GENERATED = $(HTMLDOCS)
# PATTERN RULES
#
# These rules are applied based on file extensions.
%.html: %.rst
$(RST2HTML) $< $@
%.s5.html: %.rst
$(RST2S5) $(THEME_ARG) $< $@
%.png: %.svg
env LANG=C DISPLAY= $(INKSCAPE) -D -f $< -e $@
# TARGETS
all: $(HTMLDOCS) $(PNGDOCS) $(STATIC)
clean:
rm -f $(GENERATED)
view: all
firefox index.html
# The ``install`` target copies the final content to $(DESTDIR). If
# a script named ``deploy`` exists in the current directory, it will be
# called with $(DESTDIR) as its only argument.
install: all
find $(HTMLDOCS) $(PNGDOCS) $(STATIC) -print | cpio -pud $(DESTDIR)
test -x deploy && ./deploy $(DESTDIR) || exit 0
# Tell Make about the depdencies of the presentation.
index.html slides.html : $(RSTDOCS)