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.
45 lines
971 B
Makefile
45 lines
971 B
Makefile
include ../../sample_objdir.mk
|
|
|
|
TARGET := bitstream_test
|
|
|
|
LIBRETRO_COMM_DIR := ../../../libretro-common
|
|
INCDIRS := -I$(LIBRETRO_COMM_DIR)/include -I../../..
|
|
|
|
SOURCES_C := \
|
|
bitstream_test.c \
|
|
../../../audio/audio_bitstream.c \
|
|
$(LIBRETRO_COMM_DIR)/formats/dts/rdts.c \
|
|
$(LIBRETRO_COMM_DIR)/formats/ac3/rac3_frame.c \
|
|
$(LIBRETRO_COMM_DIR)/formats/iec61937/iec61937.c
|
|
|
|
CFLAGS += -std=gnu99 -Wall -Wextra $(INCDIRS) -DHAVE_RDTS -DHAVE_RAC3
|
|
LDFLAGS += -lm
|
|
|
|
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)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
|
|
@mkdir -p $(@D)
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
check: $(TARGET)
|
|
./$(TARGET)
|
|
|
|
clean:
|
|
rm -rf $(SAMPLE_OBJDIR)
|
|
rm -f $(OBJS) $(TARGET)
|
|
|
|
.PHONY: all check clean
|