forked from serlo/overview.serlo.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (32 loc) · 1.19 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
PYTHON := $(shell if which pyenv > /dev/null; \
then echo python ; else echo python3 ; fi)
TEMPLATE := template.html
DATABASE := serlo.db
DATABASE_TMP := $(shell mktemp -u)
OUTPUT_DIR := out
INDEX_HTML := $(OUTPUT_DIR)/index.html
FAVICON := $(OUTPUT_DIR)/favicon.ico
CSS := $(OUTPUT_DIR)/styles.css
JAVASCRIPT := $(OUTPUT_DIR)/script.js
TARGETS := $(DATABASE) $(INDEX_HTML) $(FAVICON) $(CSS) $(JAVASCRIPT)
.PHONY: test $(TARGETS)
all: $(TARGETS)
$(DATABASE_TMP):
$(PYTHON) highrise_importer.py 'sqlite:///$@'
$(DATABASE): $(DATABASE_TMP)
mv '$<' '$@'
$(FAVICON): $(OUTPUT_DIR)
curl -s 'https://de.serlo.org/favicon.ico' > '$@'
$(CSS): $(OUTPUT_DIR)
curl -s 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css' > '$@'
curl -s 'https://cdn.datatables.net/1.10.16/css/jquery.dataTables.css' >> '$@'
$(JAVASCRIPT): $(OUTPUT_DIR)
curl -s 'https://code.jquery.com/jquery-3.2.1.min.js' > '$@'
curl -s 'https://cdn.datatables.net/1.10.16/js/jquery.dataTables.js' >> '$@'
$(INDEX_HTML): $(OUTPUT_DIR)
$(PYTHON) create_team_report.py 'sqlite:///$(DATABASE)' \
'$(TEMPLATE)' > '$@'
$(OUTPUT_DIR):
mkdir '$@'
test:
$(PYTHON) -m nose --with-doctest serlo tests