2022-06-27 04:38:09 +04:00
|
|
|
TARGET=dwelling-files
|
|
|
|
|
|
|
|
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
|
|
|
|
SYSDDIR=${SYSDDIR_:/%=%}
|
|
|
|
|
2023-06-12 23:32:54 +04:00
|
|
|
DESTDIR:=
|
|
|
|
PREFIX:=/usr/local
|
2022-06-27 04:38:09 +04:00
|
|
|
|
2023-06-12 23:32:54 +04:00
|
|
|
VERSION=23.24.0
|
|
|
|
|
|
|
|
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}" -tags osusergo,netgo
|
|
|
|
|
|
|
|
all: web/*.jade.go ${TARGET}
|
2022-06-27 04:38:09 +04:00
|
|
|
|
|
|
|
.PHONY: ${TARGET}
|
|
|
|
|
|
|
|
${TARGET}:
|
|
|
|
go build -o bin/$@ ${LDFLAGS} cmd/$@/main.go
|
|
|
|
|
2023-06-12 23:32:54 +04:00
|
|
|
web/*.jade.go: web/templates/*.jade
|
|
|
|
go install github.com/Joker/jade/cmd/jade@latest
|
|
|
|
go generate web/web.go
|
|
|
|
|
2022-06-27 04:38:09 +04:00
|
|
|
run:
|
2022-12-17 22:52:15 +04:00
|
|
|
bin/${TARGET} -file-handling -path /mnt/data -listen 127.0.0.1:19135
|
2022-06-27 04:38:09 +04:00
|
|
|
|
|
|
|
install:
|
2023-06-12 23:32:54 +04:00
|
|
|
install -Dm 0755 bin/${TARGET} ${DESTDIR}${PREFIX}/bin/${TARGET}
|
2022-06-27 04:38:09 +04:00
|
|
|
|
2023-06-12 23:32:54 +04:00
|
|
|
install -Dm 0644 init/systemd/${TARGET}.service ${DESTDIR}/${SYSDDIR}/${TARGET}.service
|
2022-06-27 04:38:09 +04:00
|
|
|
|
|
|
|
uninstall:
|
2023-06-12 23:32:54 +04:00
|
|
|
rm ${DESTDIR}${PREFIX}/bin/${TARGET}
|
2022-06-27 04:38:09 +04:00
|
|
|
|
2023-06-12 23:32:54 +04:00
|
|
|
rm ${DESTDIR}/${SYSDDIR}/${TARGET}.service
|