-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
36 lines (27 loc) · 946 Bytes
/
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
xml2rfc ?= xml2rfc
kramdown-rfc2629 ?= kramdown-rfc2629
drafts := draft-ietf-ippm-responsiveness.xml draft-ietf-ippm-responsiveness.txt draft-ietf-ippm-responsiveness.html draft-ietf-ippm-responsiveness.pdf
xml := $(drafts:.txt=.xml)
all: $(drafts)
%.xml: %.md
@echo "Converting MD to XML"
$(kramdown-rfc2629) $< > $@
%.txt: %.xml
@echo "Converting XML to TXT"
$(xml2rfc) $< > $@
%.html: %.xml
@echo "Converting XML to HTML"
$(xml2rfc) --html $< > $@
%.pdf: %.txt
@echo "Converting TXT to PDF"
enscript -B -o $(patsubst %.txt,%.ps,$<) $<
# Note: You may need to change to ps2pdf if you are using a non-macOS machine.
ps2pdf $(patsubst %.txt,%.ps,$<)
test: all
@echo "Spell checking"
spellchecker --plugins spell indefinite-article repeated-words syntax-urls --dictionaries dictionary.txt --files '*.md'
@echo "linting the Markdown"
markdownlint -c .markdownlint.jsonc *.md
clean:
@echo "Cleaning"
rm -rf $(drafts) *.ps