aboutsummaryrefslogtreecommitdiffstats
path: root/administrative-codes/Makefile
blob: 9e2464de29baaf102df2aade2c48eae7b5dd032b (plain)
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
OUT = administrative-codes
CSV_SOURCES = counties.csv municipalities.csv
GENERATED_FILES = $(addsuffix .json,$(OUT)) \
	$(addsuffix .json.br,$(OUT)) \
	$(addsuffix .json.gz,$(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 --no-copy-stat --verbose --stdout <$< >$@

%.json.gz: %.json
	gzip --best --keep --no-name --verbose --stdout <$< >$@

clean:
	rm -f -- $(GENERATED_FILES)

.PHONY: all update clean