mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 21:09: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.
75 lines
2.0 KiB
Makefile
75 lines
2.0 KiB
Makefile
include ../../sample_objdir.mk
|
|
|
|
compiler := gcc
|
|
TARGET := webdav_backup_test
|
|
|
|
CORE_DIR = ../../..
|
|
LIBRETRO_COMM_DIR = $(CORE_DIR)/libretro-common
|
|
INCDIRS := -I$(LIBRETRO_COMM_DIR)/include -I$(CORE_DIR)
|
|
|
|
CC := $(compiler)
|
|
flags += -std=gnu99
|
|
|
|
# The test includes network/cloud_sync/webdav.c so it can drive the
|
|
# retry paths as shipped; everything below is what that translation unit
|
|
# needs to link.
|
|
SOURCES_C := \
|
|
webdav_backup_test.c \
|
|
stubs_retroarch.c \
|
|
$(LIBRETRO_COMM_DIR)/lists/string_list.c \
|
|
$(LIBRETRO_COMM_DIR)/file/file_path.c \
|
|
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
|
|
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
|
|
$(LIBRETRO_COMM_DIR)/encodings/encoding_base64.c \
|
|
$(LIBRETRO_COMM_DIR)/hash/lrc_hash.c \
|
|
$(LIBRETRO_COMM_DIR)/utils/md5.c \
|
|
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
|
$(LIBRETRO_COMM_DIR)/file/file_path_io.c \
|
|
$(LIBRETRO_COMM_DIR)/net/net_http.c \
|
|
$(LIBRETRO_COMM_DIR)/net/net_compat.c \
|
|
$(LIBRETRO_COMM_DIR)/net/net_socket.c \
|
|
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
|
|
$(LIBRETRO_COMM_DIR)/string/rstrtod.c \
|
|
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
|
|
$(LIBRETRO_COMM_DIR)/compat/compat_strldup.c \
|
|
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
|
|
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
|
|
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
|
|
$(LIBRETRO_COMM_DIR)/time/rtime.c
|
|
|
|
CFLAGS += -Wall $(INCDIRS)
|
|
CFLAGS += -DHAVE_NETWORKING -DHAVE_CLOUDSYNC -D_GNU_SOURCE
|
|
LDFLAGS += -lm
|
|
|
|
ifneq ($(SAN),)
|
|
SANITIZER := $(SAN)
|
|
endif
|
|
ifneq ($(SANITIZER),)
|
|
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer -g1 $(CFLAGS)
|
|
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
|
endif
|
|
|
|
OBJS := $(call sample_objs,$(SOURCES_C:.c=.o))
|
|
|
|
all: $(TARGET)
|
|
|
|
%.o: %.c
|
|
$(CC) $(INCDIRS) $(CFLAGS) $(flags) -c -o$@ $<
|
|
|
|
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
|
|
@mkdir -p $(@D)
|
|
$(CC) $(INCDIRS) $(CFLAGS) $(flags) -c -o$@ $<
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(CC) -o$@ $(OBJS) $(LDFLAGS)
|
|
|
|
check: $(TARGET)
|
|
./$(TARGET)
|
|
|
|
clean:
|
|
rm -rf $(SAMPLE_OBJDIR)
|
|
rm -f $(OBJS)
|
|
rm -f $(TARGET)
|
|
|
|
.PHONY: clean all check
|