Files
RetroArch/samples/audio/asio_clock/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

38 lines
1.0 KiB
Makefile

# ASIO device clock: the estimate from the driver's time information.
CORE_DIR := ../../..
LIBRETRO_COMM_DIR := $(CORE_DIR)/libretro-common
TARGET := asio_clock_test
SOURCES_C := asio_clock_test.c
OBJS := $(SOURCES_C:.c=.o)
INCDIRS := -I$(LIBRETRO_COMM_DIR)/include -I$(CORE_DIR)
CFLAGS += -Wall -Wno-variadic-macros $(INCDIRS) -D_GNU_SOURCE
ifneq ($(SANITIZER),)
CFLAGS += -fsanitize=$(SANITIZER) -fno-omit-frame-pointer -g1
LDFLAGS += -fsanitize=$(SANITIZER)
else
CFLAGS += -g1 -O1
endif
all: $(TARGET)
# The clock word's publish, reset and reader, taken from the driver.
asio_clock_driver.h: $(CORE_DIR)/audio/drivers/asio.c extract_clock.awk
awk -f extract_clock.awk $(CORE_DIR)/audio/drivers/asio.c > $@.tmp && mv $@.tmp $@
asio_clock_test.o: asio_clock_driver.h
$(TARGET): $(OBJS)
$(CC) -o $@ $(OBJS) $(LDFLAGS) -lm
%.o: %.c
$(CC) $(CFLAGS) -std=c99 -pedantic -Wdeclaration-after-statement -Wno-long-long -c -o $@ $<
clean:
rm -f $(OBJS) $(TARGET) asio_clock_driver.h
.PHONY: all clean