From 9c5bad04d492fea9eb7061f545665a603765a668 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Wed, 24 May 2023 22:40:06 +0400 Subject: [PATCH] Made a new target to generate templates only when they are missing. Also put go install jade in it. Hence, no need in check in the PKGBUILD. --- Makefile | 7 ++++--- build/archlinux/PKGBUILD | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2cf7752..250ce69 100755 --- a/Makefile +++ b/Makefile @@ -9,17 +9,18 @@ VERSION=23.21.0 LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}" -tags osusergo,netgo -all: ${TARGET} +all: web/*.jade.go ${TARGET} .PHONY: ${TARGET} ${TARGET}: - go generate web/web.go go build -o bin/$@ ${LDFLAGS} cmd/$@/main.go go build -o bin/$@-clean ${LDFLAGS} cmd/$@-clean/main.go -install-jade: +web/*.jade.go: go install github.com/Joker/jade/cmd/jade@latest + go generate web/web.go + install: install -Dm 0755 bin/${TARGET} ${DESTDIR}usr/bin/${TARGET} diff --git a/build/archlinux/PKGBUILD b/build/archlinux/PKGBUILD index a3a5581..b8acfdd 100644 --- a/build/archlinux/PKGBUILD +++ b/build/archlinux/PKGBUILD @@ -17,10 +17,6 @@ build() { export GOPATH="$srcdir"/gopath - if [ ! -f "$(go env GOPATH)/bin/jade" ]; then - make DESTDIR="$pkgdir/" install-jade - fi - make VERSION=$pkgver DESTDIR="$pkgdir/" }