-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (34 loc) · 1.12 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
# Build published programs
.SILENT:
# output file formats
# add any format supported by pandoc: pdf, html, odt, docx...
FORMATS = pdf html
# languages supported
LANGUAGES = sh pl py c cpp java
# build all filename targets
FILES = $(foreach _format,$(FORMATS),literate.$(_lang).$(_format))
TARGETS = $(foreach _lang,$(LANGUAGES),$(FILES))
########################################################################
# Rules
########################################################################
all: $(TARGETS)
# required packages: pandoc texlive
SYNTAX = -s --highlight-style pygments
%.html: %.md
pandoc $< $(SYNTAX) -o $@
%.pdf: %.md
pandoc $< $(SYNTAX) -o $@
%.odt: %.md
pandoc $< $(SYNTAX) -o $@
%.docx: %.md
pandoc $< $(SYNTAX) -o $@
########################################################################
# Utilities
########################################################################
# required: sh, perl, python, gcc, gcc-c++, java...
run:
$(foreach _lang,$(LANGUAGES),./run-md literate.$(_lang).md;)
clean:
rm -f $(foreach _format,$(FORMATS),*.$(_format))
build: clean all
# vim:ai:noet:sw=4:ts=4:syntax=make