From 9de0de4d3d32ab97226fa9868de1fa2290120429 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 26 Jul 2022 16:01:13 +0200 Subject: Do not relay on libevdev for button/axis names, an prepare for device specific names, and add reverse lookup functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a35fd79..910c1c2 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ LIB_NAME = gamepad OBJ =\ + libgamepad_absolute_axis_names__.o\ + libgamepad_button_names__.o\ libgamepad_close_device.o\ libgamepad_close_superdevice.o\ libgamepad_construct_constant_force_feedback_effect.o\ @@ -32,12 +34,15 @@ OBJ =\ libgamepad_destroy_attachment_monitor.o\ libgamepad_disable_force_feedback_autocenter.o\ libgamepad_find_sound_devices.o\ + libgamepad_get_absolute_axis_by_name.o\ libgamepad_get_absolute_axis_info.o\ libgamepad_get_absolute_axis_name.o\ libgamepad_get_attachment_event.o\ + libgamepad_get_button_by_name.o\ libgamepad_get_button_is_pressed.o\ libgamepad_get_button_name.o\ libgamepad_get_force_feedback_max_concurrency.o\ + libgamepad_get_relative_axis_by_name.o\ libgamepad_get_relative_axis_name.o\ libgamepad_grab.o\ libgamepad_install_force_feedback_effect.o\ @@ -47,6 +52,7 @@ OBJ =\ libgamepad_open_device.o\ libgamepad_open_superdevice.o\ libgamepad_play_force_feedback_effect.o\ + libgamepad_relative_axis_names__.o\ libgamepad_set_clock.o\ libgamepad_set_force_feedback_autocenter.o\ libgamepad_set_force_feedback_master_gain.o\ @@ -57,7 +63,10 @@ OBJ =\ HDR =\ common.h\ - libgamepad.h + libgamepad.h\ + button.count\ + absolute-axis.count\ + relative-axis.count TESTS =\ test-attachments\ @@ -74,6 +83,21 @@ $(OBJ): $(HDR) $(LOBJ): $(HDR) $(TESTS:=.o): $(HDR) $(TESTS): libgamepad.a +libgamepad_button_names__.o: button.names +libgamepad_absolute_axis_names__.o: absolute-axis.names +libgamepad_relative_axis_names__.o: relative-axis.names + +button.names: names.sh + printf '%s\n' '#include ' | $(CPP) -dM | ./names.sh BTN KEY > $@ + +absolute-axis.names: names.sh + printf '%s\n' '#include ' | $(CPP) -dM | ./names.sh ABS > $@ + +relative-axis.names: names.sh + printf '%s\n' '#include ' | $(CPP) -dM | ./names.sh REL > $@ + +.names.count: + wc -l < $< > $@ .c.o: $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) $(LIBS_CFLAGS) @@ -110,10 +134,10 @@ uninstall: -rm -f -- "$(DESTDIR)$(PREFIX)/include/libgamepad.h" clean: - -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib *.names *.count -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) $(TESTS) .SUFFIXES: -.SUFFIXES: .lo .o .c +.SUFFIXES: .lo .o .c .names .count .PHONY: all install uninstall clean -- cgit v1.2.3-70-g09d2