X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/250466e58e229dcebbb32c9888aeb197fd4072d3..8cef62cd2cec4a297e46b4f2a86c9afeadb3b283:/db/functions/Makefile?ds=sidebyside diff --git a/db/functions/Makefile b/db/functions/Makefile index 7652862fa..9388e2d23 100644 --- a/db/functions/Makefile +++ b/db/functions/Makefile @@ -1,4 +1,8 @@ -QTDIR=../../lib/quad_tile +BUNDLE ?= bundle +PG_CONFIG ?= pg_config +DESTDIR ?= . + +QTDIR=$(shell ${BUNDLE} show quad_tile | tail -n 1)/ext/quad_tile OS=$(shell uname -s) ifeq (${OS},Darwin) @@ -7,11 +11,15 @@ else LDFLAGS=-shared endif -libmyosm.so: quadtile.o maptile.o - cc ${LDFLAGS} -o libmyosm.so quadtile.o maptile.o +all: ${DESTDIR}/libpgosm.so + +clean: + $(RM) ${DESTDIR}/*.so ${DESTDIR}/*.o + +${DESTDIR}/libpgosm.so: ${DESTDIR}/quadtile.o + cc ${LDFLAGS} -o $@ $^ -quadtile.o: quadtile.c ${QTDIR}/quad_tile.h - cc `mysql_config --include` -I${QTDIR} -fPIC -O3 -c -o quadtile.o quadtile.c +${DESTDIR}/%.o: %.c + cc -I `${PG_CONFIG} --includedir` -I `${PG_CONFIG} --includedir-server` -I${QTDIR} -fPIC -O3 -DUSE_PGSQL -c -o $@ $< -maptile.o: maptile.c - cc `mysql_config --include` -fPIC -O3 -c -o maptile.o maptile.c +${DESTDIR}/quadtile.o: ${QTDIR}/quad_tile.h