uinput-mapper/c/Makefile

38 lines
873 B
Makefile
Raw Normal View History

2012-12-04 14:13:43 -05:00
.PHONY: default clean
2013-02-10 04:52:06 -05:00
PREFIX=/usr/local
CFLAGS+=-ansi -pedantic -pipe -D_BSD_SOURCE \
-Wall -Wextra -Werror -Wno-unused-result
OPT=-O2
2012-12-04 14:13:43 -05:00
2013-02-10 04:52:06 -05:00
debug: OPT=-O0
debug: CFLAGS+=-ggdb
debug: map
2012-12-04 14:13:43 -05:00
2012-12-05 04:30:44 -05:00
def_keys.h:
2013-02-10 04:52:06 -05:00
echo '#include <linux/input.h>' | gcc -E -dM - \
| grep '#define KEY_' | cut -f2 -d" " | sed 's/KEY_.*/DEF_KEY(&)/' \
> $@
2012-12-04 14:13:43 -05:00
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
2013-02-10 04:52:06 -05:00
$(CC) $(CFLAGS) ${OPT} map.c -o $@
2012-12-04 14:13:43 -05:00
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
2012-12-04 14:13:43 -05:00
clean:
rm -f map def_keys.h map_*
2013-02-10 04:52:06 -05:00
install:
install map ${PREFIX}/sbin/uinput-mapper