From 4121ba9ad33aab67ecf58dde3cafb0c16c780944 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 26 Jun 2022 16:46:26 +0400 Subject: [PATCH] A more sane variable names in Makefile. --- Makefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 4b41e8f..ef96730 100755 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -TARGET=justcaptcha -DAEMON_NAME=${TARGET}d +PACKAGE_NAME=justcaptcha +TARGET=${PACKAGE_NAME}d SYSCTL=${shell which systemctl} SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir} @@ -8,27 +8,27 @@ DESTDIR=/ 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 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 -Dm 0755 bin/${DAEMON_NAME} ${DESTDIR}usr/bin/${DAEMON_NAME} - install -Dm 0644 LICENSE ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE + 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/${TARGET}.service ${DESTDIR}${SYSDDIR}/${TARGET}.service + install -Dm 0644 init/systemd/${PACKAGE_NAME}.service ${DESTDIR}${SYSDDIR}/${PACKAGE_NAME}.service uninstall: - rm ${DESTDIR}usr/bin/${DAEMON_NAME} - rm ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE + rm ${DESTDIR}usr/bin/${TARGET} + rm ${DESTDIR}usr/share/licenses/${PACKAGE_NAME}/LICENSE - rm ${DESTDIR}${SYSDDIR}/${TARGET}.service + rm ${DESTDIR}${SYSDDIR}/${PACKAGE_NAME}.service clean: go clean