aboutsummaryrefslogtreecommitdiffstats
path: root/administrative-codes/Makefile
blob: e8b8f2bd47ffa56c763b1219ffe56739cb82a146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OUT = administrative-codes
CSV_SOURCES = counties.csv municipalities.csv
GENERATED_FILES = $(addsuffix .json,$(OUT)) $(addsuffix .json.br,$(OUT))
all: $(GENERATED_FILES)

update: $(CSV_SOURCES)

$(CSV_SOURCES): %.csv:
	./update

%.json: $(CSV_SOURCES)
	./csv2json $^ >$@

# XXX The brotli(1) executable doesn't support mode=MODE_TEXT
%.json.br: %.json
	brotli --best --keep --output=$@ -- $^

clean:
	rm -f -- $(GENERATED_FILES)

.PHONY: all update clean