summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-09-29 11:11:58 +0100
committerGerd Hoffmann <kraxel@redhat.com>2017-10-16 14:50:54 +0200
commit927128222b0a91f56c13a0e040d0c68da06ec433 (patch)
tree56af72baf1acd31f4cb7e45a82fbfc81efabfc5a /Makefile
parent47bb908dd195a0f25a13bb2bb5ff5fdcdfd218fb (diff)
downloadqemu-927128222b0a91f56c13a0e040d0c68da06ec433.tar.gz
ui: add keycodemapdb repository as a GIT submodule
The https://gitlab.com/keycodemap/keycodemapdb/ repo contains a data file mapping between all the different scancode/keycode/keysym sets that are known, and a tool to auto-generate lookup tables for different combinations. It is used by GTK-VNC, SPICE-GTK and libvirt for mapping keys. Using it in QEMU will let us replace many hand written lookup tables with auto-generated tables from a master data source, reducing bugs. Adding new QKeyCodes will now only require the master table to be updated, all ~20 other tables will be automatically updated to follow. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170929101201.21039-4-berrange@redhat.com [ kraxel: fix build ] [ kraxel: switch repo to qemu.git mirror ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 23 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9866909e08..7b9b93c3dc 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ git-submodule-update:
endif
endif
-.git-submodule-status: git-submodule-update
+.git-submodule-status: git-submodule-update config-host.mak
# Check that we're not trying to do an out-of-tree build from
# a tree that's been used for an in-tree build.
@@ -213,6 +213,28 @@ trace-dtrace-root.h: trace-dtrace-root.dtrace
trace-dtrace-root.o: trace-dtrace-root.dtrace
+KEYCODEMAP_GEN = $(SRC_PATH)/ui/keycodemapdb/tools/keymap-gen
+KEYCODEMAP_CSV = $(SRC_PATH)/ui/keycodemapdb/data/keymaps.csv
+
+KEYCODEMAP_FILES = \
+ $(NULL)
+
+GENERATED_FILES += $(KEYCODEMAP_FILES)
+
+ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
+ $(call quiet-command,\
+ src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
+ dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
+ test -e $(KEYCODEMAP_GEN) && \
+ $(PYTHON) $(KEYCODEMAP_GEN) \
+ --lang glib2 \
+ --varname qemu_input_map_$${src}_to_$${dst} \
+ code-map $(KEYCODEMAP_CSV) $${src} $${dst} \
+ > $@ || rm -f $@, "GEN", "$@")
+
+$(KEYCODEMAP_GEN): .git-submodule-status
+$(KEYCODEMAP_CSV): .git-submodule-status
+
# Don't try to regenerate Makefile or configure
# We don't generate any of them
Makefile: ;