mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-23 09:49:34 -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.
46 lines
1.1 KiB
Makefile
46 lines
1.1 KiB
Makefile
include ../../sample_objdir.mk
|
|
|
|
TARGET := output_store_test
|
|
|
|
LIBRETRO_COMM_DIR := ../../../libretro-common
|
|
INPUT_DIR := ../../../input
|
|
|
|
# The store is the frontend's own (input_output_store.h, which takes no
|
|
# driver, settings or libretro types); the core that posts and the
|
|
# frame loop that takes are reproduced in the harness. rthreads.c is
|
|
# the only other tree dependency.
|
|
SOURCES := \
|
|
output_store_test.c \
|
|
$(LIBRETRO_COMM_DIR)/rthreads/rthreads.c
|
|
|
|
OBJS := $(call sample_objs,$(SOURCES:.c=.o))
|
|
|
|
CFLAGS += -Wall -std=gnu99 -g1 -O1 \
|
|
-DHAVE_THREADS -I$(LIBRETRO_COMM_DIR)/include -I$(INPUT_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)
|
|
|
|
output_store_test.o: $(INPUT_DIR)/input_output_store.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) $<
|