-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (43 loc) · 1.42 KB
/
Makefile
File metadata and controls
55 lines (43 loc) · 1.42 KB
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
MAKEFILE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
include $(MAKEFILE_DIR)/standard_defs.mk
DOC_SRC := $(wildcard bash/*.sh)
BIN_SRC := $(filter-out %.sh,$(wildcard bash/*))
all: package
clean:
rm -rf dist
.PHONY: test test_bats
test: test_bats
bash tests/run.sh
test_bats:
tests/bats/bin/bats tests/*.bats
package: package_scripts
publish: package gh-create-draft-release
if [ "$(RELEASABLE)" = "yes" ];then \
$(GH_RELEASE) upload $(VERSION) dist/*.tar.gz; \
fi
.PHONY: package_scripts
package_scripts: dist/doc-$(VERSION).tar.gz dist/bin-$(VERSION).tar.gz dist/lib-$(VERSION).tar.gz
dist/doc-$(VERSION).tar.gz: $(DOC_SRC) bash/bashadoc
mkdir -p dist/doc/bash
for inc in $$(find bash -name \*.sh); do \
mdname=$$(echo $$inc | sed -e 's/\.sh/\.md/') ; \
bash/bashadoc $$inc > dist/doc/$$mdname ; done
tar -zcf dist/doc-$(VERSION).tar.gz -C dist doc
rm -rf dist/doc
dist/bin-$(VERSION).tar.gz: $(DOC_SRC) $(BIN_SRC) bash/pack-script
mkdir -p dist/bin
for s in $$(find bash -maxdepth 1 -type f ! -name '*.sh' -perm -u+x -print); do \
base=$$(basename $$s) ; \
if grep -q "includer" $$s; then \
bash/pack-script -v -f $$s -o dist/bin/$$base ; \
else \
cp $$s dist/bin/$$base ; \
fi ; \
done
tar -zcf dist/bin-$(VERSION).tar.gz -C dist bin
rm -rf dist/bin
dist/lib-$(VERSION).tar.gz: $(DOC_SRC)
mkdir -p dist/lib
cp bash/*.sh dist/lib
tar -zcf dist/lib-$(VERSION).tar.gz -C dist lib
rm -rf dist/lib