blob: 50fcb87bb33de815c8a232cc1b4baf27fa496475 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
LECTIO := lectio
LECTIO_UI := lectio-ui
LECTIO_WEB := lectio-web
PREFIX ?= $(HOME)/.local
BINDIR := $(PREFIX)/bin
.PHONY: help build install uninstall test vet fmt clean cross check-corpora add-corpus
help: ## show this help
@grep -hE '^[a-z-]+:.*##' $(MAKEFILE_LIST) | sed -E 's/:.*## /\t/' | sort
build: ## build ./lectio, ./lectio-ui and ./lectio-web
go build -o $(LECTIO) ./cmd/lectio
go build -o $(LECTIO_UI) ./cmd/lectio-ui
go build -o $(LECTIO_WEB) ./cmd/lectio-web
install: ## build and install all three to $(BINDIR)
@mkdir -p $(BINDIR)
go build -o $(BINDIR)/$(LECTIO) ./cmd/lectio
go build -o $(BINDIR)/$(LECTIO_UI) ./cmd/lectio-ui
go build -o $(BINDIR)/$(LECTIO_WEB) ./cmd/lectio-web
@echo "installed $(BINDIR)/$(LECTIO), $(BINDIR)/$(LECTIO_UI) and $(BINDIR)/$(LECTIO_WEB)"
uninstall: ## remove installed binaries
rm -f $(BINDIR)/$(LECTIO) $(BINDIR)/$(LECTIO_UI) $(BINDIR)/$(LECTIO_WEB)
test: check-corpora ## run tests
go test ./...
vet: ## go vet
go vet ./...
fmt: ## gofmt the tree
gofmt -w .
clean: ## remove build artifacts
rm -f $(LECTIO) $(LECTIO_UI) $(LECTIO_WEB); rm -rf dist
cross: ## cross-compile into dist/
@mkdir -p dist
@for t in linux/amd64 linux/arm64 darwin/arm64 darwin/amd64 windows/amd64; do \
os=$${t%/*}; arch=$${t#*/}; ext=; [ $$os = windows ] && ext=.exe; \
echo " $$os/$$arch"; \
GOOS=$$os GOARCH=$$arch go build -o dist/$(LECTIO)-$$os-$$arch$$ext ./cmd/lectio; \
GOOS=$$os GOARCH=$$arch go build -o dist/$(LECTIO_UI)-$$os-$$arch$$ext ./cmd/lectio-ui; \
GOOS=$$os GOARCH=$$arch go build -o dist/$(LECTIO_WEB)-$$os-$$arch$$ext ./cmd/lectio-web; \
done
# Validate every embedded corpus (CI gate). grb is EXEMPT: it is a scholarly
# Septuagint corpus whose Book column intentionally carries Orthodox-canon
# extras (1-4 Esdras/Maccabees, Odes, Psalms of Solomon) and manuscript variants
# (…(Theodotion)/(Sinaiticus)/(Vaticanus)) that are not in the 73-key Catholic
# canon and would collide with canonical keys if renamed. --corpus-check grb
# correctly reports these; they are by design, not defects to fix here.
check-corpora: ## validate all embedded bible corpora (skips grb, see comment)
@for f in internal/bible/corpora/*.tsv; do \
code=$$(basename $$f .tsv); \
[ "$$code" = grb ] && { echo "skipping grb (broader LXX canon)"; continue; }; \
echo "checking $$code"; \
go run ./cmd/lectio --corpus-check $$code || exit 1; \
done
# Validate then embed a corpus pair: make add-corpus CORPUS=fr-crampon SRC=/path/to/dir
add-corpus: ## validate + copy a corpus pair into internal/bible/corpora/, then build
@test -n "$(CORPUS)" || { echo "set CORPUS=<code>" >&2; exit 2; }
@test -n "$(SRC)" || { echo "set SRC=<dir with $(CORPUS).tsv/.ini>" >&2; exit 2; }
go run ./cmd/lectio --corpus-check "$(SRC)/$(CORPUS).tsv"
cp "$(SRC)/$(CORPUS).tsv" "$(SRC)/$(CORPUS).ini" internal/bible/corpora/
$(MAKE) build
|