-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
39 lines (29 loc) · 1.17 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
SRC := $(wildcard draft-*.adoc)
TXT := $(patsubst %.adoc,%.txt,$(SRC))
XML := $(patsubst %.adoc,%.xml,$(SRC))
HTML := $(patsubst %.adoc,%.html,$(SRC))
NITS := $(patsubst %.adoc,%.nits,$(SRC))
SHELL := /bin/bash
# Ensure the xml2rfc cache directory exists locally
IGNORE := $(shell mkdir -p $(HOME)/.cache/xml2rfc)
all: $(TXT) $(HTML) $(XML) $(NITS)
clean:
rm -f $(TXT) $(HTML) $(XML)
%.xml: %.adoc
#bundle exec asciidoctor -r ./lib/glob-include-processor.rb -r asciidoctor-rfc -b rfc2 $^ --trace > $@
bundle exec asciidoctor -r ./lib/glob-include-processor.rb -r asciidoctor-rfc -b rfc2 -a flush-biblio=true $^ --trace > $@
%.xml3: %.adoc
#bundle exec asciidoctor -r ./lib/glob-include-processor.rb -r asciidoctor-rfc -b rfc2 $^ --trace > $@
bundle exec asciidoctor -r ./lib/glob-include-processor.rb -r asciidoctor-rfc -b rfc3 -a flush-biblio=true $^ --trace > $@
%.txt: %.xml
xml2rfc --text $^ $@
%.html: %.xml
xml2rfc --html $^ $@
%.nits: %.txt
VERSIONED_NAME=`grep :name: $*.adoc | cut -f 2 -d ' '`; \
cp $^ $${VERSIONED_NAME}.txt && \
idnits --verbose $${VERSIONED_NAME}.txt > $@ && \
cp $@ $${VERSIONED_NAME}.nits && \
cat $${VERSIONED_NAME}.nits
open:
open *.txt