mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2024-11-15 21:25:01 -05:00
Add Makefile.
This commit is contained in:
parent
ce2a2a10e0
commit
62a3257275
16
Makefile
Normal file
16
Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
.PHONY: default clean
|
||||
|
||||
CFLAGS+=-ansi -pedantic -Wall -Wextra -Werror -Wno-unused-result
|
||||
CFLAGS+=-pipe -O2
|
||||
CFLAGS+=-D_BSD_SOURCE
|
||||
|
||||
default: map
|
||||
|
||||
keys:
|
||||
bash genkeys.sh
|
||||
|
||||
map: map.c keys
|
||||
$(CC) map.c $(CFLAGS) -o map
|
||||
|
||||
clean:
|
||||
rm -f map def_keys.h
|
7
map.c
7
map.c
@ -59,6 +59,8 @@ static int js[JOYCOUNT];
|
||||
|
||||
void free_js(int sig) {
|
||||
int j;
|
||||
|
||||
(void) sig;
|
||||
for(j = 0; j < JOYCOUNT; j++) {
|
||||
printf("Freeing joystick: %d\n", j);
|
||||
if (ioctl(js[j], UI_DEV_DESTROY) < 0) {
|
||||
@ -90,6 +92,11 @@ int main(int argc, char** argv) {
|
||||
0
|
||||
};
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
(void)get_key_num;
|
||||
|
||||
if(signal(SIGINT, free_js)) {
|
||||
printf("Atexit registration failed\n");
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user