1
0

Updated Makefile.

This commit is contained in:
Alexander Andreev 2024-07-12 17:09:21 +04:00
parent 4cc8b0c761
commit f59da2a76e
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -2,18 +2,22 @@ TARGET=dwelling-home
SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir}
SYSDDIR=${SYSDDIR_:/%=%}
DESTDIR:=
PREFIX:=/usr/local
DESTDIR?=
PREFIX?=/usr/local
VERSION?=24.27.1
FLAGS:=-buildmode=pie -modcacherw -mod=readonly -trimpath
LDFLAGS=-ldflags "-s -w -X 'git.arav.su/Arav/dwelling-home/internal/version.ver=v${VERSION}'" -tags osusergo,netgo
XVER:=git.arav.su/Arav/dwelling-home/internal/version.ver=v${VERSION}
GOFLAGS:=-buildmode=pie -trimpath -mod=readonly -modcacherw
GOFLAGS+=-ldflags="-linkmode=external -s -w -X '${XVER}' -extldflags=${LDFLAGS}"
GOFLAGS+=-tags osusergo,netgo
.PHONY: run install uninstall clean
${TARGET}: web/*_templ.go
go build -o bin/$@ ${LDFLAGS} ${FLAGS} cmd/$@/main.go
go build ${GOFLAGS} -o bin/$@ cmd/$@/main.go
web/*_templ.go: web/*.templ
ifeq (,$(wildcard $(shell go env GOPATH)/bin/templ))