mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-23 00:36:42 -10:00
The sample and test builds used full debug info. -g1 keeps what sanitizer reports and backtraces need - function names, files and line numbers - and drops the variable and type information nobody reads in CI. Objects get about 30% smaller (rh265.o under ASan+UBSan: 5.1MB to 3.7MB), so the ccache caches hold more of each job's build and are quicker to restore and save.
47 lines
1.4 KiB
Makefile
47 lines
1.4 KiB
Makefile
# Regression test for the embedded MCP server, network/mcp_server.c,
|
|
# against a stub command table. Builds with gcc/clang and with
|
|
# mingw-w64 (compiler=x86_64-w64-mingw32-gcc; run the .exe under Wine).
|
|
compiler ?= gcc
|
|
TARGET := mcp_server_test
|
|
CORE_DIR = ../../..
|
|
LIBRETRO_COMM_DIR = $(CORE_DIR)/libretro-common
|
|
|
|
SOURCES := \
|
|
mcp_server_test.c \
|
|
stubs.c \
|
|
$(CORE_DIR)/network/mcp_server.c \
|
|
$(LIBRETRO_COMM_DIR)/net/net_socket.c \
|
|
$(LIBRETRO_COMM_DIR)/net/net_compat.c \
|
|
$(LIBRETRO_COMM_DIR)/formats/json/rjson.c \
|
|
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
|
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
|
|
$(LIBRETRO_COMM_DIR)/string/rstrtod.c \
|
|
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
|
|
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
|
|
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
|
|
$(LIBRETRO_COMM_DIR)/time/rtime.c
|
|
|
|
CFLAGS += -std=gnu99 -Wall -g1 -O1 -I$(LIBRETRO_COMM_DIR)/include -I$(CORE_DIR) \
|
|
-DHAVE_NETWORKING -DHAVE_COMMAND -DHAVE_NETWORK_CMD -DHAVE_MCP -DRARCH_INTERNAL
|
|
ifneq ($(SANITIZER),)
|
|
CFLAGS += -fsanitize=$(SANITIZER) -fno-omit-frame-pointer
|
|
LDFLAGS += -fsanitize=$(SANITIZER)
|
|
endif
|
|
ifneq ($(findstring mingw,$(compiler)),)
|
|
TARGET := $(TARGET).exe
|
|
LDFLAGS += -lws2_32 -static
|
|
endif
|
|
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(SOURCES)
|
|
$(compiler) $(CFLAGS) $(SOURCES) -o $@ $(LDFLAGS)
|
|
|
|
check: $(TARGET)
|
|
./$(TARGET)
|
|
|
|
clean:
|
|
rm -f mcp_server_test mcp_server_test.exe
|
|
|
|
.PHONY: all check clean
|