-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
40 lines (25 loc) · 970 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
37
38
39
all : unpack-examples html
serve-static :
( cd etc/service/httpd && ./run )
serve-full :
( cd etc/service && svscan . )
EXAMPLES_GZ = $(shell find htdocs/data/example -name \*.gz | sort)
EXAMPLES = $(EXAMPLES_GZ:%.gz=%)
unpack-examples: $(EXAMPLES)
htdocs/data/example/% : htdocs/data/example/%.gz
gunzip -c < $< > $@
LOG_FILES = $(EXAMPLES) $(shell find -L htdocs/data -type f -a -not -path "htdocs/data/example/*" -a -not -name ".*" | sort)
html : htdocs/index.html
htdocs/index.html : templates/index.html htdocs/logfiles.html
@echo "rebuilding page..."
@LOGFILES_HTML=`tr -d '\n' < htdocs/logfiles.html` ; sed -e "s|%%LOGFILES_HTML%%|$$LOGFILES_HTML|;" templates/index.html > $@
htdocs/logfiles.html : force $(LOG_FILES)
@echo $^ \
| sed -e 's/^force //' \
| tr ' ' '\n' \
| sed -e 's|^htdocs/||' \
| while read f; do \
sed -e "s|%%VALUE%%|$$f|; s|%%TITLE%%|$$f|;" templates/option.html \
; done > $@
.PHONY : force
.DELETE_ON_ERROR :