# bms.c's cold regen taper (limit_mode bit 4), on the host with the hand-moved
# clock and stubs of tests/bms_local/fake.
TARGET = test
CC = gcc
CFLAGS = -O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer -Wall -Wextra -Wundef \
         -std=gnu99 -DNO_STM32 -I../bms_local/fake -I../.. -I../../util

.PHONY: default all clean run

default: $(TARGET)
all: default

$(TARGET): main.c ../../bms.c ../../util/buffer.c ../../util/utils_math.c ../bms_local/fake/*.h
	$(CC) $(CFLAGS) main.c ../../bms.c ../../util/buffer.c ../../util/utils_math.c -lm -o $@

clean:
	rm -f $(TARGET)

run: $(TARGET)
	./$(TARGET)
