mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2025-02-07 02:20:17 -05:00
Makefile for generated .py file.
This commit is contained in:
parent
464dfc76b7
commit
9f5caa9a13
10
Makefile
Normal file
10
Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
.PHONY: default clean
|
||||
|
||||
|
||||
default: uinput_gen.py
|
||||
|
||||
clean:
|
||||
rm uinput_gen.py -f
|
||||
|
||||
uinput_gen.py:
|
||||
gcc -E -dM /usr/include/linux/input.h | egrep ' (EV|SYN|KEY|BTN|REL|ABS|MSC|LED|SND|REP|SW)_[A-Za-z0-9_]+' | ( echo "#include <linux/input.h>" ; echo "input_constants_dict = {" ; sed -r 's/[^ ]+ +([^ ]+).*/"\1" : \1,/' ; echo "}" ) | gcc -E -o /dev/stdout - | grep 'input_constants_dict = {' -A 100000 > uinput_gen.py
|
@ -2,7 +2,7 @@ import ctypes
|
||||
|
||||
import struct
|
||||
|
||||
from gen import input_constants_dict as icd
|
||||
from uinput_gen import input_constants_dict as icd
|
||||
|
||||
for k, v in icd.iteritems():
|
||||
locals()[k] = v
|
||||
|
Loading…
Reference in New Issue
Block a user