-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (46 loc) · 1.46 KB
/
Makefile
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
61
# generated static site pages
DOCS_DIR=docs/
# data managed locally
DATA_DIR=data/
# generated data
DATASET_DIR=dataset/
# downloaded specification data
SPECIFICATION_DIR=specification/
# downloaded data from other sources
CACHE_DIR=var/cache/
DATA_FILES=\
$(DATA_DIR)quality.csv\
$(CACHE_DIR)organisation.csv\
$(CACHE_DIR)local-planning-authority.csv\
$(SPECIFICATION_DIR)award.csv\
$(SPECIFICATION_DIR)cohort.csv\
$(SPECIFICATION_DIR)fund.csv\
$(SPECIFICATION_DIR)intervention.csv\
$(SPECIFICATION_DIR)provision.csv\
$(SPECIFICATION_DIR)project.csv\
$(SPECIFICATION_DIR)project-organisation.csv\
$(SPECIFICATION_DIR)role.csv\
$(SPECIFICATION_DIR)role-organisation.csv
DOCS=\
$(DOCS_DIR)index.html
all: $(DOCS) $(DATA_FILES)
$(DOCS_DIR)index.html: $(DATASET) bin/render.py
@mkdir -p $(DOCS_DIR)
python3 bin/render.py > $@
$(CACHE_DIR)organisation.csv:
@mkdir -p $(CACHE_DIR)
curl -qfsL "https://files.planning.data.gov.uk/organisation-collection/dataset/organisation.csv" > $@
$(CACHE_DIR)local-planning-authority.csv:
@mkdir -p $(CACHE_DIR)
curl -qfsL 'https://files.planning.data.gov.uk/dataset/local-planning-authority.csv' > $@
$(SPECIFICATION_DIR)%:
@mkdir -p $(SPECIFICATION_DIR)
curl -qfsL 'https://raw.githubusercontent.com/digital-land/specification/main/specification/$(notdir $@)' > $@
clean::
clobber::
rm -f $(DOCS) $(DATA)
init::
pip install -r requirements.txt
npm install svgo
server::
python3 -m http.server -d $(DOCS_DIR)