-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
45 lines (36 loc) · 1.07 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
39
40
41
42
43
44
45
#
# Makefile
# ajdiaz, 2016-02-07 09:19
#
SRCDIR=src
OUTBIN=./bashdoc
REQUIREMENTS=./requirements.txt
all:
cat $(SRCDIR)/blib > $(OUTBIN)
find $(SRCDIR) ! -name "blib" -type f -exec cat {} \; >> $(OUTBIN)
@while read line; do \
echo "std::installed '$$line' || " \
"err::trace '$$line is required but not found'" >> $(OUTBIN); \
done <$(REQUIREMENTS)
@echo 'main "$$@"' >> $(OUTBIN)
@chmod 755 $(OUTBIN)
@ls -l $(OUTBIN)
test: test_html test_md test_man
test_html:
@$(OUTBIN) -T test -f README.md -o test.html bashdoc && \
diff -Naurr test.html test/test.html || { echo "Test KO"; exit 1; } && \
rm -f test.html
test_md:
@$(OUTBIN) -T test -f README.md -o test.md -F md bashdoc && \
diff -Naurr test.md test/test.md || { echo "Test KO"; exit 1; } && \
rm -f test.md
test_man:
@$(OUTBIN) -T test -f README.md -o test.1 -F man bashdoc && \
diff -Naurr test.1 test/test.1 || { echo "Test KO"; exit 1; } && \
rm -f test.1
doc: all
$(OUTBIN) -T bashdoc -A bashdoc -f README.md -o doc/bashdoc.html bashdoc
clean:
rm -f $(OUTBIN) test.html
# vim:ft=make
#