36 lines
793 B
Makefile
Executable File
36 lines
793 B
Makefile
Executable File
TARGET=dwelling-files
|
|
|
|
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
|
|
SYSDDIR=${SYSDDIR_:/%=%}
|
|
|
|
DESTDIR:=
|
|
PREFIX:=/usr/local
|
|
|
|
VERSION=23.24.0
|
|
|
|
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}" -tags osusergo,netgo
|
|
|
|
all: web/*.jade.go ${TARGET}
|
|
|
|
.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
|
|
|
|
run:
|
|
bin/${TARGET} -file-handling -path /mnt/data -listen 127.0.0.1:19135
|
|
|
|
install:
|
|
install -Dm 0755 bin/${TARGET} ${DESTDIR}${PREFIX}/bin/${TARGET}
|
|
|
|
install -Dm 0644 init/systemd/${TARGET}.service ${DESTDIR}/${SYSDDIR}/${TARGET}.service
|
|
|
|
uninstall:
|
|
rm ${DESTDIR}${PREFIX}/bin/${TARGET}
|
|
|
|
rm ${DESTDIR}/${SYSDDIR}/${TARGET}.service
|