Add check recipe, which checks the code using sparse.

This commit is contained in:
2026-01-22 12:15:48 +01:00
parent 52d1f9a6f7
commit a4a0b2e845

View File

@@ -8,9 +8,10 @@ SHELL = /bin/sh
VERSION = 0.0 VERSION = 0.0
CMAKE ?= cmake -G 'Unix Makefiles' CMAKE ?= cmake -G 'Unix Makefiles'
XXD ?= xxd XXD ?= xxd
TAR ?= tar TAR ?= tar
SPARSE ?= sparse
RES := $(wildcard res/*.glsl) RES := $(wildcard res/*.glsl)
SRC := $(shell find src/ -name '*.c' -print) $(addsuffix .c,$(RES)) lib/glad/src/gl.c 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: Same goes for install-strip, which does the same, but with the stripped binary instead.
# TODO: Include distclean which recompiles the libraries. # 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: .PHONY:
clean: clean:
-$(Q)$(RM) $(OBJ) $(DEP) -$(Q)$(RM) $(OBJ) $(DEP)