diff --git a/Makefile.osx b/Makefile.osx new file mode 100644 index 0000000..10bcab8 --- /dev/null +++ b/Makefile.osx @@ -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 diff --git a/Makefile.termux b/Makefile.termux new file mode 100644 index 0000000..3e6fd08 --- /dev/null +++ b/Makefile.termux @@ -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 diff --git a/howard.c b/howard.c index bd1880f..c8bf230 100644 --- a/howard.c +++ b/howard.c @@ -1,6 +1,13 @@ #include #include + +#ifdef _TERMUX +#include +#include +#else #include +#endif + #include #include #include @@ -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()) {