Skip to content

Instantly share code, notes, and snippets.

@SimonLammer
Created October 14, 2023 18:35
Show Gist options
  • Save SimonLammer/0959e4c3a4c9c05b822c2557b1207d8f to your computer and use it in GitHub Desktop.
Save SimonLammer/0959e4c3a4c9c05b822c2557b1207d8f to your computer and use it in GitHub Desktop.
Makefile that creates tags with incrementing suffix
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