aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 6bef258ad45b0c70dc556bb87340e4cfdd471f7f (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
26
27
28
29
30
31
HIGHLIGHT_FLAGS= --syntax=c --inline-css

MD_FILES = $(shell find . -type f -name '*.md')
SRC_FILES = $(shell find -name "*.c" -type f)
HDR_FILES = $(shell find -name "*.h" -type f)


HTML_FILES = $(patsubst %.md, %.html, $(MD_FILES))
HTML_FILES += $(patsubst %.c, %-c.html, $(SRC_FILES))
HTML_FILES += $(patsubst %.h, %-h.html, $(HDR_FILES))

index.html: $(HTML_FILES) index.sh
	sh index.sh $(HTML_FILES) | pandoc --output $@

%.html: %.md
	pandoc $^ --output $@

%-c.html: %.c
	highlight $(HIGHLIGHT_FLAGS) --output $@ $^

%-h.html: %.h
	highlight $(HIGHLIGHT_FLAGS) --output $@ $^

.PHONY: all clean

all: $(HTML_FILES) index.html

clean:
	rm -rf $(HTML_FILES)
	rm index.html