mirror of
https://github.com/owntracks/recorder.git
synced 2026-04-09 00:36:50 +00:00
New config.mk and Makefile
This commit is contained in:
18
Makefile
18
Makefile
@@ -1,12 +1,21 @@
|
||||
include config.mk
|
||||
|
||||
LIBS = -lcurl -lmosquitto
|
||||
CFLAGS=-Wall -Werror -g
|
||||
|
||||
ifneq ($(HAVE_REDIS),no)
|
||||
CFLAGS += -DHAVE_REDIS=1
|
||||
LIBS += -lhiredis
|
||||
endif
|
||||
|
||||
|
||||
all: ot-recorder #### ot-reader
|
||||
|
||||
ot-reader: ot-reader.c json.o utstring.h ghash.o mkpath.o jget.o
|
||||
cc $(CFLAGS) ot-reader.c -o ot-reader json.o ghash.o mkpath.o jget.o -lhiredis
|
||||
$(CC) $(CFLAGS) ot-reader.c -o ot-reader json.o ghash.o mkpath.o jget.o $(LIBS)
|
||||
|
||||
ot-recorder: ot-recorder.c json.o utarray.h utstring.h geo.o geohash.o mkpath.o file.o safewrite.o base64.o ghash.o config.h udata.h misc.o
|
||||
cc $(CFLAGS) ot-recorder.c -o ot-recorder json.o geo.o geohash.o mkpath.o file.o safewrite.o base64.o ghash.o misc.o -lmosquitto -lcurl -lhiredis
|
||||
$(CC) $(CFLAGS) ot-recorder.c -o ot-recorder json.o geo.o geohash.o mkpath.o file.o safewrite.o base64.o ghash.o misc.o $(LIBS)
|
||||
|
||||
geo.o: geo.h geo.c udata.h
|
||||
geohash.o: geohash.h geohash.c udata.h
|
||||
@@ -16,3 +25,8 @@ ghash.o: ghash.h ghash.c config.h udata.h misc.h
|
||||
safewrite.o: safewrite.h safewrite.c
|
||||
jget.o: jget.c jget.h json.h
|
||||
misc.o: misc.c misc.h udata.h
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
clobber: clean
|
||||
rm -f ot-recorder ocat
|
||||
|
||||
@@ -8,4 +8,5 @@ Recorder
|
||||
## Installation
|
||||
|
||||
1. Edit `config.h`
|
||||
2. Edit `config.mk` and select features
|
||||
2. Type `make`
|
||||
|
||||
3
ghash.c
3
ghash.c
@@ -3,6 +3,8 @@
|
||||
#include "ghash.h"
|
||||
#include "misc.h"
|
||||
|
||||
#ifdef HAVE_REDIS
|
||||
|
||||
void redis_ping(redisContext **redis)
|
||||
{
|
||||
struct timeval timeout = { 1, 500000 }; // 1.5 seconds
|
||||
@@ -87,6 +89,7 @@ int ghash_get_redis_cache(redisContext **redis, char *ghash, UT_string *addr, UT
|
||||
|
||||
return (found);
|
||||
}
|
||||
#endif /* !HAVE_REDIS */
|
||||
|
||||
int ghash_readcache(struct udata *ud, char *ghash, UT_string *addr, UT_string *cc)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user