makefile-incl.keymap 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # Custom systemd Makefile include that builds/installs keymap tool only for LFS
  2. # vim: tabstop=3
  3. KEYMAPS = \
  4. keymaps/acer \
  5. keymaps/acer-aspire_5720 \
  6. keymaps/acer-aspire_8930 \
  7. keymaps/acer-aspire_5920g \
  8. keymaps/acer-aspire_6920 \
  9. keymaps/acer-travelmate_c300 \
  10. keymaps/asus \
  11. keymaps/compaq-e_evo \
  12. keymaps/dell \
  13. keymaps/dell-latitude-xt2 \
  14. keymaps/everex-xt5000 \
  15. keymaps/fujitsu-amilo_li_2732 \
  16. keymaps/fujitsu-amilo_pa_2548 \
  17. keymaps/fujitsu-amilo_pro_edition_v3505 \
  18. keymaps/fujitsu-amilo_pro_v3205 \
  19. keymaps/fujitsu-amilo_si_1520 \
  20. keymaps/fujitsu-esprimo_mobile_v5 \
  21. keymaps/fujitsu-esprimo_mobile_v6 \
  22. keymaps/genius-slimstar-320 \
  23. keymaps/hewlett-packard \
  24. keymaps/hewlett-packard-2510p_2530p \
  25. keymaps/hewlett-packard-compaq_elitebook \
  26. keymaps/hewlett-packard-pavilion \
  27. keymaps/hewlett-packard-presario-2100 \
  28. keymaps/hewlett-packard-tablet \
  29. keymaps/hewlett-packard-tx2 \
  30. keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
  31. keymaps/inventec-symphony_6.0_7.0 \
  32. keymaps/lenovo-3000 \
  33. keymaps/lenovo-ideapad \
  34. keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
  35. keymaps/lenovo-thinkpad_x6_tablet \
  36. keymaps/lenovo-thinkpad_x200_tablet \
  37. keymaps/lg-x110 \
  38. keymaps/logitech-wave \
  39. keymaps/logitech-wave-cordless \
  40. keymaps/logitech-wave-pro-cordless \
  41. keymaps/maxdata-pro_7000 \
  42. keymaps/medion-fid2060 \
  43. keymaps/medionnb-a555 \
  44. keymaps/micro-star \
  45. keymaps/module-asus-w3j \
  46. keymaps/module-ibm \
  47. keymaps/module-lenovo \
  48. keymaps/module-sony \
  49. keymaps/module-sony-old \
  50. keymaps/module-sony-vgn \
  51. keymaps/olpc-xo \
  52. keymaps/onkyo \
  53. keymaps/oqo-model2 \
  54. keymaps/samsung-other \
  55. keymaps/samsung-90x3a \
  56. keymaps/samsung-sq1us \
  57. keymaps/samsung-sx20s \
  58. keymaps/toshiba-satellite_a100 \
  59. keymaps/toshiba-satellite_a110 \
  60. keymaps/toshiba-satellite_m30x \
  61. keymaps/zepto-znote
  62. KEYMAPS_FR = \
  63. keymaps-force-release/dell-touchpad \
  64. keymaps-force-release/dell-xps \
  65. keymaps-force-release/hp-other \
  66. keymaps-force-release/samsung-other \
  67. keymaps-force-release/samsung-90x3a \
  68. keymaps-force-release/common-volume-keys
  69. KEYMAP_DEPS = common src/udev/keymap/keys-from-name.h src/udev/keymap/keys-to-name.h
  70. src/udev/keymap/keys.txt:
  71. @echo GEN $@
  72. $(VB)awk '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ \
  73. { \
  74. if ($$2 != "KEY_MAX") { print $$2 } \
  75. }' \
  76. /usr/include/linux/input.h | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
  77. src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt
  78. @echo GEN $@
  79. $(VB)awk 'BEGIN \
  80. { \
  81. print "struct key \
  82. { \
  83. const char* name; \
  84. unsigned short id; \
  85. };"; \
  86. \
  87. print "%null-strings"; print "%%"; \
  88. } \
  89. { \
  90. print $$1 ", " $$1 \
  91. }' $< > $@
  92. src/udev/keymap/keys-from-name.h: src/udev/keymap/keys-from-name.gperf
  93. @echo GEN $@
  94. $(VB)gperf -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C $< > $@
  95. src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt
  96. @echo GEN $@
  97. $(VB)awk 'BEGIN \
  98. { \
  99. print "const char* const key_names[KEY_CNT] = { " \
  100. } \
  101. { \
  102. print "[" $$1 "] = \"" $$1 "\"," \
  103. } \
  104. END{print "};" \
  105. }' $< > $@
  106. build/keymap: src/udev/keymap/keymap.c build/$(COMMON_LIB) $(KEYMAP_DEPS)
  107. @echo LINK $@
  108. $(VB)gcc $< -o $@ -I src/udev/keymap $(WARN) $(OPTIONS2) $(INCLUDE) $(DEF) \
  109. build/$(COMMON_LIB) $(LDFLAGS)
  110. $(VB)strip --strip-unneeded $@
  111. keymap: build/keymap
  112. install-keymap: keymap
  113. @mkdir -pv $(DESTDIR)/lib/udev/keymaps/force-release \
  114. $(DESTDIR)/lib/udev/rules.d \
  115. $(DESTDIR)/usr/share/doc/udev
  116. @cp -v build/keymap $(DESTDIR)/lib/udev
  117. @cp -v $(KEYMAPS) $(DESTDIR)/lib/udev/keymaps
  118. @cp -v $(KEYMAPS_FR) $(DESTDIR)/lib/udev/keymaps/force-release
  119. @cp -v src/udev/keymap/*.rules $(DESTDIR)/lib/udev/rules.d
  120. @cp -v src/udev/keymap/findkeyboards $(DESTDIR)/lib/udev
  121. @cp -v src/udev/keymap/*.txt $(DESTDIR)/usr/share/doc/udev
  122. @sed -e 's|@udevlibexecdir@|/lib/udev|g' \
  123. src/udev/keymap/keyboard-force-release.sh.in \
  124. > $(DESTDIR)/lib/udev/keyboard-force-release.sh
  125. @chmod 0755 $(DESTDIR)/lib/udev/keyboard-force-release.sh
  126. clean-keymap:
  127. rm -f src/udev/keymap/keys.txt
  128. rm -f src/udev/keymap/keys-from-name.gperf
  129. rm -f src/udev/keymap/keys-from-name.h
  130. rm -f src/udev/keymap/keys-to-name.h
  131. rm -f build/keymap
  132. .PHONY: clean-keymap