Files
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

47 lines
1.3 KiB
Makefile

include ../../sample_objdir.mk
TARGET := android_lifecycle_flush_test
LIBRETRO_COMM_DIR := ../../../libretro-common
# The command handling is reproduced in the harness (see the file
# header for why); the acknowledgement and its wait are the driver's
# frontend/drivers/android_lifecycle.h, which waits on an eventcount.
SOURCES := android_lifecycle_flush_test.c \
$(LIBRETRO_COMM_DIR)/rthreads/retro_eventcount.c \
$(LIBRETRO_COMM_DIR)/rthreads/rthreads.c \
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c
OBJS := $(call sample_objs,$(SOURCES:.c=.o))
CFLAGS += -Wall -std=gnu89 -g1 -O1 \
-D_GNU_SOURCE -DHAVE_THREADS \
-I$(LIBRETRO_COMM_DIR)/include
LDFLAGS += -pthread
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) -o $@ $(OBJS) $(LDFLAGS)
check: all
./$(TARGET)
clean:
rm -rf $(SAMPLE_OBJDIR)
rm -f $(OBJS) $(TARGET)
.PHONY: all check clean
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
@mkdir -p $(@D)
$(COMPILE.c) $(OUTPUT_OPTION) $<