From 075d7e43f7514d8978f70672945e518378ce2a14 Mon Sep 17 00:00:00 2001 From: UAb5eSMn <5942222+UAb5eSMn@users.noreply.github.com> Date: Mon, 30 Mar 2026 19:01:22 +0200 Subject: [PATCH] Check if machine.c can be compiled for all machines --- .github/workflows/build.yml | 4 +++- Makefile | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10e9636..606284d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,5 +17,7 @@ jobs: run: | apt update apt install make gcc sdcc xxd python-is-python3 libjson-c-dev -y + - name: Check if machine.c can be compiled for all machines + run: make machine_check - name: Make project - run: make MACHINE="KP_9000_6XHML_X2" \ No newline at end of file + run: make MACHINE="KP_9000_6XHML_X2" diff --git a/Makefile b/Makefile index 3956ffc..ee4ae41 100644 --- a/Makefile +++ b/Makefile @@ -78,4 +78,15 @@ $(BUILDDIR)/rtlplayground.bin: $(BUILDDIR)/rtlplayground.img .PHONY: clean all $(SUBDIRS) $(VERSION_HEADER) +.PHONY: +machine_check: + @mkdir -p $(BUILDDIR)/tmp + @set -eo pipefail; \ + for MACHINE in `grep -e ' MACHINE_' machine.c | sed -e 's%^.* MACHINE_%%' -e 's%[ ]*//.*$$%%' | sort -u`; \ + do \ + echo "Checking $${MACHINE}"; \ + $(CC) $(CC_FLAGS) -DMACHINE_$${MACHINE} -MMD -o $(BUILDDIR)/tmp/machine_check -c machine.c; \ + done + @rm -rf $(BUILDDIR)/tmp + -include $(DEPS)