Files
RTLPlayground/test/stp/Makefile
T
João Silva 970e98f4c5 test/stp: pack host structs like SDCC and cover the edge recovery
Build the harness with -fpack-struct=1 and assert the frame struct sizes,
so the host reads wire bytes the way the firmware lays them out. Add
scenarios for a port that regains edge after a hold, one that heard a BPDU
and stays non-edge, auto-edge switched off, and a captured RouterOS BPDU
fed in on every port, tagged and untagged.
2026-10-27 22:11:24 +01:00

30 lines
840 B
Makefile

CC ?= cc
SRCROOT = ../..
CFLAGS = -std=c11 -g -O1 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-unknown-pragmas \
-Wno-pointer-sign \
-fpack-struct=1 \
-DRTLP_HOST_TEST \
-fsanitize=address,undefined -fno-omit-frame-pointer \
-include ../sdcc_shim.h -I../stub -I$(SRCROOT) -I$(SRCROOT)/httpd -I$(SRCROOT)/uip
ifeq ($(findstring clang,$(shell $(CC) --version 2>/dev/null)),)
CFLAGS += -Wno-builtin-declaration-mismatch
endif
LDFLAGS = -fsanitize=address,undefined
SRCS = stp_sim.c $(SRCROOT)/rtl837x_stp.c $(SRCROOT)/rtl837x_stp_cli.c
all: build/stp_sim
./build/stp_sim
verbose: build/stp_sim
./build/stp_sim -v
build/stp_sim: $(SRCS) $(SRCROOT)/rtl837x_stp.h
mkdir -p build
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean:
rm -rf build
.PHONY: all verbose clean