-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (59 loc) · 1.54 KB
/
Makefile
File metadata and controls
80 lines (59 loc) · 1.54 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Distribution of code to students
DIST_FILE := coco
DIST_DIR := coco
DIST_BRANCH := dist
DIST_ADDFILES := doc/langref.pdf
.PHONY: all
all: deps passes
# dependencies
.PHONY: deps
deps: lib/.bootstrapped
@if ! which frontend; then \
echo "PATH incorrect - make sure the virtualenv is activated!"; \
echo "Run 'source shrc' and try running make again"; \
exit 1; \
fi
lib/.bootstrapped: | bootstrap.sh
bash bootstrap.sh
touch $@
# LLVM passes
.PHONY: passes
passes: deps
make -C llvm-passes
# Runtime with helper functions
.PHONY: runtime
runtime: deps
make -C runtime
# tests
.PHONY: check-frontend check-passes
check-frontend: deps
make -C frontend check
check-passes: passes runtime
make -C llvm-passes check
# full program examples
.PHONY: examples example-%
examples: passes runtime
make -BC examples
example-%: passes runtime
make -BC examples bin/$*
# cleanup
.PHONY: clean
clean:
rm -f bootstrap.log $(DIST_FILE).tar.gz
make -C llvm-passes clean
make -C runtime clean
make -C examples clean
.PHONY: cleaner
cleaner: clean
rm -rf lib
rm -f handin-1.tar.gz handin-2.tar.gz handin-3.tar.gz
.PHONY: handin-1 handin-2 handin-3
handin-1:
echo "Creating tarball for assignment 1"
tar -cvz --exclude='__pycache__' --exclude='*.pyc' -f handin-1.tar.gz frontend
handin-2:
echo "Creating tarball for assignment 2"
tar -cvz --exclude='*.o' --exclude='obj/' -f handin-2.tar.gz llvm-passes
handin-3:
echo "Creating tarball for assignment 3"
tar -cvz --exclude='*.o' --exclude='obj/' -f handin-3.tar.gz llvm-passes runtime