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_=${shell pkg-config systemd --variable=systemdsystemunitdir}
SYSDDIR=${SYSDDIR_:/%=%} SYSDDIR=${SYSDDIR_:/%=%}
DESTDIR:=
PREFIX:=/usr/local DESTDIR?=
PREFIX?=/usr/local
VERSION?=24.27.1 VERSION?=24.27.1
FLAGS:=-buildmode=pie -modcacherw -mod=readonly -trimpath XVER:=git.arav.su/Arav/dwelling-home/internal/version.ver=v${VERSION}
LDFLAGS=-ldflags "-s -w -X 'git.arav.su/Arav/dwelling-home/internal/version.ver=v${VERSION}'" -tags osusergo,netgo
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 .PHONY: run install uninstall clean
${TARGET}: web/*_templ.go ${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 web/*_templ.go: web/*.templ
ifeq (,$(wildcard $(shell go env GOPATH)/bin/templ)) ifeq (,$(wildcard $(shell go env GOPATH)/bin/templ))