From a4a0b2e8454243cc4637d84cbde53573b8c5dbb3 Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 22 Jan 2026 12:15:48 +0100 Subject: [PATCH] Add `check` recipe, which checks the code using `sparse`. --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 847f73c..6ff5c47 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,10 @@ SHELL = /bin/sh VERSION = 0.0 -CMAKE ?= cmake -G 'Unix Makefiles' -XXD ?= xxd -TAR ?= tar +CMAKE ?= cmake -G 'Unix Makefiles' +XXD ?= xxd +TAR ?= tar +SPARSE ?= sparse RES := $(wildcard res/*.glsl) SRC := $(shell find src/ -name '*.c' -print) $(addsuffix .c,$(RES)) lib/glad/src/gl.c @@ -63,6 +64,14 @@ all: bin/mcaselector-lite bin/mcaselector-lite.stripped # TODO: Same goes for install-strip, which does the same, but with the stripped binary instead. # TODO: Include distclean which recompiles the libraries. +# Executes checks upon the code. +# The standard requires code to already be built at this stage. +# This isn't necessary for this, but may be added in the future, +# if so add the binary in the prerequisites. +.PHONY: +check: $(SRC) + $(Q)$(SPARSE) $(CPPFLAGS) $< + .PHONY: clean: -$(Q)$(RM) $(OBJ) $(DEP)