A more sane variable names in Makefile.

This commit is contained in:
Alexander Andreev 2022-06-26 16:46:26 +04:00
parent 4bff49fe2f
commit 4121ba9ad3
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

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