-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (28 loc) · 1.05 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
.PHONY: all default install shellcheck-% shellspec-% tests uninstall
BINDIR ?= $(PREFIX)/bin
PREFIX ?= /usr/local
MYOS ?= ../myos
MYOS_REPOSITORY ?= $(patsubst %/$(THIS),%/myos,$(THIS_REPOSITORY))
THIS ?= $(lastword $(subst /, ,$(THIS_REPOSITORY)))
THIS_REPOSITORY ?= $(shell git config --get remote.origin.url 2>/dev/null)
$(MYOS):
-@git clone $(MYOS_REPOSITORY) $(MYOS)
-include $(MYOS)/make/include.mk
default: tests
all: install tests
install: $(if $(shell which pip3),pip3-install,pip3-not-found)
mkdir -p "$(BINDIR)"
install dpgpid "$(BINDIR)/dpgpid"
install keygen "$(BINDIR)/keygen"
pip3-install:
pip3 install -r requirements.txt
pip3-not-found:
printf "WARNING: pip3 not found, please manually install python modules from requirements.txt\n"
shellcheck-%:
@shellcheck $*/*.sh
shellspec-%:
@shellspec -f tap $*
tests: shellcheck-specs shellspec-specs
uninstall:
rm -f "$(BINDIR)/dpgpid"
rm -f "$(BINDIR)/keygen"