Files
RetroArch/samples/input/udev_devices/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
1.2 KiB
Makefile

TARGET := udev_devices_test
# The real udev input driver, handed a desk of devices in memory: its
# listing of keyboards and mice, its numbering, and what a port reads.
# udev_input.c is included by the test itself; the frontend symbols it
# links against are stood in for in the test.
# make && make check
REPO_ROOT := ../../..
CFLAGS += -Wall -Wno-unused -std=gnu99 -g1 -O1 \
-DRARCH_INTERNAL -DHAVE_UDEV -DHAVE_EPOLL -DHAVE_THREADS \
-I$(REPO_ROOT) -I$(REPO_ROOT)/input/include \
-I$(REPO_ROOT)/gfx/include \
-I$(REPO_ROOT)/libretro-common/include -I$(REPO_ROOT)/deps
ifneq ($(SANITIZER),)
CFLAGS += -fsanitize=$(SANITIZER) -fno-omit-frame-pointer
LDFLAGS += -fsanitize=$(SANITIZER)
endif
# udev is Linux's: elsewhere there is no driver to test, and the
# targets say so and succeed.
ifeq ($(shell uname -s 2>/dev/null),Linux)
all: $(TARGET)
$(TARGET): udev_devices_test.c $(REPO_ROOT)/input/drivers/udev_input.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ udev_devices_test.c \
$(REPO_ROOT)/libretro-common/compat/compat_strl.c -ludev
check: all
./$(TARGET)
else
all check:
@echo "SKIP udev_devices_test: the udev input driver is Linux only"
endif
clean:
rm -f $(TARGET)
.PHONY: all check clean