]> git.openstreetmap.org Git - nominatim.git/blob - nominatim/Makefile.in
aux properties, memory leaks, tweaks to search order
[nominatim.git] / nominatim / Makefile.in
1
2 prefix = @prefix@
3 exec_prefix = @exec_prefix@
4 bindir = @bindir@
5 sysconfdir = @sysconfdir@
6 datarootdir = @datarootdir@
7 datadir = @datadir@
8
9 PACKAGE = @PACKAGE_NAME@
10 VERSION = @PACKAGE_VERSION@
11 SVN:=$(shell svnversion)
12 DATADIR = $(datadir)/$(PACKAGE)
13
14
15 CC = @CC@ 
16 CXX = @CXX@
17
18 CFLAGS += -g -O2 -Wall -Wextra
19 CFLAGS += $(shell xml2-config --cflags)
20 CFLAGS += $(shell geos-config --cflags)
21 CFLAGS += -I$(shell pg_config --includedir)
22 CFLAGS += -DVERSION=\"$(VERSION)-$(SVN)\"
23 CFLAGS += -DHAVE_PTHREAD
24 CFLAGS += -DNOMINATIM_DATADIR=\"$(DATADIR)\"
25
26 LDFLAGS += $(shell xml2-config --libs) 
27 LDFLAGS += $(shell geos-config --libs)
28 LDFLAGS += -L$(shell pg_config --libdir) -lpq
29 LDFLAGS += -lbz2 -lz
30 LDFLAGS += -g -lproj
31 LDFLAGS += -lstdc++
32 LDFLAGS += -lpthread
33
34 SRCS:=$(wildcard *.c) $(wildcard *.cpp)
35 OBJS:=$(SRCS:.c=.o)
36 OBJS:=$(OBJS:.cpp=.o)
37 DEPS:=$(SRCS:.c=.d)
38 DEPS:=$(DEPS:.cpp=.d)
39
40 APPS:=nominatim
41 DATA:=default.style
42
43 .PHONY: all clean $(PACKAGE).spec
44
45 all: $(APPS)
46
47 clean: 
48         rm -f $(APPS) $(OBJS) $(DEPS)
49         rm -f $(PACKAGE)-*.tar.bz2
50         rm -f nominatim.spec
51
52 clean-all: clean
53         rm -rf autom4te.cache
54         rm -f config.h
55         rm -f config.log
56         rm -f config.status
57         rm -f configure
58         rm -f Makefile
59
60 install: $(APPS)
61         mkdir -p $(DESTDIR)$(bindir)
62         install -m 0755 $(APPS) $(DESTDIR)$(bindir)
63         mkdir -p $(DESTDIR)$(DATADIR)
64         install -m 0644 $(DATA) $(DESTDIR)$(DATADIR)
65
66 %.d: %.c
67         @set -e; rm -f $@; \
68         $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
69         sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
70         rm -f $@.$$$$
71
72 -include $(DEPS)
73
74 nominatim: $(OBJS)
75         $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
76
77 $(PACKAGE).spec: $(PACKAGE).spec.in
78         sed -e "s/@PACKAGE@/$(PACKAGE)/g; s/@VERSION@/$(VERSION)/g; s/@SVN@/$(SVN)/g;" $^ > $@
79
80 $(PACKAGE)-$(VERSION).tar.bz2: $(PACKAGE).spec
81         rm -fR tmp
82         mkdir -p tmp/nominatim
83         cp -p Makefile *.[ch] *.cpp README.txt nominatim-svn.sh tmp/nominatim
84         cp -p nominatim.spec tmp/
85         tar cjf $@ -C tmp .
86         rm -fR tmp
87
88 rpm: $(PACKAGE)-$(VERSION).tar.bz2
89         rpmbuild -ta $^