PREFIX := /usr/local START_SCRIPT := start START_SCRIPT_SRC := start.tmpl INSTALLATION_NAME := docker-aria2 DOCKERFILE := Dockerfile TAG = docker-aria2 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: build install -D --mode=755 $(START_SCRIPT) $(PREFIX)/bin/$(INSTALLATION_NAME) .PHONY: check clean