From 24372421265f5161133169d34ce1616e797cf6d5 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Mon, 4 Sep 2023 10:14:08 +0300 Subject: [PATCH] Update makefile for 2023 --- Makefile | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index cdf7e43..df48f61 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,19 @@ -YEAR := 2022 +YEAR := 2023 DATA_DIR := data/${YEAR} OUT_DIR := out/${YEAR} -XLSX_URL := https://docs.google.com/spreadsheets/d/1PxBV-MzFlPl1IxOp6EGj6C80HSTgfHcXUhBeL8hZ0Ck/export?format=xlsx -TSV_URL := https://docs.google.com/spreadsheets/d/1PxBV-MzFlPl1IxOp6EGj6C80HSTgfHcXUhBeL8hZ0Ck/export?format=tsv +DOCUMENT_ID_FI := 1sycmd6DGqHj9-0k6D8HclzlRghxqoVaBZNSZye1Jdbg +DOCUMENT_ID_EN := 1pmrQWsja3wRVF02PyEGO2F_CgttobTbxGUGjQ5K4H4Y +XLSX_URL_FI := https://docs.google.com/spreadsheets/d/$(DOCUMENT_ID_FI)/export?format=xlsx +TSV_URL_FI := https://docs.google.com/spreadsheets/d/$(DOCUMENT_ID_FI)/export?format=tsv +XLSX_URL_EN := https://docs.google.com/spreadsheets/d/$(DOCUMENT_ID_EN)/export?format=xlsx +TSV_URL_EN := https://docs.google.com/spreadsheets/d/$(DOCUMENT_ID_EN)/export?format=tsv export DATA_DIR export OUT_DIR export YEAR -.PHONY: $(DATA_DIR)/results.xlsx $(DATA_DIR)/results.tsv +# Comment this .PHONY out to not have to download the data every time: +.PHONY: all-data all: all-data copy-raw-data massage charts profiling @@ -16,8 +21,10 @@ $(OUT_DIR): mkdir -p $(OUT_DIR) copy-raw-data: all-data $(OUT_DIR) - cp $(DATA_DIR)/results.xlsx $(OUT_DIR)/raw.xlsx - cp $(DATA_DIR)/results.tsv $(OUT_DIR)/raw.tsv + cp $(DATA_DIR)/results-en.tsv $(OUT_DIR)/raw-en.tsv + cp $(DATA_DIR)/results-en.xlsx $(OUT_DIR)/raw-en.xlsx + cp $(DATA_DIR)/results-fi.tsv $(OUT_DIR)/raw-fi.tsv + cp $(DATA_DIR)/results-fi.xlsx $(OUT_DIR)/raw-fi.xlsx massage: all-data python -m pulkka.massage_outputs @@ -28,13 +35,19 @@ charts: all-data profiling: all-data python -m pulkka.generate_profiling -all-data: $(DATA_DIR)/results.xlsx $(DATA_DIR)/results.tsv +all-data: $(DATA_DIR)/results-fi.xlsx $(DATA_DIR)/results-fi.tsv $(DATA_DIR)/results-en.xlsx $(DATA_DIR)/results-en.tsv $(DATA_DIR): mkdir -p $(DATA_DIR) -$(DATA_DIR)/results.xlsx: $(DATA_DIR) - curl -fsSL -o $@ $(XLSX_URL) +$(DATA_DIR)/results-en.tsv: $(DATA_DIR) + curl -fsSL -o $@ $(TSV_URL_EN) -$(DATA_DIR)/results.tsv: $(DATA_DIR) - curl -fsSL -o $@ $(TSV_URL) +$(DATA_DIR)/results-en.xlsx: $(DATA_DIR) + curl -fsSL -o $@ $(XLSX_URL_EN) + +$(DATA_DIR)/results-fi.tsv: $(DATA_DIR) + curl -fsSL -o $@ $(TSV_URL_FI) + +$(DATA_DIR)/results-fi.xlsx: $(DATA_DIR) + curl -fsSL -o $@ $(XLSX_URL_FI)