-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (48 loc) · 2.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
include config.mk
CFLAGS= -Wall -Werror $(INC)
LDFLAGS=-lmicrohttpd -lcurl -llmdb $(LIBS)
INSTALLDIR = /usr/local
CFLAGS += -DLMDB_DATABASE=\"$(LMDB_DATABASE)\"
CFLAGS += -DLISTEN_HOST=\"$(LISTEN_HOST)\"
CFLAGS += -DLISTEN_PORT=\"$(LISTEN_PORT)\"
OBJS = json.o geohash.o geo.o db.o uptime.o
ifneq ($(origin STATSDHOST), undefined)
CFLAGS += -DSTATSD=\"$(STATSDHOST)\"
CFLAGS += $(INC)
OBJS += statsd/statsd-client.o
endif
all: revgeod lmdb-ll-look
revgeod: revgeod.c $(OBJS) Makefile version.h config.mk
$(CC) $(CFLAGS) -o revgeod revgeod.c $(OBJS) $(LDFLAGS)
geo.o: geo.c json.h version.h
lmdb-ll-look: lmdb-ll-look.c geohash.o json.o db.o
$(CC) $(CFLAGS) -o lmdb-ll-look lmdb-ll-look.c geohash.o json.o db.o -llmdb $(LIBS)
db.o: db.c db.h
geo.o: geo.c geo.h
geohash.o: geohash.c geohash.h
json.o: json.c json.h
revgeod.o: revgeod.c geohash.h geo.h db.h json.h uptime.h uthash.h utstring.h version.h
clean:
rm -f *.o
clobber: clean
rm -f revgeod lmdb-ll-look
install: revgeod
[ -d $(DESTDIR)$(INSTALLDIR)/bin ] || ( mkdir -p $(DESTDIR)$(INSTALLDIR)/bin; chmod 755 $(DESTDIR)$(INSTALLDIR)/bin )
[ -d $(DESTDIR)$(INSTALLDIR)/sbin ] || ( mkdir -p $(DESTDIR)$(INSTALLDIR)/sbin; chmod 755 $(DESTDIR)$(INSTALLDIR)/sbin )
mkdir -p $(DESTDIR)/var/local/revgeod
chmod 755 $(DESTDIR)/var/local/revgeod
mkdir -p $(DESTDIR)$(INSTALLDIR)/share/man/man1 $(DESTDIR)$(INSTALLDIR)/share/man/man8
chmod 755 $(DESTDIR)$(INSTALLDIR)/share/man/man1 $(DESTDIR)$(INSTALLDIR)/share/man/man8
install -m 755 revgeoc $(DESTDIR)$(INSTALLDIR)/bin/revgeoc
install -m 755 revgeod $(DESTDIR)$(INSTALLDIR)/sbin/revgeod
mkdir -p $(DESTDIR)$(INSTALLDIR)/etc/default
chmod 755 $(DESTDIR)$(INSTALLDIR)/etc/default
install -m 640 etc/revgeod.default $(DESTDIR)$(INSTALLDIR)/etc/default/revgeod
install -m 644 revgeod.1 $(DESTDIR)$(INSTALLDIR)/share/man/man1/revgeoc.1
install -m 644 revgeod.1 $(DESTDIR)$(INSTALLDIR)/share/man/man8/revgeod.8
docs: revgeod.1 README.md
revgeod.1: revgeod.pandoc Makefile
pandoc -s -o $@ -f markdown $<
README.md: revgeod.pandoc Makefile
pandoc -s -w gfm -f markdown $< | sed -e 1,3d > $@
# pandoc -s -w markdown+simple_tables $< | sed -n -e '4,$$p' > $@