Made compiling work in termux
This commit is contained in:
parent
50282d43a0
commit
4e7ae2bb25
|
@ -0,0 +1,10 @@
|
|||
CFLAGS=-g -Wall `pkg-config --cflags hidapi`
|
||||
LDFLAGS=`pkg-config --libs hidapi`
|
||||
|
||||
all: lsusb howard
|
||||
|
||||
lsusb: lsusb.c
|
||||
gcc -olsusb $(CFLAGS) $(LDFLAGS) lsusb.c
|
||||
|
||||
howard: howard.c howard.h
|
||||
gcc -ohoward $(CFLAGS) $(LDFLAGS) howard.c
|
|
@ -0,0 +1,10 @@
|
|||
CFLAGS=-g -D_TERMUX -Wall -I/data/data/com.termux/files/usr/include/hidapi
|
||||
LDFLAGS=-L/data/data/com.termux/files/usr/lib -lhidapi-libusb
|
||||
|
||||
all: lsusb howard
|
||||
|
||||
lsusb: lsusb.c
|
||||
gcc -olsusb $(CFLAGS) $(LDFLAGS) lsusb.c
|
||||
|
||||
howard: howard.c howard.h
|
||||
gcc -ohoward $(CFLAGS) $(LDFLAGS) howard.c
|
10
howard.c
10
howard.c
|
@ -1,6 +1,13 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _TERMUX
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include <wchar.h>
|
||||
#include <time.h>
|
||||
#include <hidapi.h>
|
||||
|
@ -316,9 +323,8 @@ int main(int argc, char *argv[]) {
|
|||
influx_init("gridbug.nethack.net", "haven", "", "");
|
||||
|
||||
if (mode == M_TEST) {
|
||||
int rv;
|
||||
printf("running ping...\n");
|
||||
rv = influx_ping(retbuf);
|
||||
influx_ping(retbuf);
|
||||
}
|
||||
exit(1);
|
||||
if (hid_init()) {
|
||||
|
|
Loading…
Reference in New Issue