aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-26 16:01:13 +0200
committerMattias Andrée <maandree@kth.se>2022-07-26 16:02:05 +0200
commit9de0de4d3d32ab97226fa9868de1fa2290120429 (patch)
tree292473831841529716f97565391303fb9b071c15 /Makefile
parentUpdate information about Sixaxis (diff)
downloadlibgamepad-9de0de4d3d32ab97226fa9868de1fa2290120429.tar.gz
libgamepad-9de0de4d3d32ab97226fa9868de1fa2290120429.tar.bz2
libgamepad-9de0de4d3d32ab97226fa9868de1fa2290120429.tar.xz
Do not relay on libevdev for button/axis names, an prepare for device specific names, and add reverse lookup functions
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 27 insertions, 3 deletions
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 <linux/input.h>' | $(CPP) -dM | ./names.sh BTN KEY > $@
+
+absolute-axis.names: names.sh
+ printf '%s\n' '#include <linux/input.h>' | $(CPP) -dM | ./names.sh ABS > $@
+
+relative-axis.names: names.sh
+ printf '%s\n' '#include <linux/input.h>' | $(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