X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dd9ad16303f0496455720721e01b3c5042094f38..e682b1a466088ba312278a4f467df91a7b91c46c:/db/functions/Makefile?ds=sidebyside diff --git a/db/functions/Makefile b/db/functions/Makefile index ce216e765..dac1889dc 100644 --- a/db/functions/Makefile +++ b/db/functions/Makefile @@ -1,10 +1,24 @@ +PG_CONFIG ?= pg_config +DESTDIR ?= . + QTDIR=../../lib/quad_tile -libquadtile.so: quadtile.o - cc -shared -o libquadtile.so quadtile.o +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 $@ $^ -libquadtile.dylib: quadtile.o - libtool -dynamic quadtile.o -o libquadtile.dylib +${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