diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a35c5a6 --- /dev/null +++ b/Makefile @@ -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 diff --git a/map.c b/map.c index 3efd35a..a6af83f 100644 --- a/map.c +++ b/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;