This commit is contained in:
2026-06-16 04:59:02 +10:00
parent e139079a3c
commit 436d452deb
14 changed files with 399 additions and 135 deletions
+36
View File
@@ -0,0 +1,36 @@
# SPPro - host build for the portable C parser (dev tooling, lives in extras/).
# The library itself is ../src; these targets are not part of the published
# Arduino/PlatformIO library.
CC ?= cc
CFLAGS ?= -std=c99 -Wall -Wextra -Wpedantic -O2 -I../src
LDFLAGS ?=
SRCDIR := ../src
SRC := $(SRCDIR)/sppro.c $(SRCDIR)/md5.c
HDR := $(SRCDIR)/sppro.h $(SRCDIR)/md5.h
BUILD := build
.PHONY: all test host clean
all: test host
# Host unit tests (no hardware required).
$(BUILD)/test_sppro: tests/test_sppro.c $(SRC) $(HDR) | $(BUILD)
$(CC) $(CFLAGS) -o $@ tests/test_sppro.c $(SRC) -lm
test: $(BUILD)/test_sppro
./$(BUILD)/test_sppro
# Linux serial-console dashboard demo.
$(BUILD)/sppro-console: host/main.c $(SRC) $(HDR) | $(BUILD)
$(CC) $(CFLAGS) -o $@ host/main.c $(SRC) -lm
host: $(BUILD)/sppro-console
$(BUILD):
mkdir -p $(BUILD)
clean:
rm -rf $(BUILD)