Skip to content

Commit

Permalink
Makefile: Add more targets
Browse files Browse the repository at this point in the history
  • Loading branch information
ko1nksm committed Apr 22, 2021
1 parent a83c9ba commit 497d8bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/report/
/coverage/
/bin

/*.tar.gz
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ PREFIX ?= /usr/local
BINDIR := $(PREFIX)/bin
SHELL=bash

.PHONY: build check test testall coverage install uninstall
.PHONY: build clean check test testall coverage install uninstall

build: bin/getoptions bin/getoptions-generate

clean:
rm -f bin/getoptions bin/getoptions-generate getoptions.tar.gz getoptions-generate.tar.gz

check:
shellcheck src/* lib/*.sh spec/*.sh examples/*.sh

Expand All @@ -26,6 +29,18 @@ 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 getoptions-generate.tar.gz getoptions-generate

install: build
install -m 755 bin/getoptions $(BINDIR)/getoptions
install -m 755 bin/getoptions-generate $(BINDIR)/getoptions-generate

uninstall:
rm -f $(BINDIR)/getoptions
rm -f $(BINDIR)/getoptions-generate

bin/getoptions: src/build.sh src/getoptions lib/*.sh
src/build.sh < src/getoptions > bin/getoptions
chmod +x bin/getoptions
Expand Down

0 comments on commit 497d8bc

Please sign in to comment.