forked from ko1nksm/getoptions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (39 loc) · 1.2 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
PREFIX ?= /usr/local
BINDIR := $(PREFIX)/bin
SHELL=bash
.PHONY: build clean check test testall coverage install uninstall
build: bin/getoptions bin/gengetoptions
clean:
rm -f bin/getoptions bin/gengetoptions getoptions.tar.gz gengetoptions.tar.gz
check:
shellcheck src/* lib/*.sh spec/*.sh examples/*.sh
test:
shellspec
testall:
shellspec -s sh
shellspec -s bash
shellspec -s 'busybox ash'
shellspec -s ksh
shellspec -s mksh
shellspec -s posh
shellspec -s yash
shellspec -s zsh
coverage:
shellspec -s bash --kcov --kcov-options "--coveralls-id=$(COVERALLS_REPO_TOKEN)"
bash <(curl -s https://codecov.io/bash) -s coverage
dist: build
tar -C bin -czf getoptions.tar.gz getoptions
tar -C bin -czf gengetoptions.tar.gz gengetoptions
install: build
mkdir -p $(BINDIR)
install -m 755 bin/getoptions $(BINDIR)/getoptions
install -m 755 bin/gengetoptions $(BINDIR)/gengetoptions
uninstall:
rm -f $(BINDIR)/getoptions
rm -f $(BINDIR)/gengetoptions
bin/getoptions: src/build.sh src/getoptions lib/*.sh
src/build.sh < src/getoptions > bin/getoptions
chmod +x bin/getoptions
bin/gengetoptions: src/build.sh src/gengetoptions
src/build.sh < src/gengetoptions > bin/gengetoptions
chmod +x bin/gengetoptions