forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplchk.mk
81 lines (60 loc) · 2.87 KB
/
splchk.mk
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
.PHONY = splchk splchk-docs splchk-changed splchk-json splchk-code
KAZOO_DICT = .aspell.en.pws
KAZOO_REPL = .aspell.en.prepl
$(ROOT)/$(KAZOO_DICT):
@$(file >$(ROOT)/$(KAZOO_DICT),personal_ws-1.1 en 0 utf-8)
$(ROOT)/$(KAZOO_REPL):
@$(file >$(ROOT)/$(KAZOO_REPL),personal_repl-1.1 en 0 utf-8)
splchk-init: $(ROOT)/$(KAZOO_DICT) $(ROOT)/$(KAZOO_REPL)
splchk: splchk-changed
ifeq ($(wildcard $(CURDIR)/doc/*.md),)
splchk-docs:: splchk-init
else
DOCS := $(shell find doc -type f -name "*.md" -o -regex "doc/mkdocs/.+" -prune)
splchk-docs:: splchk-init $(addsuffix .chk,$(basename $(DOCS)))
endif
ifneq ($(wildcard $(CURDIR)/priv/templates/*),)
TEMPLATES := $(shell find $(CURDIR)/priv/templates -type f)
splchk-docs:: splchk-init $(addsuffix .chk,$(basename $(TEMPLATES)))
endif
ifneq ($(wildcard $(CURDIR)/test/rendered-templates/*),)
RENDERED_TEMPLATES := $(shell find $(CURDIR)/test/rendered-templates -type f)
splchk-docs:: splchk-init $(addsuffix .chk,$(basename $(RENDERED_TEMPLATES)))
endif
ifneq ($(wildcard $(CURDIR)/priv/*/templates/*),)
TEMPLATES := $(shell find $(CURDIR)/priv/*/templates/ -type f)
splchk-docs:: splchk-init $(addsuffix .chk,$(basename $(TEMPLATES)))
endif
JSON := $(wildcard $(CURDIR)/priv/couchdb/schemas/*.json)
ifeq ($(JSON),)
splchk-json: splchk-init
else
splchk-json: splchk-init $(addsuffix .chk,$(basename $(JSON)))
endif
ESCRIPTS := $(wildcard $(CURDIR)/scripts/*.escript)
SRC := $(wildcard $(CURDIR)/src/*.*rl) $(wildcard $(CURDIR)/src/*/*.erl) $(wildcard $(CURDIR)/include/*.hrl)
CODE := $(SRC) $(ESCRIPTS)
ifeq ($(CODE),)
splchk-code: splchk-init
else
splchk-code: splchk-init $(addsuffix .chk,$(basename $(CODE)))
endif
splchk-changed: splchk-init $(addsuffix .chk,$(basename $(CHANGED)))
%.chk: %.md
@aspell --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<
%.chk: %.json
@aspell --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<
%.chk: %.text
@aspell --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<
%.chk: %.tmpl
@aspell --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<
%.chk: %.erl
@aspell --add-filter-path=$(ROOT) --mode=erlang --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<
%.chk: %.escript
@aspell --add-filter-path=$(ROOT) --mode=erlang --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<
%.chk: %.hrl
@aspell --add-filter-path=$(ROOT) --mode=erlang --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<
%.chk: %.html
@aspell --add-filter-path=$(ROOT) --mode=html --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<
%.chk: Makefile
@aspell --add-filter-path=$(ROOT) --mode=erlang --home-dir=$(ROOT) --personal=$(KAZOO_DICT) --repl=$(KAZOO_REPL) --lang=en -x check $<