# The speed gate on mcpwm_foc's zero-duty short, motor/foc_duty_short.h,
# and foc_beep's refusal at speed (beep.py reads mcpwm_foc.c).
TARGET = test
LIBS = -lm -fsanitize=address,undefined
CC = gcc
CFLAGS = -O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer -Wall -Wextra -Wundef \
         -std=gnu99 -I../../motor -DNO_STM32

.PHONY: default all clean run

default: $(TARGET)
all: default

$(TARGET): main.c ../../motor/foc_duty_short.h
	$(CC) $(CFLAGS) main.c $(LIBS) -o $@

clean:
	rm -f $(TARGET)

run: $(TARGET)
	./$(TARGET)
	python3 beep.py ../../motor/mcpwm_foc.c ../../motor/foc_duty_short.h
