1
0
Fork 0
dwelling-files/Makefile

36 lines
793 B
Makefile
Raw Normal View History

2022-06-27 04:38:09 +04:00
TARGET=dwelling-files
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
SYSDDIR=${SYSDDIR_:/%=%}
DESTDIR:=
PREFIX:=/usr/local
2022-06-27 04:38:09 +04:00
2023-08-13 04:06:34 +04:00
VERSION=23.32.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
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:
bin/${TARGET} -file-handling -path /mnt/data -listen 127.0.0.1:19135
2022-06-27 04:38:09 +04:00
install:
install -Dm 0755 bin/${TARGET} ${DESTDIR}${PREFIX}/bin/${TARGET}
2022-06-27 04:38:09 +04:00
install -Dm 0644 init/systemd/${TARGET}.service ${DESTDIR}/${SYSDDIR}/${TARGET}.service
2022-06-27 04:38:09 +04:00
uninstall:
rm ${DESTDIR}${PREFIX}/bin/${TARGET}
2022-06-27 04:38:09 +04:00
rm ${DESTDIR}/${SYSDDIR}/${TARGET}.service