Files
RetroArch/samples/frontend/android_lifecycle/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

41 lines
1.1 KiB
Makefile

# frontend/drivers/android_lifecycle.h: the lifecycle handshakes between
# the NativeActivity callbacks, the app thread and a window holder.
include ../../sample_objdir.mk
TARGET := android_lifecycle_test
CORE_DIR := ../../..
LRC := $(CORE_DIR)/libretro-common
SOURCES := android_lifecycle_test.c \
$(LRC)/rthreads/retro_eventcount.c \
$(LRC)/rthreads/rthreads.c \
$(LRC)/features/features_cpu.c \
$(LRC)/compat/compat_strl.c \
$(LRC)/string/stdstring.c \
$(LRC)/encodings/encoding_utf.c
CFLAGS += -Wall -std=gnu99 -g1 -O1 -D_GNU_SOURCE -DHAVE_THREADS -I$(LRC)/include
LDFLAGS += -lpthread
OBJS := $(call sample_objs,$(SOURCES:.c=.o))
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
all: $(TARGET)
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
@mkdir -p $(@D)
$(CC) -c -o $@ $< $(CFLAGS)
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
check: $(TARGET)
./$(TARGET)
clean:
rm -rf $(SAMPLE_OBJDIR)
rm -f $(TARGET) $(OBJS)
.PHONY: all check clean