summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-07-10 16:02:24 +0200
committerKay Sievers <kay@vrfy.org>2013-07-10 22:52:55 +0200
commit9d7d42bc406a2ac04639674281ce3ff6beeda790 (patch)
treef75d1acfa11c8ebc42079b69072af97297202407 /Makefile.am
parent06639c0940ad9a81f085cbaff05bbf3f69a7f88f (diff)
udev: add builtin 'keyboard' to manage key mappings
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index aa7e830222..f1dfeedf58 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -174,6 +174,7 @@ AM_CPPFLAGS = \
-I $(top_srcdir)/src/core \
-I $(top_srcdir)/src/libudev \
-I $(top_srcdir)/src/udev \
+ -I $(top_builddir)/src/udev \
-I $(top_srcdir)/src/libsystemd-bus \
$(OUR_CPPFLAGS)
@@ -2094,6 +2095,7 @@ dist_udevrules_DATA += \
rules/99-systemd.rules \
rules/42-usb-hid-pm.rules \
rules/50-udev-default.rules \
+ rules/60-keyboard.rules \
rules/60-persistent-storage-tape.rules \
rules/60-persistent-serial.rules \
rules/60-persistent-input.rules \
@@ -2157,6 +2159,19 @@ rootlibexec_PROGRAMS += \
noinst_LTLIBRARIES += \
libudev-core.la
+src/udev/keyboard-keys.txt: Makefile
+ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
+
+src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt Makefile
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
+
+src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf Makefile
+ $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
+
+src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt Makefile
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
+
libudev_core_la_SOURCES = \
src/udev/udev.h \
src/udev/udev-event.c \
@@ -2168,10 +2183,22 @@ libudev_core_la_SOURCES = \
src/udev/udev-builtin-btrfs.c \
src/udev/udev-builtin-hwdb.c \
src/udev/udev-builtin-input_id.c \
+ src/udev/udev-builtin-keyboard.c \
src/udev/udev-builtin-net_id.c \
src/udev/udev-builtin-path_id.c \
src/udev/udev-builtin-usb_id.c
+nodist_libudev_core_la_SOURCES = \
+ src/udev/keyboard-keys-from-name.h \
+ src/udev/keyboard-keys-to-name.h
+
+BUILT_SOURCES += \
+ $(nodist_libudev_core_la_SOURCES)
+
+CLEANFILES += \
+ src/udev/keyboard-keys-from-name.gperf \
+ src/udev/keyboard-keys.txt
+
libudev_core_la_CFLAGS = \
$(AM_CFLAGS) \
$(BLKID_CFLAGS) \