Files
RetroArch/samples/input/linux_pad_members/Makefile
LibretroAdmin e160e2ab67 udev joypad: a pad's other nodes, listed once under its HID device
A DualShock 4, a DualSense or a Wii Remote comes out of the kernel as
several nodes beside the pad's: motion sensors, a touchpad, raw reports.
At each connect the driver searched every input or hidraw device on the
system for each of them in turn - up to four scans - and kept those
whose HID parent was the pad's.

It now lists the pad's HID device's own nodes once, and a table
(linux_pad_members.h) gives each its role: the node tagged as an
accelerometer for the sensors, else the untagged ones in order, as for
a Wii Remote; the one tagged as a touchpad for the touchpad, never tried
as the sensors; the hidraw node for a DualShock 3's pressures. The
pad's own node takes none. linux_pad_members_test holds the choice to
that.
2026-10-27 06:16:53 +01:00

34 lines
793 B
Makefile

TARGET := linux_pad_members_test
LIBRETRO_COMM_DIR := ../../../libretro-common
INPUT_DIR := ../../../input
# Which of a pad's nodes takes which role, as the udev joypad driver
# decides it (common/linux_pad_members.h, which takes no libudev).
SOURCES := linux_pad_members_test.c
OBJS := $(SOURCES:.c=.o)
CFLAGS += -Wall -Wextra -std=c89 -pedantic -g1 -O1 \
-I$(LIBRETRO_COMM_DIR)/include -I$(INPUT_DIR)
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) -o $@ $(OBJS) $(LDFLAGS)
linux_pad_members_test.o: $(INPUT_DIR)/common/linux_pad_members.h
check: all
./$(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
.PHONY: all check clean