source: subversion/applications/utils/export/osm2pgsql/Makefile.in @ 23731

Last change on this file since 23731 was 23731, checked in by twain, 8 years ago

set CPPFLAGS correctly for non-standard paths

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