-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
23 lines (21 loc) · 1.16 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
# This is the Makefile helping you submit the labs.
# Just create 6.824/api.key with your API key in it,
# and submit your lab with the following command:
# $ make [lab1|lab2a|lab2b|lab3a|lab3b|lab4a|lab4b|lab5]
KEY=$(shell cat api.key)
LABS=" lab1 lab2a lab2b lab3a lab3b lab4a lab4b lab5 "
%:
@if echo $(LABS) | grep -q " $@ " ; then \
tar cvzf [email protected] --exclude=src/main/kjv12.txt Makefile .git src; \
if test -z $(KEY) ; then \
echo "Missing $(PWD)/api.key. Please create the file with your key in it or submit the [email protected] via the web interface."; \
else \
echo "Are you sure you want to submit $@? Enter 'yes' to continue:"; \
read line; \
if test $$line != "yes" ; then echo "Giving up submission"; exit; fi; \
if test `stat -c "%s" "[email protected]" 2>/dev/null || stat -f "%z" "[email protected]"` -ge 20971520 ; then echo "File exceeds 20MB."; exit; fi; \
curl -F file=@[email protected] -F key=$(KEY) http://6824.scripts.mit.edu/submit/handin.py/upload; \
fi; \
else \
echo "Bad target $@. Usage: make [$(LABS)]"; \
fi