aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2020-03-10 12:27:53 +0000
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2020-03-10 12:27:53 +0000
commit7c6c2e09e3ad1d41f26869cb7b9f9882175c8a6e (patch)
tree10aa6710599230c889ec44407a065ee303a79348 /Makefile
downloadTCPD-7c6c2e09e3ad1d41f26869cb7b9f9882175c8a6e.tar.gz
TCPD-7c6c2e09e3ad1d41f26869cb7b9f9882175c8a6e.zip
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile71
1 files changed, 71 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7300b86
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,71 @@
+# Makefile for the Turing Change Point Dataset
+#
+# Author: G.J.J. van den Burg
+# Copyright (c) 2019, The Alan Turing Institute
+# License: See LICENSE file.
+#
+
+MAKEFLAGS += --warn-undefined-variables
+MAKEFLAGS += --no-builtin-rules
+
+DATA_DIR=./datasets
+UTIL_DIR=./utils
+VENV_DIR=./venv
+EXPORT_DIR=./export
+
+.PHONY: all clean collect verify validate test export
+
+all: test
+
+################
+# Main targets #
+################
+
+collect: venv
+ source $(VENV_DIR)/bin/activate && python build_tcpd.py -v collect
+
+##############
+# Validation #
+##############
+
+test: verify validate
+
+verify: venv collect $(UTIL_DIR)/check_checksums.py ./checksums.json
+ echo "Verifying datasets ..."
+ source $(VENV_DIR)/bin/activate && \
+ python $(UTIL_DIR)/check_checksums.py -v -c ./checksums.json -d $(DATA_DIR)
+
+validate: venv collect $(UTIL_DIR)/validate_dataset.py ./schema.json
+ echo "Validating datasets"
+ source $(VENV_DIR)/bin/activate && \
+ python $(UTIL_DIR)/validate_dataset.py -v -s ./schema.json -d $(DATA_DIR)
+
+####################
+# Utility commands #
+####################
+
+export: test
+ mkdir -p $(EXPORT_DIR)
+ cp -v $(DATA_DIR)/*/*.json $(EXPORT_DIR)
+
+###########
+# Cleanup #
+###########
+
+clean:
+ if [ -d $(VENV_DIR) ] ; then \
+ source $(VENV_DIR)/bin/activate && python build_tcpd.py -v clean ; \
+ fi
+ rm -rf $(VENV_DIR)
+ rm -rf $(EXPORT_DIR)
+
+##############
+# Virtualenv #
+##############
+
+venv: $(VENV_DIR)/bin/activate
+
+$(VENV_DIR)/bin/activate:
+ test -d $(VENV_DIR) || virtualenv $(VENV_DIR)
+ source $(VENV_DIR)/bin/activate && pip install -r ./requirements.txt
+ touch $(VENV_DIR)/bin/activate