X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/26fb51c86e178a1c5bbe313c4688c623646173f8..d5fe598a18eb04b10f4ac29f22a1bccb79185ad4:/db/functions/Makefile diff --git a/db/functions/Makefile b/db/functions/Makefile index ce216e765..a1259fc55 100644 --- a/db/functions/Makefile +++ b/db/functions/Makefile @@ -1,10 +1,25 @@ -QTDIR=../../lib/quad_tile +BUNDLE ?= bundle +PG_CONFIG ?= pg_config +DESTDIR ?= . -libquadtile.so: quadtile.o - cc -shared -o libquadtile.so quadtile.o +QTDIR=$(shell ${BUNDLE} show quad_tile | tail -n 1)/ext/quad_tile -libquadtile.dylib: quadtile.o - libtool -dynamic quadtile.o -o libquadtile.dylib +OS=$(shell uname -s) +ifeq (${OS},Darwin) + LDFLAGS=-bundle +else + LDFLAGS=-shared +endif -quadtile.o: quadtile.c ${QTDIR}/quad_tile.h - cc `mysql_config --include` -I${QTDIR} -fPIC -O3 -c -o quadtile.o quadtile.c +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 $@ $< + +${DESTDIR}/quadtile.o: ${QTDIR}/quad_tile.h