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)