From 36c4de5e4a8da74c309b654bf338a6f5efe77a35 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 25 Feb 2025 03:22:57 +1000 Subject: [PATCH] pipeline: improve reliability of certain make targets (test, clean) --- Makefile | 3 +++ qcsrc/Makefile | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4040d6d2a..06d18db85 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ DIFF ?= diff # xonotic build system overrides this by command line argument to turn off the check-cvars step XON_BUILDSYSTEM = +# If requested, these targets must always run first: +.EXTRA_PREREQS := $(filter clean, $(MAKECMDGOALS)) + .PHONY: all all: check-cvars $(MAKE) -C qcsrc all diff --git a/qcsrc/Makefile b/qcsrc/Makefile index 4994469c1..ce59dcaf3 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -24,12 +24,15 @@ ifndef ZIP endif +# If requested, these targets must always run first: +.EXTRA_PREREQS := $(filter clean, $(MAKECMDGOALS)) .PHONY: all all: qc pk3 $(WORKDIR): @mkdir -p $@ +$(WORKDIR): .EXTRA_PREREQS = # prevents circular dependency .PHONY: clean clean: | $(WORKDIR) @@ -59,13 +62,13 @@ pk3: csprogs-$(VER).pk3 -DIFFTESTS = test-genmod test-cvar-spelling +DIFFTESTS = test-genmod .WAIT test-cvar-spelling COMPTESTS = test-server test-client test-menu .PHONY: test test-diff $(DIFFTESTS) test-comp $(COMPTESTS) -test: $(DIFFTESTS) $(COMPTESTS) +test: $(DIFFTESTS) .WAIT $(COMPTESTS) -test-diff: test-genmod test-cvar-spelling +test-diff: $(DIFFTESTS) test-genmod: tools/scripts-diff-test-wrapper.sh genmod.sh test-cvar-spelling: -- 2.39.5