summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSanjit Bhat <[email protected]>2023-09-12 14:03:13 -0400
committerSanjit Bhat <[email protected]>2023-09-12 14:03:13 -0400
commit63f1eb99e584ac2aee2c5831824d71a7220dbc7f (patch)
tree69fdf6032f8e49eaca2ff9edc93ce956557a8af0 /Makefile
parent9ffdd55f1013700062859c3c8ff60bfb25db9731 (diff)
downloadxv6-labs-63f1eb99e584ac2aee2c5831824d71a7220dbc7f.tar.gz
xv6-labs-63f1eb99e584ac2aee2c5831824d71a7220dbc7f.tar.bz2
xv6-labs-63f1eb99e584ac2aee2c5831824d71a7220dbc7f.zip
Makefile: new submission system
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 5 insertions, 46 deletions
diff --git a/Makefile b/Makefile
index aabd280..5844ba3 100644
--- a/Makefile
+++ b/Makefile
@@ -338,21 +338,10 @@ grade:
./grade-lab-$(LAB) $(GRADEFLAGS)
##
-## FOR web handin
+## FOR submissions
##
-
-WEBSUB := https://6828.scripts.mit.edu/2023/handin.py
-
-handin: tarball-pref myapi.key
- @SUF=$(LAB); \
- curl -f -F file=@lab-$$SUF-handin.tar.gz -F key=\<myapi.key $(WEBSUB)/upload \
- > /dev/null || { \
- echo ; \
- echo Submit seems to have failed.; \
- echo Please go to $(WEBSUB)/ and upload the tarball manually.; }
-
-handin-check:
+submit-check:
@if ! test -d .git; then \
echo No .git directory, is this a git repository?; \
false; \
@@ -374,37 +363,7 @@ handin-check:
test "$$r" = y; \
fi
-UPSTREAM := $(shell git remote -v | grep -m 1 "xv6-labs-2023" | awk '{split($$0,a," "); print a[1]}')
-
-tarball: handin-check
- git archive --format=tar HEAD | gzip > lab-$(LAB)-handin.tar.gz
-
-tarball-pref: handin-check
- @SUF=$(LAB); \
- git archive --format=tar HEAD > lab-$$SUF-handin.tar; \
- git diff $(UPSTREAM)/$(LAB) > /tmp/lab-$$SUF-diff.patch; \
- tar -rf lab-$$SUF-handin.tar /tmp/lab-$$SUF-diff.patch; \
- gzip -c lab-$$SUF-handin.tar > lab-$$SUF-handin.tar.gz; \
- rm lab-$$SUF-handin.tar; \
- rm /tmp/lab-$$SUF-diff.patch; \
-
-myapi.key:
- @echo Get an API key for yourself by visiting $(WEBSUB)/
- @read -p "Please enter your API key: " k; \
- if test `echo "$$k" |tr -d '\n' |wc -c` = 32 ; then \
- TF=`mktemp -t tmp.XXXXXX`; \
- if test "x$$TF" != "x" ; then \
- echo "$$k" |tr -d '\n' > $$TF; \
- mv -f $$TF $@; \
- else \
- echo mktemp failed; \
- false; \
- fi; \
- else \
- echo Bad API key: $$k; \
- echo An API key should be 32 characters long.; \
- false; \
- fi;
-
+zipball: submit-check
+ git archive --format=zip --output lab.zip HEAD
-.PHONY: handin tarball tarball-pref clean grade handin-check
+.PHONY: zipball clean grade submit-check