Files
RetroArch/samples/input/android_kbd_mailbox/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

44 lines
1.1 KiB
Makefile

include ../../sample_objdir.mk
TARGET := android_kbd_mailbox_test
LIBRETRO_COMM_DIR := ../../../libretro-common
# Self-contained: the hazard protocol under test is reproduced in the
# harness (see the file header for why), so the only tree dependency
# is rthreads.c for portable threads and locks. retro_atomic.h and
# retro_miscellaneous.h are header-only.
SOURCES := \
android_kbd_mailbox_test.c \
$(LIBRETRO_COMM_DIR)/rthreads/rthreads.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c
OBJS := $(call sample_objs,$(SOURCES:.c=.o))
CFLAGS += -Wall -std=gnu99 -g1 -O1 \
-DHAVE_THREADS -I$(LIBRETRO_COMM_DIR)/include
LDFLAGS += -lpthread -lrt
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) $<