# bms.c's limits from a BMS on CAN and from a script's own values
# (bms_take_local), on the host with a hand-moved clock (fake/).
TARGET = test
CC = gcc
CFLAGS = -O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer -Wall -Wextra -Wundef \
         -std=gnu99 -DNO_STM32 -Ifake -I../.. -I../../util

.PHONY: default all clean run

default: $(TARGET)
all: default

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

clean:
	rm -f $(TARGET)

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