mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-01-18 21:17:38 +00:00
6a5ec4923d
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10307 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
52 lines
1.9 KiB
Plaintext
52 lines
1.9 KiB
Plaintext
# Custom systemd Makefile include that builds/installs keymap tool only for LFS
|
|
|
|
# vim: tabstop=3
|
|
|
|
KEYMAPS = $(shell ls keymaps/* | sort)
|
|
KEYMAPS_FR = $(shell ls keymaps-force-release/* | sort)
|
|
|
|
KEYMAP_DEPS = common src/udev/keymap/keys-from-name.h src/udev/keymap/keys-to-name.h
|
|
|
|
src/udev/keymap/keys.txt:
|
|
@echo GEN $@
|
|
$(VB)awk '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ \
|
|
{ \
|
|
if ($$2 != "KEY_MAX") { print $$2 } \
|
|
}' \
|
|
/usr/include/linux/input.h | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
|
|
|
|
src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt
|
|
@echo GEN $@
|
|
$(VB)awk 'BEGIN \
|
|
{ \
|
|
print "struct key \
|
|
{ \
|
|
const char* name; \
|
|
unsigned short id; \
|
|
};"; \
|
|
\
|
|
print "%null-strings"; print "%%"; \
|
|
} \
|
|
{ \
|
|
print $$1 ", " $$1 \
|
|
}' $< > $@
|
|
|
|
src/udev/keymap/keys-from-name.h: src/udev/keymap/keys-from-name.gperf
|
|
@echo GEN $@
|
|
$(VB)gperf -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C $< > $@
|
|
|
|
src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt
|
|
@echo GEN $@
|
|
$(VB)awk 'BEGIN \
|
|
{ \
|
|
print "const char* const key_names[KEY_CNT] = { " \
|
|
} \
|
|
{ \
|
|
print "[" $$1 "] = \"" $$1 "\"," \
|
|
} \
|
|
END{print "};" \
|
|
}' $< > $@
|
|
|
|
keymap:
|
|
echo "keymap is now built into udevadm/udevd"
|