# Host tests for applications/throttle_guard.c, the throttle wiring-fault guard
# app_adc runs on every sample. The module is plain C, so the real file is
# compiled as is.
#
#   nix-shell -p gcc gnumake --run 'make run'

TOP = ../..
CFLAGS = -std=gnu99 -O1 -g -Wall -Wextra -Wundef -I$(TOP)/applications
SAN = -fsanitize=address,undefined -fno-sanitize-recover=all

all: test

test: main.c $(TOP)/applications/throttle_guard.c $(TOP)/applications/throttle_guard.h
	gcc $(CFLAGS) $(SAN) -o $@ main.c $(TOP)/applications/throttle_guard.c -lm

run: test
	./test

clean:
	rm -f test

.PHONY: all run clean
