Makefile: add git function

This commit is contained in:
Zihao Yu
2022-09-04 22:11:57 +08:00
parent e2c722ddb1
commit 246aab344d

View File

@ -1,7 +1,20 @@
include nemu/scripts/git.mk
STUID = 211220000
STUNAME = 张三
default:
@echo "Please run 'make' under any subprojects to compile."
# DO NOT modify the following code!!!
GITFLAGS = -q --author='tracer-ics2022 <tracer@njuics.org>' --no-verify --allow-empty
# prototype: git_commit(msg)
define git_commit
-@git add $(NEMU_HOME)/.. -A --ignore-errors
-@while (test -e .git/index.lock); do sleep 0.1; done
-@(echo "> $(1)" && echo $(STUID) $(STUNAME) && uname -a && uptime) | git commit -F - $(GITFLAGS)
-@sync
endef
_default:
@echo "Please run 'make' under subprojects."
submit:
git gc