-
-
Notifications
You must be signed in to change notification settings - Fork 167
/
Makefile
58 lines (45 loc) · 1.48 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
46
47
48
49
50
51
52
53
54
55
56
57
58
FILTERS=$(wildcard $(shell find * -type d | grep -v '[/\\]'))
FILTER_FILES=$(shell find * -name "*.lua" -type f)
LUA_FILTERS_TEST_IMAGE = pandoc/lua-filters-test
.PHONY: test show-args docker-test docker-test-image archive
test:
sh runtests.sh $(FILTERS)
archive: .build/lua-filters.tar.gz
archives: .build/lua-filters.tar.gz .build/lua-filters.zip
show-vars:
@printf "FILTERS: %s\n" $(FILTERS)
@printf "FILTER_FILES: %s\n" $(FILTER_FILES)
docker-test:
docker run \
--rm \
--volume "$(PWD):/data" \
--entrypoint /usr/bin/make \
$(LUA_FILTERS_TEST_IMAGE) FILTERS="${FILTERS}"
docker-test-image: .tools/Dockerfile
docker build --tag $(LUA_FILTERS_TEST_IMAGE) --file $< .
# Build a single collection of Lua filters
.PHONY: collection
collection: .build/lua-filters
.PHONY: docs
docs:
.build/lua-filters: $(FILTER_FILES) docs \
CONTRIBUTING.md LICENSE README.md
mkdir -p $@
mkdir -p $@/filters
mkdir -p $@/docs
cp -a CONTRIBUTING.md LICENSE README.md $@
cp -a $(FILTER_FILES) $@/filters
for filter in $(FILTERS); do \
cp $$filter/README.md $@/docs/$$filter.md; \
done
@printf "Filters collected in '%s'\n" "$@"
.build/lua-filters.tar.gz: .build/lua-filters
tar -czf $@ -C .build lua-filters
@printf "Archive written to '%s'\n" "$@"
.build/lua-filters.zip: .build/lua-filters
rm -f $@
(cd .build && zip -r -9 lua-filters.zip lua-filters)
@printf "Archive written to '%s'\n" "$@"
clean:
rm -rf .build
$(foreach f,$(FILTERS),make -C $(f) clean;)