Created
October 14, 2023 18:35
-
-
Save SimonLammer/0959e4c3a4c9c05b822c2557b1207d8f to your computer and use it in GitHub Desktop.
Makefile that creates tags with incrementing suffix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIT_REMOTE=origin | |
help: | |
@echo Use any of the following targets: | |
@grep '^[a-z]' Makefile | cut -d : -f 1 | |
_submit: | |
# Argument ASS needs to be set for this target! | |
n=$(shell git tag -l | grep ${ASS} | cut -d '-' -f 2 | sort -n | tail -n 1) ;\ | |
[ -z "$$n" ] && n=0 ;\ | |
n=`expr $$n + 1` ;\ | |
git tag ${ASS}-$$n | |
git push ${GIT_REMOTE} --tags | |
submit-warmup: | |
@make _submit ASS=warmup | |
submit-assignment1: | |
@make _submit ASS=assignment1 | |
submit-assignment2: | |
@make _submit ASS=assignment2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment