# DSP tests + benchmarks for the standalone FFT (src/fft.c has no app/raylib deps).
#
# The repo's top-level Makefile is Premake-generated and gitignored, so the DSP
# test target lives here where it's version-controlled.
#
#   make -C bench test    # correctness: FFT vs double-precision reference DFT
#   make -C bench bench    # timing over the real mlnl_samples.wav STFT workload
#
# Same release flags the app uses, so this exercises the real codegen path
# (-ffast-math reordering included). Override CC/CFLAGS to test other toolchains.
CC ?= cc
CFLAGS ?= -O3 -ffast-math -march=x86-64-v3 -Wall
LDLIBS := -lm

SRC := ../src/fft.c

.PHONY: test bench clean

test: fft_verify
	./fft_verify

bench: fft_bench
	./fft_bench

fft_verify: fft_verify.c $(SRC)
	$(CC) $(CFLAGS) $^ $(LDLIBS) -o $@

fft_bench: fft_bench.c $(SRC)
	$(CC) $(CFLAGS) $^ $(LDLIBS) -o $@

clean:
	rm -f fft_verify fft_bench
