PACKAGE_NAME=justcaptcha TARGET=${PACKAGE_NAME}d SYSCTL=${shell which systemctl} SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir} SYSDDIR=${SYSDDIR_:/%=%} DESTDIR=/ LDFLAGS=-ldflags "-s -w" -tags osusergo,netgo all: ${TARGET} .PHONY: ${TARGET} ${TARGET}: go build -o bin/$@ ${LDFLAGS} cmd/$@/main.go run-test: bin/${TARGET} -expire 1m -listen 127.0.0.1:19134 install: install -Dm 0755 bin/${TARGET} ${DESTDIR}usr/bin/${TARGET} install -Dm 0644 LICENSE ${DESTDIR}usr/share/licenses/${PACKAGE_NAME}/LICENSE install -Dm 0644 init/systemd/${PACKAGE_NAME}.service ${DESTDIR}${SYSDDIR}/${PACKAGE_NAME}.service uninstall: rm ${DESTDIR}usr/bin/${TARGET} rm ${DESTDIR}usr/share/licenses/${PACKAGE_NAME}/LICENSE rm ${DESTDIR}${SYSDDIR}/${PACKAGE_NAME}.service clean: go clean