37 lines
885 B
Makefile
37 lines
885 B
Makefile
# 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)
|