aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 9e71ff84fac28e933ac1ed40074dd54b2f197bec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileContributor: Runxi Yu <https://runxiyu.org>

.PHONY: clean version.go

CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99 -D_GNU_SOURCE

forge: $(filter-out forge,$(wildcard *)) version.go hookc/*.c hookc/hookc
	go mod vendor
	go build .

hookc/hookc:

version.go:
	printf 'package main\nconst VERSION="%s"\n' $(shell git describe --tags --always --dirty) > $@

clean:
	$(RM) forge version.go vendor

htmpl.go: htmpl/*
	gohtmplgen -o htmpl.go htmpl/*