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