Add Makefile.

This commit is contained in:
Merlijn Wajer 2012-12-04 20:13:43 +01:00
parent ce2a2a10e0
commit 62a3257275
2 changed files with 23 additions and 0 deletions

16
Makefile Normal file
View 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
View File

@ -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;