mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2025-02-07 10:30:12 -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) {
|
void free_js(int sig) {
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
(void) sig;
|
||||||
for(j = 0; j < JOYCOUNT; j++) {
|
for(j = 0; j < JOYCOUNT; j++) {
|
||||||
printf("Freeing joystick: %d\n", j);
|
printf("Freeing joystick: %d\n", j);
|
||||||
if (ioctl(js[j], UI_DEV_DESTROY) < 0) {
|
if (ioctl(js[j], UI_DEV_DESTROY) < 0) {
|
||||||
@ -90,6 +92,11 @@ int main(int argc, char** argv) {
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
|
(void)get_key_num;
|
||||||
|
|
||||||
if(signal(SIGINT, free_js)) {
|
if(signal(SIGINT, free_js)) {
|
||||||
printf("Atexit registration failed\n");
|
printf("Atexit registration failed\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user