X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09ccace4506d91517ea7ba56171b27eef14e49fe..a41d500b9f65ec9f4e848effd38dc1ae117e7594:/db/functions/Makefile diff --git a/db/functions/Makefile b/db/functions/Makefile index 2f2abe525..6a3fbc0b9 100644 --- a/db/functions/Makefile +++ b/db/functions/Makefile @@ -1,4 +1,7 @@ -QTDIR=../../lib/quad_tile +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,8 +10,15 @@ else LDFLAGS=-shared endif -libquadtile.so: quadtile.o - cc ${LDFLAGS} -o libquadtile.so quadtile.o +all: ${DESTDIR}/libpgosm.so + +clean: + $(RM) ${DESTDIR}/*.so ${DESTDIR}/*.o + +${DESTDIR}/libpgosm.so: ${DESTDIR}/quadtile.o ${DESTDIR}/maptile.o ${DESTDIR}/xid_to_int4.o + cc ${LDFLAGS} -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 +${DESTDIR}/quadtile.o: ${QTDIR}/quad_tile.h