-.PHONY: nogit
-nogit:
- @if [ -d .git ]; then \
- echo "To compile from git sources, please use ./all instead!"; \
- exit 1; \
- fi
+GIT := $(shell [ -d .git ] && printf "\e[1;31mTo compile from git, please read https://gitlab.com/xonotic/xonotic/-/wikis/Repository_Access\e[m")
+ifdef GIT
+ $(error $(GIT))
+endif
+
+.EXTRA_PREREQS := $(findstring update-stable,$(MAKECMDGOALS)) $(findstring update-beta,$(MAKECMDGOALS))