-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 897 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 897 Bytes
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
DATA ?= $(CURDIR)/data
.PHONY: build
build:
go build -o bin/lxnc .
.PHONY: test
test:
go test ./...
# for available downloads see: https://cldr.unicode.org/index/downloads
.PHONY: download-data
download-data: CLDR_VERSION ?= 44
download-data: CLDR_DATA_URL = https://unicode.org/Public/cldr/$(CLDR_VERSION)/cldr-common-$(CLDR_VERSION).0.zip
download-data:
mkdir -p $(DATA)
rm -rf $(DATA)/*
curl -L -o $(DATA)/schema.mprot https://raw.githubusercontent.com/liblxn/lxn/main/schema.mprot
curl -L -o $(DATA)/cldr.zip $(CLDR_DATA_URL)
unzip -d $(DATA)/cldr $(DATA)/cldr.zip
echo "$(CLDR_VERSION)" > $(DATA)/cldr/version
rm $(DATA)/cldr.zip
.PHONY: generate
generate:
go build -o bin/generate ./cmd/generate/
rm -rf locale/*
./bin/generate -out ./locale -cldr-data $(DATA)/cldr -cldr-version $(shell cat $(DATA)/cldr/version)
./bin/generate -out ./lxn -schema $(DATA)/schema.mprot