source: subversion/applications/utils/export/osm2pgsql/Makefile @ 9252

Last change on this file since 9252 was 8320, checked in by jonb, 12 years ago

osm2pgsql: Up-rev to 0.55 for the new default projection change

File size: 1.5 KB
Line 
1PACKAGE:=osm2pgsql
2VERSION:=0.55
3SVN:=$(shell date +%Y%m%d)
4
5CC = gcc
6CXX = g++
7
8CFLAGS += -g -O2 -Wall -Wextra
9CFLAGS += $(shell xml2-config --cflags)
10CFLAGS += $(shell geos-config --cflags)
11CFLAGS += -I$(shell pg_config --includedir)
12CFLAGS += -DVERSION=\"$(VERSION)-$(SVN)\"
13CFLAGS += -DHAVE_PTHREAD
14CC=gcc
15CXX=g++
16
17CXXFLAGS += -g -O2 -Wall -DGEOS_INLINE $(CFLAGS)
18CXXFLAGS += $(shell geos-config --cflags)
19
20LDFLAGS += $(shell xml2-config --libs) 
21LDFLAGS += $(shell geos-config --libs)
22LDFLAGS += -L$(shell pg_config --libdir) -lpq
23LDFLAGS += -lbz2 -lz
24LDFLAGS += -g -lproj
25LDFLAGS += -lstdc++
26LDFLAGS += -lpthread
27
28SRCS:=$(wildcard *.c) $(wildcard *.cpp)
29OBJS:=$(SRCS:.c=.o)
30OBJS:=$(OBJS:.cpp=.o)
31DEPS:=$(SRCS:.c=.d)
32DEPS:=$(DEPS:.cpp=.d)
33
34APPS:=osm2pgsql
35
36.PHONY: all clean $(PACKAGE).spec
37
38all: $(APPS)
39
40clean: 
41        rm -f $(APPS) $(OBJS) $(DEPS)
42        rm -f $(PACKAGE)-*.tar.bz2
43
44%.d: %.c
45        @set -e; rm -f $@; \
46        $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
47        sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
48        rm -f $@.$$$$
49
50-include $(DEPS)
51
52osm2pgsql: $(OBJS)
53        $(CXX) -o $@ $^ $(LDFLAGS)
54
55$(PACKAGE).spec: $(PACKAGE).spec.in
56        sed -e "s/@PACKAGE@/$(PACKAGE)/g; s/@VERSION@/$(VERSION)/g; s/@SVN@/$(SVN)/g;" $^ > $@
57
58$(PACKAGE)-$(VERSION)-$(SVN).tar.bz2: $(PACKAGE).spec
59        rm -fR tmp
60        mkdir -p tmp/osm2pgsql
61        cp -p Makefile *.[ch] *.cpp readme.txt osm2pgsql-svn.sh tmp/osm2pgsql
62        cp -p osm2pgsql.spec tmp/
63        tar cjf $@ -C tmp .
64        rm -fR tmp
65
66rpm: $(PACKAGE)-$(VERSION)-$(SVN).tar.bz2
67        rpmbuild -ta $^
Note: See TracBrowser for help on using the repository browser.