mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 21:09:34 -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.
26 lines
705 B
Makefile
26 lines
705 B
Makefile
TARGET := auto_state_load_test
|
|
ROOT := ../../..
|
|
SOURCES := auto_state_load_test.c $(ROOT)/command.c \
|
|
$(ROOT)/libretro-common/compat/compat_strl.c
|
|
CFLAGS += -O2 -g1 -std=gnu89 -Wall -flto \
|
|
-ffunction-sections -fdata-sections \
|
|
-I$(ROOT) -I$(ROOT)/menu -I$(ROOT)/libretro-common/include $(EXTRA_CFLAGS)
|
|
LDFLAGS += -flto -Wl,--gc-sections
|
|
ifneq ($(SANITIZER),)
|
|
CFLAGS += -fsanitize=$(SANITIZER) -fno-omit-frame-pointer
|
|
LDFLAGS += -fsanitize=$(SANITIZER)
|
|
endif
|
|
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(SOURCES) $(ROOT)/runloop.c $(ROOT)/runloop.h
|
|
$(CC) $(CFLAGS) $(SOURCES) -o $@ $(LDFLAGS)
|
|
|
|
check: $(TARGET)
|
|
./$(TARGET)
|
|
|
|
clean:
|
|
rm -f $(TARGET) $(TARGET).exe
|
|
|
|
.PHONY: all check clean
|