summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f0751027e60fb56fa4a3855a8f2ef5f0cdf37920 (plain)
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
.SUFFIXES:
.SUFFIXES: .txt .html

SRCS = specs/source-package-format-1.0.txt \
       specs/architecture-string.txt \
       specs/source-package-format-2.0.txt
OBJS = $(SRCS:.txt=.html)

.PHONY: all
all: $(OBJS)

$(OBJS):
	@printf '  RENDER %s\n' '$@'
	@title=$$(sed -n 's/^    Title: \(.*\)$$/\1/p' $*.txt | \
		head -n 1); \
		sed "s#@TITLE@#$$title#" include/header.html > $@
	@markdown $*.txt >> $@
	@cat include/footer.html >> $@

.PHONY: clean
clean:
	@for obj in $(OBJS); do \
		printf '  RM %s\n' "$${obj}"; \
		rm -f $${obj}; \
	done