diff options
| author | Shulhan <ms@kilabit.info> | 2026-02-12 08:56:48 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-02-12 08:56:48 +0700 |
| commit | b9f7ca45432916f3cf19ff8b62e428531aa0fa8d (patch) | |
| tree | db3f15c1a234cb06c9d1fde21b04892240956237 | |
| parent | e4b3383d84cd181f4a9fec1097ec61e583d6f827 (diff) | |
| download | jarink-b9f7ca45432916f3cf19ff8b62e428531aa0fa8d.tar.xz | |
make: add `build` task
The build task set the Version information based on the latest
tag and number of commits.
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | Makefile | 7 |
2 files changed, 9 insertions, 1 deletions
@@ -1,5 +1,6 @@ -# SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info> # SPDX-License-Identifier: GPL-3.0-only +# SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info> *.html /cover.out +/jarink @@ -1,6 +1,8 @@ ## SPDX-License-Identifier: GPL-3.0-only ## SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info> +VERSION=$(shell git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g') + COVER_OUT:=cover.out COVER_HTML:=cover.html @@ -18,6 +20,11 @@ test: -coverprofile=$(COVER_OUT) ./... go tool cover -html=$(COVER_OUT) -o $(COVER_HTML) +.PHONY: build +build: LDFLAGS=-X 'git.sr.ht/~shulhan/jarink.Version=$(VERSION)' +build: + go build -ldflags="$(LDFLAGS)" ./cmd/jarink + .PHONY: doc.serve doc.serve: ciigo serve . |
