X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/33a65a90c9d0e2ab121e1da9c3efedaf9e6a9789..3115fd41b178e76bd1932ffb2c051407a4020e8e:/db/functions/Makefile diff --git a/db/functions/Makefile b/db/functions/Makefile index 6544db1ff..dac1889dc 100644 --- a/db/functions/Makefile +++ b/db/functions/Makefile @@ -1,4 +1,24 @@ +PG_CONFIG ?= pg_config +DESTDIR ?= . + QTDIR=../../lib/quad_tile -libquadtile.so: quadtile.c ${QTDIR}/quad_tile.h - cc `mysql_config --include` -I${QTDIR} -fPIC -O3 -shared -o libquadtile.so quadtile.c +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 ${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