docker-vpn/Makefile
2022-02-17 17:33:26 +01:00

36 lines
848 B
Makefile

PREFIX := /usr/local
START_SCRIPT := start
START_SCRIPT_SRC := start.tmpl
INSTALLATION_NAME := docker-vpn
DOCKERFILE := Dockerfile
TAG = docker-vpn
build: build-docker $(START_SCRIPT)
build-docker: $(DOCKERFILE) start-openvpn.sh
docker pull alpine
docker build --tag=$(TAG) .
@echo "This is a marker for the docker build." > $@
$(START_SCRIPT): $(START_SCRIPT_SRC)
sed -e "s/{TAG}/$(TAG)/g" -e "s/{INSTALLATION_NAME}/$(INSTALLATION_NAME)/g" $< > $@
chmod +x $@
shellcheck.log: $(START_SCRIPT)
@echo "# Begin shellcheck log" > $@
shellcheck $< >> $@
shellcheck: shellcheck.log
check: shellcheck
clean:
$(RM) build-docker shellcheck.log $(START_SCRIPT)
install: check build
install -D --mode=755 $(START_SCRIPT) $(PREFIX)/bin/$(INSTALLATION_NAME)
uninstall:
$(RM) $(PREFIX)/bin/$(INSTALLATION_NAME)
.PHONY: check shellcheck clean