summaryrefslogtreecommitdiffhomepage
path: root/Makefile
blob: b670d3d076a852bd92c379ecf2fc2582e2e0b7b3 (plain) (blame)
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
.PHONY: check clean serve

includes := ${wildcard include/*}
srcdirs  := ${shell find src -type d}
outdirs  := ${srcdirs:src%=out%}
sources  := ${shell find src -type f -name 'index.html' -or -name '*.css' -or -name '*.svg'}
outputs  := ${sources:src/%=out/%}

all: ${outdirs} ${outputs}

${outdirs}:
	@mkdir -p $@
	@printf 'MKDIR\t%s\n' "$@"

out/%: src/%
	@cp $< $@
	@printf 'CP\t%s\n' "$@"

out/%.html: src/%.html ${includes}
	@m4 -P ${foreach dir,${^D},-I${dir}} include/lib.m4 $< >$@
	@printf 'M4\t%s\n' "$@"

src/srp/fw-ec/index.html: src/srp/fw-ec/led.diff.html
	@touch $@

check:
	LANG=en_US find src -name 'index.html' -exec \
		aspell --home-dir=./ --ignore-case check {} \;

clean:
	rm -rf out

serve:
	darkhttpd out --daemon