X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c8ee1351049ef1bb4d7b50d071b2a96154266d1d..71b76a21aea7456a5e5eb4b618fed24a9ff49535:/db/functions/Makefile diff --git a/db/functions/Makefile b/db/functions/Makefile index 1bdddce71..6bb966b9a 100644 --- a/db/functions/Makefile +++ b/db/functions/Makefile @@ -1,6 +1,7 @@ -QTDIR=../../lib/quad_tile +PG_CONFIG ?= pg_config +DESTDIR ?= . -PGSQLINC=/usr/include/postgresql/8.3/server/ +QTDIR=$(shell bundle show quad_tile)/ext/quad_tile OS=$(shell uname -s) ifeq (${OS},Darwin) @@ -9,22 +10,15 @@ else LDFLAGS=-shared endif -all: libmyosm.so libpgosm.so +all: ${DESTDIR}/libpgosm.so clean: - $(RM) *.so *.o + $(RM) ${DESTDIR}/*.so ${DESTDIR}/*.o -libmyosm.so: quadtile.o maptile-mysql.o - cc ${LDFLAGS} -o libmyosm.so quadtile.o maptile-mysql.o +${DESTDIR}/libpgosm.so: ${DESTDIR}/quadtile.o ${DESTDIR}/maptile.o ${DESTDIR}/xid_to_int4.o + cc ${LDFLAGS} -o $@ $^ -libpgosm.so: maptile-pgsql.o - cc ${LDFLAGS} -o libpgosm.so maptile-pgsql.o +${DESTDIR}/%.o: %.c + cc -I `${PG_CONFIG} --includedir` -I `${PG_CONFIG} --includedir-server` -I${QTDIR} -fPIC -O3 -DUSE_PGSQL -c -o $@ $< -quadtile.o: quadtile.c ${QTDIR}/quad_tile.h - cc `mysql_config --include` -I${QTDIR} -fPIC -O3 -c -o quadtile.o quadtile.c - -maptile-mysql.o: maptile.c - cc `mysql_config --include` -fPIC -O3 -DUSE_MYSQL -c -o maptile-mysql.o maptile.c - -maptile-pgsql.o: maptile.c - cc -I${PGSQLINC} -O3 -fPIC -DUSE_PGSQL -c -o maptile-pgsql.o maptile.c \ No newline at end of file +${DESTDIR}/quadtile.o: ${QTDIR}/quad_tile.h