Files
RetroArch/samples/audio/switch_audio/Makefile
LibretroAdmin 21635dd171 samples: build with -g1 instead of -g
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.
2026-10-13 11:50:11 +02:00

36 lines
885 B
Makefile

TARGET := switch_audio_test
LIBRETRO_COMM_DIR := ../../../libretro-common
# The stand-in <switch.h> is found here, ahead of any other.
INCDIRS := -I. -I$(LIBRETRO_COMM_DIR)/include -I../../.. -I../../../deps
CFLAGS += -std=gnu99 -Wall $(INCDIRS) -DRARCH_INTERNAL -DHAVE_CONFIGFILE -DHAVE_MENU -D_GNU_SOURCE
LDFLAGS += -lm
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer -g1 $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
OBJS := switch_audio_test.o audout_mock.o stubs_retroarch.o switch_audio.o
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
# The libnx build of the driver.
switch_audio.o: ../../../audio/drivers/switch_audio.c
$(CC) $(CFLAGS) -DSWITCH -DHAVE_LIBNX -c -o $@ $<
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
check: $(TARGET)
./$(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
.PHONY: all check clean