dpgpid/Makefile

39 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

.PHONY: all default install shellcheck-% shellspec-% tests uninstall
BINDIR ?= $(PREFIX)/bin
PREFIX ?= /usr/local
2022-05-13 19:40:16 +02:00
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
2022-05-13 19:40:16 +02:00
default: tests
2022-05-16 22:34:47 +02:00
all: install tests
2022-05-13 19:40:16 +02:00
install: $(if $(shell which pip3),pip3-install,pip3-not-found)
2022-05-13 19:40:16 +02:00
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"
2022-05-13 19:40:16 +02:00
shellcheck-%:
@shellcheck $*/*.sh
2022-05-13 19:40:16 +02:00
shellspec-%:
@shellspec -f tap $*
2022-05-13 19:40:16 +02:00
tests: shellcheck-specs shellspec-specs
uninstall:
rm -f "$(BINDIR)/dpgpid"
rm -f "$(BINDIR)/keygen"