-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (40 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
43
44
45
46
47
BASH=/bin/bash
concat:
@echo '#!/bin/bash' >imosh
@echo '# imosh is a utility library for BASH.' >>imosh
@echo '#' >>imosh
@echo '# For more details, see https://github.com/imos/imosh' >>imosh
@echo '' >>imosh
@echo "IMOSH_VERSION='$$(git log --pretty=format:'%ci (%h)' library | head -n 1)'" >>imosh
@echo '' >>imosh
@for directory in library/*; do \
for file in "$${directory}"/*.sh "$${directory}"/*/*.sh; do \
if [ -f "$${file}" ]; then \
cat "$${file}"; \
echo; \
fi; \
done; \
done >> imosh
@chmod +x imosh
@chmod +x tool/update-readme.sh
@./tool/update-readme.sh
@IMOSH_USE_DEFINE_FLAGS=1 \
./tool/print-flag-variables.sh > library/90-flags/50-variables.sh
.PHONY: concat
all: info bug test
info:
$(BASH) --version
env
$(BASH) -c shopt
.PHONY: info
bug:
-@$(BASH) ./imosh test/bash_bug.sh
.PHONY: bug
test: concat
@if ! $(BASH) ./imosh test/*_test.sh test/*/*_test.sh; then exit 1; fi
.PHONY: test
test/%: concat test/%_test.sh
./imosh test/$*_test.sh
benchmark: concat
@time $(BASH) -c "for i in {1..10}; do $(BASH) -c '. ./imosh'; done"
.PHONY: benchmark