-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (37 loc) · 923 Bytes
/
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
COMPILER = stickytape
COMPILER_OUTPUT = --output-file
EXPERIMENTS = \
digitspan \
trailmaking \
rt_simple \
nback
RELEASE = $(shell date +%Y-%m-%d)
TARGET_FILE = cognitive-tasks-$(RELEASE).zip
CONFIG = config.conf
I18N = i18n.conf
ifeq ($(FORCE),)
ifneq ($(shell git rev-parse --abbrev-ref HEAD), master)
$(error Not on branch master)
endif
ifneq ($(shell git status -s --untracked-files=no),)
$(error Uncommited changes to master branch)
endif
endif
build: mkdir $(EXPERIMENTS)
mkdir:
@mkdir -p build
$(EXPERIMENTS): %:
@mkdir -p build/$*
$(COMPILER) tasks/$*/$*.py $(COMPILER_OUTPUT) build/$*/$*.py
@sed -i '2i# -*- coding: utf-8 -*-' build/$*/$*.py
@cp tasks/$*/$(CONFIG) build/$*/
@cp tasks/$*/$(I18N) build/$*/
zip:
@cd build;\
zip -r $(TARGET_FILE) */*
release: mkdir clean build zip
@echo ::::::
@echo built build/$(TARGET_FILE)
@stat build/$(TARGET_FILE) -c"%s bytes"
clean:
@rm -r build