recorder/Makefile

96 lines
2.2 KiB
Makefile
Raw Normal View History

2015-08-15 03:50:16 -07:00
include config.mk
2015-09-10 02:08:46 -07:00
CFLAGS =-Wall -Werror $(MOSQUITTO_INC)
2015-09-15 02:24:17 -07:00
LIBS = $(MORELIBS) $(MOSQUITTO_LIB) -lmosquitto
2015-09-10 02:08:46 -07:00
LIBS += -lcurl
2015-08-14 09:40:35 -07:00
2015-09-01 04:45:53 -07:00
TARGETS=
2015-08-27 14:42:18 -07:00
OTR_OBJS = json.o \
geo.o \
geohash.o \
mkpath.o \
base64.o \
misc.o \
util.o \
storage.o
CFLAGS += -DGHASHPREC=$(GHASHPREC)
ifeq ($(HAVE_PING),yes)
CFLAGS += -DHAVE_PING=1
endif
ifeq ($(HAVE_KILL),yes)
CFLAGS += -DHAVE_KILL=1
endif
2015-09-01 04:31:49 -07:00
ifeq ($(HAVE_LMDB),yes)
CFLAGS += -DHAVE_LMDB=1 -Imdb/
OTR_OBJS += gcache.o
2015-09-01 06:17:14 -07:00
LIBS += mdb/liblmdb.a -lpthread
TARGETS += mdb/liblmdb.a
2015-08-15 03:50:16 -07:00
endif
2015-08-27 14:42:18 -07:00
ifeq ($(HAVE_HTTP),yes)
CFLAGS += -DHAVE_HTTP=1
2015-08-29 06:41:07 -07:00
OTR_OBJS += mongoose.o http.o
2015-08-27 14:42:18 -07:00
endif
2015-09-11 01:35:11 -07:00
ifeq ($(JSON_INDENT),yes)
CFLAGS += -DJSON_INDENT="\" \""
else
CFLAGS += -DJSON_INDENT=NULL
endif
ifneq ($(APIKEY),)
CFLAGS += -DAPIKEY="\"$(APIKEY)\""
endif
2015-09-11 06:48:56 -07:00
CFLAGS += -DSTORAGEDEFAULT=\"$(STORAGEDEFAULT)\" -DDOCROOT=\"$(DOCROOT)\"
2015-08-15 03:50:16 -07:00
2015-09-01 04:45:53 -07:00
TARGETS += ot-recorder ocat ghashfind
2015-09-02 03:21:10 -07:00
2015-09-01 04:45:53 -07:00
all: $(TARGETS)
2015-08-14 09:40:35 -07:00
2015-08-30 11:26:36 -07:00
ot-recorder: ot-recorder.o $(OTR_OBJS)
2015-09-02 03:21:10 -07:00
$(CC) $(CFLAGS) -o ot-recorder ot-recorder.o $(OTR_OBJS) $(LIBS)
ocat: ocat.o $(OTR_OBJS)
$(CC) $(CFLAGS) -o ocat ocat.o $(OTR_OBJS) $(LIBS)
ghashfind: ghashfind.o $(OTR_OBJS)
$(CC) $(CFLAGS) -o ghashfind ghashfind.o $(OTR_OBJS) $(LIBS)
2015-08-14 09:40:35 -07:00
ot-recorder.o: ot-recorder.c storage.h util.h Makefile geo.h udata.h json.h http.h gcache.h config.mk
geo.o: geo.h geo.c udata.h Makefile config.mk
geohash.o: geohash.h geohash.c udata.h Makefile config.mk
2015-08-14 09:40:35 -07:00
base64.o: base64.h base64.c
gcache.o: gcache.c gcache.h json.h config.mk
misc.o: misc.c misc.h udata.h Makefile config.mk
http.o: http.c mongoose.h util.h http.h storage.h config.mk
2015-08-22 06:52:39 -07:00
util.o: util.c util.h Makefile config.mk
ghashfind.o: ghashfind.c util.h config.mk
2015-08-27 14:42:18 -07:00
mongoose.o: mongoose.c mongoose.h
2015-09-10 06:39:25 -07:00
ocat.o: ocat.c storage.h util.h config.mk version.h
storage.o: storage.c storage.h util.h gcache.h config.mk
2015-09-02 03:21:10 -07:00
2015-08-27 13:52:58 -07:00
2015-08-15 03:50:16 -07:00
clean:
rm -f *.o
clobber: clean
rm -f ot-recorder ocat ghashfind
2015-09-01 04:45:53 -07:00
mdb/liblmdb.a:
(cd mdb && make)
2015-09-11 05:13:10 -07:00
install: ot-recorder ocat
2015-09-15 02:32:17 -07:00
mkdir -p $(DESTDIR)$(INSTALLDIR)/bin
mkdir -p $(DESTDIR)$(INSTALLDIR)/sbin
2015-09-15 02:21:45 -07:00
mkdir -p $(DESTDIR)$(STORAGEDEFAULT)
mkdir -p $(DESTDIR)$(DOCROOT)
cp -R docroot/* $(DESTDIR)$(DOCROOT)/
install --mode 0755 ot-recorder $(DESTDIR)$(INSTALLDIR)/sbin
install --mode 0755 ocat $(DESTDIR)$(INSTALLDIR)/bin