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.
48 lines
1.2 KiB
Makefile
48 lines
1.2 KiB
Makefile
include ../../sample_objdir.mk
|
|
|
|
TARGET := android_pad_removed_test
|
|
|
|
LIBRETRO_COMM_DIR := ../../../libretro-common
|
|
DRIVER_DIR := ../../../input/drivers
|
|
|
|
# The mailbox and the pad-slot rules are the driver's own
|
|
# (android_pad_removed.h, which takes no NDK types); the listener and
|
|
# the input thread around them are reproduced in the harness, because
|
|
# the driver only builds against the NDK. rthreads.c is the only other
|
|
# tree dependency.
|
|
SOURCES := \
|
|
android_pad_removed_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 -I$(DRIVER_DIR)
|
|
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)
|
|
|
|
android_pad_removed_test.o: $(DRIVER_DIR)/android_pad_removed.h
|
|
|
|
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) $<
|