Files
RetroArch/samples/gfx/coord_array/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
994 B
Makefile

# The coordinate array, taken out of gfx/video_driver.c, with each of
# its allocations failed in turn.
CORE_DIR := ../../..
LIBRETRO_COMM_DIR := $(CORE_DIR)/libretro-common
TARGET := coord_array_test
SOURCES_C := coord_array_test.c
OBJS := $(SOURCES_C:.c=.o)
CFLAGS += -Wall -Wno-unused-function -std=gnu99 \
-I$(LIBRETRO_COMM_DIR)/include -I$(CORE_DIR)
ifneq ($(SANITIZER),)
CFLAGS += -fsanitize=$(SANITIZER) -fno-omit-frame-pointer -g1
LDFLAGS += -fsanitize=$(SANITIZER)
else
CFLAGS += -g1 -O1
endif
all: $(TARGET)
coord_array_driver.h: $(CORE_DIR)/gfx/video_driver.c extract_coord_array.awk
awk -f extract_coord_array.awk $(CORE_DIR)/gfx/video_driver.c > $@.tmp && mv $@.tmp $@
coord_array_test.o: coord_array_driver.h
$(TARGET): $(OBJS)
$(CC) -o $@ $(OBJS) $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
check: all
./$(TARGET)
clean:
rm -f $(OBJS) $(TARGET) $(TARGET).exe coord_array_driver.h coord_array_driver.h.tmp
.PHONY: all check clean