-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
43 lines (36 loc) · 1.64 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
FUNCTIONS=start_assignment gh_repo go_grader grades generate_report cos326_grader cos326_parse_results cos326_parse_comment
OUTPUTS=$(patsubst %, output/%.img, $(FUNCTIONS))
RUNS=$(patsubst %, run/%, $(FUNCTIONS))
.PHONY: all
all: $(OUTPUTS) #$(RUNS)
output/%.img: functions/%/*
@truncate -s 500M $@
@mkfs.ext2 -F $@
@ \
if [ -f functions/$*/Makefile ]; then \
make -C functions/$*; \
cptofs -t ext2 -i $@ functions/$*/out/* /; \
else \
cptofs -t ext2 -i $@ functions/$*/* /; \
fi
@e2fsck -f $@
@resize2fs -M $@
output/%.tgz: examples/%/*
tar -C examples/$* -czf $@ .
output/%_submission.tgz: examples/%_submission/*
tar -C examples -czf $@ $*_submission/
.PHONY: prepdb
prepdb: output/example_cos316_grader.tgz output/example_cos316_submission.tgz output/example_cos326_grader.tgz output/example_cos326_submission.tgz
sfdb cos316/example/grading_script - < output/example_cos316_grader.tgz
sfdb github/cos316/example/submission.tgz - < output/example_cos316_submission.tgz
sfdb cos326-f22/assignments '{"example": {"grading_script": "cos326-f22/example/grading_script", "runtime_limit": 1}}'
sfdb cos326-f22/enrollments.json '{"[email protected]": {"type": "Staff"}}'
sfdb users/github/from/ghost '[email protected]'
sfblob < output/example_cos326_grader.tgz | tr -d '\n' | sfdb cos326-f22/example/grading_script -
sfblob < output/example_cos326_submission.tgz | tr -d '\n' | sfdb github/cos326-f22/example/submission.tgz -
run/%: output/%.img payloads/%.jsonl
@singlevm --mem_size 1024 --kernel vmlinux-4.20.0 --rootfs python3.ext4 --appfs output/$*.img < payloads/$*.jsonl
@touch $@
.PHONY: clean
clean:
rm -f $(OUTPUTS) $(RUNS)