CC = gcc
# comm/conf_get.c against stand-ins for conf_general.h, mempools.h, app.h,
# mc_interface.h and utils_sys.h (this directory); the real datatypes.h and
# commands.h. Built twice: single-motor and HW_HAS_DUAL_MOTORS.
CFLAGS = -O2 -g -Wall -Wextra -Wundef -std=gnu99 -I. -I../../comm -I../.. -DNO_STM32 \
	-DCONF_GET_SECTION= -fsanitize=address,undefined -fno-omit-frame-pointer
SRC = main.c ../../comm/conf_get.c
DEPS = $(SRC) ../../comm/conf_get.h ../../datatypes.h $(wildcard *.h)

all: test test_dual

test: $(DEPS)
	$(CC) $(CFLAGS) $(SRC) -o $@

test_dual: $(DEPS)
	$(CC) $(CFLAGS) -DHW_HAS_DUAL_MOTORS $(SRC) -o $@

run: all
	./test
	./test_dual

clean:
	rm -f test test_dual

.PHONY: all run clean
