mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2024-12-22 19:58:48 -05:00
Merge branch 'master' into input-clone
This commit is contained in:
commit
d1045284f8
37
Makefile
37
Makefile
@ -1,16 +1,37 @@
|
||||
.PHONY: default clean
|
||||
|
||||
CFLAGS+=-ansi -pedantic -Wall -Wextra -Werror -Wno-unused-result
|
||||
CFLAGS+=-pipe -O2
|
||||
CFLAGS+=-D_BSD_SOURCE
|
||||
PREFIX=/usr/local
|
||||
CFLAGS+=-ansi -pedantic -pipe -D_BSD_SOURCE \
|
||||
-Wall -Wextra -Werror -Wno-unused-result
|
||||
OPT=-O2
|
||||
|
||||
default: map
|
||||
debug: OPT=-O0
|
||||
debug: CFLAGS+=-ggdb
|
||||
debug: map
|
||||
|
||||
def_keys.h:
|
||||
echo '#include <linux/input.h>' | gcc -E -dM - | grep '#define KEY_' | cut -f2 -d" " | sed 's/KEY_.*/DEF_KEY(&)/' > def_keys.h
|
||||
echo '#include <linux/input.h>' | gcc -E -dM - \
|
||||
| grep '#define KEY_' | cut -f2 -d" " | sed 's/KEY_.*/DEF_KEY(&)/' \
|
||||
> $@
|
||||
|
||||
map: map.c def_keys.h config.h config_functions.h
|
||||
$(CC) map.c $(CFLAGS) -o map
|
||||
def_buttons.h:
|
||||
echo '#include <linux/input.h>' | gcc -E -dM - | grep '#define BTN_' | cut -f2 -d" " | sed 's/BTN_.*/DEF_BTN(&)/' > def_buttons.h
|
||||
|
||||
map: map.c def_keys.h def_buttons.h config.h config_functions.h
|
||||
$(CC) $(CFLAGS) ${OPT} map.c -o $@
|
||||
|
||||
all: map
|
||||
mv config.h config.bak
|
||||
for file in confs/*.h; \
|
||||
do \
|
||||
echo $$file; \
|
||||
cp $$file config.h; \
|
||||
$(CC) map.c $(CFLAGS) -o map$$(echo $$file | sed 's/confs\//_/;s/\.h//' ); \
|
||||
done
|
||||
mv config.bak config.h
|
||||
|
||||
clean:
|
||||
rm -f map def_keys.h
|
||||
rm -f map def_keys.h map_*
|
||||
|
||||
install:
|
||||
install map ${PREFIX}/sbin/uinput-mapper
|
||||
|
Loading…
Reference in New Issue
Block a user