34 lines
809 B
Makefile
Executable File
34 lines
809 B
Makefile
Executable File
PACKAGE_NAME=justcaptcha
|
|
TARGET=${PACKAGE_NAME}d
|
|
|
|
SYSCTL=${shell which systemctl}
|
|
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
|
|
SYSDDIR=${SYSDDIR_:/%=%}
|
|
DESTDIR=/
|
|
|
|
VERSION=2.0.2
|
|
|
|
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}" -tags osusergo,netgo
|
|
|
|
all: ${TARGET}
|
|
|
|
.PHONY: ${TARGET}
|
|
|
|
${TARGET}:
|
|
go build -o bin/$@ ${LDFLAGS} cmd/$@/main.go
|
|
|
|
run:
|
|
bin/${TARGET} -expiry 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.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
|