forked from pandoc/lua-filters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (32 loc) · 1.1 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
FILTERS=$(wildcard $(shell find * -type d | grep -v '[/\\]'))
FILTER_FILES=$(shell find * -name "*.lua" -type f)
LUA_FILTERS_TEST_IMAGE = tarleb/lua-filters-test
.PHONY: test show-args docker-test docker-test-image archive
test:
sh runtests.sh $(FILTERS)
archive: .build/lua-filters.tar.gz
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
.build/lua-filters: $(FILTER_FILES)
mkdir -p .build/lua-filters
cp -a $(FILTER_FILES) .build/lua-filters
cp -a LICENSE .build/lua-filters
@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" "$@"
clean:
rm -rf .build
$(foreach f,$(FILTERS),make -C $(f) clean;)