forked from Upipe/upipe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
107 lines (97 loc) · 3.19 KB
/
Makefile.am
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = lib include tests examples x86
if BUILD_LUAJIT
SUBDIRS += luajit
endif
EXTRA_DIST = doc/changelog.mkdoc \
doc/dependencies.dot \
doc/fdl-1.3.mkdoc \
doc/html_title.tmpl \
doc/intro.mkdoc \
doc/mkdoc.conf \
doc/overview.mkdoc \
doc/reference.mkdoc \
doc/rules.mkdoc \
doc/template.mkdoc \
doc/top.mkdoc \
doc/tutorials.mkdoc
doc: doc/dependencies.png
mkdoc --doc-path $(srcdir)/doc -I $(srcdir)/include `cd $(srcdir)/include; ls */*.h`
doc/dependencies.png: $(srcdir)/doc/dependencies.dot
$(MKDIR_P) doc/
dot -Tpng $< > $@
.PHONY: doc
check-whitespace:
@check_attr() { \
git check-attr $$2 "$$1" | grep -q ": $$3$$"; \
}; \
pfx="^ *\([0-9]*\) "; \
git ls-files -- :$(srcdir)/*.[ch] | while read file; do \
check_attr "$$file" binary set && continue; \
check_attr "$$file" check-coding-style unset && continue; \
out=$$({ \
cat -n "$$file" | sed -n \
-e "s/$$pfx.* $$/\1: trailing whitespace/p" \
-e "s/$$pfx.* .*/\1: invalid tab/p" \
-e "1s/$$pfx$$/\1: leading newline/p" \
-e "\$$s/$$pfx$$/\1: trailing newline/p"; \
{ cat "$$file"; echo '#'; } | cat -n | sed -n \
-e "\$$s/$$pfx..*#$$/\1: missing newline/p"; \
} | while read -r line; do echo "$$file:$$line"; done); \
test -n "$$out" && echo "$$out" && ret=1; \
test -z "$$ret"; \
done
check-untracked:
@if git ls-files $(srcdir) --others --exclude-standard | grep .; then exit 1; fi
check-headers:
@if [ "$(AM_COLOR_TESTS)" != "no" ]; then \
if [ "$(AM_COLOR_TESTS)" = "always" -o -t 1 ]; then \
red='[0;31m'; grn='[0;32m'; std='[m'; \
fi; \
fi; \
for header in $(srcdir)/include/*/*.h; do \
h=$${header#$(srcdir)/include/}; \
if [ $$h != "upipe/config.h" ]; then \
guard=$$(echo _$${h}_ | tr [a-z] [A-Z] | tr '/.-' _); \
if ! grep -q $$guard $$header; then \
echo "$${red}FAIL$${std}: $$h: invalid guard"; ret=1; \
fi; \
if ! grep -q Copyright $$header; then \
echo "$${red}FAIL$${std}: $$h: missing copyright"; ret=1; \
fi; \
fi; \
if $(CC) -I$(srcdir)/include -I$(builddir)/include \
$(CPPFLAGS) $(CFLAGS) $(AM_CFLAGS) -Werror \
-include $$header -c -x c /dev/null -o /dev/null; \
then echo "$${grn}PASS$${std}: $$h"; \
else echo "$${red}FAIL$${std}: $$h"; ret=1; \
fi; \
done; \
test -z "$$ret"
check-spelling:
@codespell \
--skip=$(srcdir)/lib/upipe-blackmagic/include \
--skip=$(srcdir)/lib/upipe-modules/http-parser \
--ignore-words-list multicat,happend,inout,parms,hist \
--ignore-regex '"te\.' \
$(srcdir)/doc \
$(srcdir)/examples \
$(srcdir)/include \
$(srcdir)/lib \
$(srcdir)/luajit \
$(srcdir)/tests \
$(srcdir)/x86
check-tests:
@if [ "$(AM_COLOR_TESTS)" != "no" ]; then \
if [ "$(AM_COLOR_TESTS)" = "always" -o -t 1 ]; then \
red='[0;31m'; grn='[0;32m'; std='[m'; \
fi; \
fi; \
cd $(srcdir)/tests; \
for src in *.c; do \
if grep -q '^#undef NDEBUG' $$src; \
then echo "$${grn}PASS$${std}: $$src"; \
else echo "$${red}FAIL$${std}: $$src"; ret=1; \
fi; \
done; \
test -z "$$ret"