Made compiling work in termux

This commit is contained in:
Rob Pearce (via phone) 2021-11-28 20:00:32 +11:00
parent 50282d43a0
commit 4e7ae2bb25
3 changed files with 28 additions and 2 deletions

10
Makefile.osx Normal file
View File

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

10
Makefile.termux Normal file
View File

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

View File

@ -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()) {