-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
50 lines (35 loc) · 1.18 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
#!make
include .env
ROOT_DIR = $(shell pwd)
DATA_DIR = $(ROOT_DIR)/data
SCRIPTS_DIR = $(ROOT_DIR)/scripts
OUTPUT_DIR = $(DATA_DIR)/output
BASH_SCRIPTS_DIR = $(SCRIPTS_DIR)/bash
DATETIME = $(shell date +%Y%m%d_%H%M%S)
DATETIME := $(DATETIME)
URL = "https://api.telegram.org/bot$(BOT_ID)/sendMessage"
PYTHON = $(ROOT_DIR)/.venv/bin/python3
BASH = $(shell which bash)
TARGETS = notify_start build comp notify_end
.ONESHELL:
.PHONY: all clean-plot clean-csv cleanall build comp exp plot
all: $(TARGETS)
clean-infr:
rm -rf $(DATA_DIR)/infrs/*
clean-plot:
rm -rf $(OUTPUT_DIR)/plots/*
clean-csv:
rm -rf $(OUTPUT_DIR)/csv/*
clean: clean-infr clean-plot clean-csv
build:
$(BASH) $(BASH_SCRIPTS_DIR)/build.sh $(DATETIME)
comp:
$(BASH) $(BASH_SCRIPTS_DIR)/run.sh comp $(DATETIME)
exp:
$(BASH) $(BASH_SCRIPTS_DIR)/run.sh exp
plot: clean-plot
$(PYTHON) $(SCRIPTS_DIR)/plot.py
notify_start:
curl -s -X POST $(URL) -d parse_mode=$(PARSE_MODE) -d chat_id=$(CHAT_ID) -d text="Exp START: *$(shell date +%H:%M:%S\ \\-\ %d/%m/%Y)*"
notify_end:
curl -s -X POST $(URL) -d parse_mode=$(PARSE_MODE) -d chat_id=$(CHAT_ID) -d text="Exp END: *$(shell date +%H:%M:%S\ \\-\ %d/%m/%Y)*"