X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cfbdd3f7e1c688e2c875ded9fd847fcc1c3a4caf..e4c40cbd36567d050f1b779f1444c4ef26c50a5b:/db/functions/Makefile?ds=sidebyside diff --git a/db/functions/Makefile b/db/functions/Makefile index 6544db1ff..9388e2d23 100644 --- a/db/functions/Makefile +++ b/db/functions/Makefile @@ -1,4 +1,25 @@ -QTDIR=../../lib/quad_tile +BUNDLE ?= bundle +PG_CONFIG ?= pg_config +DESTDIR ?= . -libquadtile.so: quadtile.c ${QTDIR}/quad_tile.h - cc `mysql_config --include` -I${QTDIR} -fPIC -O3 -shared -o libquadtile.so quadtile.c +QTDIR=$(shell ${BUNDLE} show quad_tile | tail -n 1)/ext/quad_tile + +OS=$(shell uname -s) +ifeq (${OS},Darwin) + LDFLAGS=-bundle +else + LDFLAGS=-shared +endif + +all: ${DESTDIR}/libpgosm.so + +clean: + $(RM) ${DESTDIR}/*.so ${DESTDIR}/*.o + +${DESTDIR}/libpgosm.so: ${DESTDIR}/quadtile.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