Files
RetroArch/samples/gfx/slang_include_cache/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

46 lines
1.2 KiB
Makefile

include ../../sample_objdir.mk
TARGET := slang_include_cache_test
REPO_ROOT := ../../..
LIBRETRO_COMM_DIR := $(REPO_ROOT)/libretro-common
# The real gfx/drivers_shader/glslang_util.c; the sources it expands are
# served from memory by the test, in place of video_shader_parse.c.
SOURCES := slang_include_cache_test.c \
$(REPO_ROOT)/gfx/drivers_shader/glslang_util.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c
CFLAGS += -Wall -std=gnu99 -g1 -O1 -DRARCH_INTERNAL -DHAVE_SLANG \
-I$(REPO_ROOT) -I$(LIBRETRO_COMM_DIR)/include
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
OBJS := $(call sample_objs,$(SOURCES:.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) $(TARGET).exe
.PHONY: all check clean