Updated Makefile.
This commit is contained in:
parent
4cc8b0c761
commit
f59da2a76e
14
Makefile
14
Makefile
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user