X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5449cf4adcc1fad4b9f43426e6d3e4a8f65e6fbb..613b748c5556139bdd04b6cda2f5ebf448e20aa2:/db/functions/Makefile diff --git a/db/functions/Makefile b/db/functions/Makefile index 9158b4959..a1259fc55 100644 --- a/db/functions/Makefile +++ b/db/functions/Makefile @@ -1,4 +1,8 @@ -QTDIR=../../lib/quad_tile +BUNDLE ?= bundle +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,22 +11,15 @@ else LDFLAGS=-shared endif -all: libmyosm.so libpgosm.so +all: ${DESTDIR}/libpgosm.so clean: - $(RM) *.so *.o - -libmyosm.so: quadtile.o maptile-mysql.o - cc ${LDFLAGS} -o libmyosm.so quadtile.o maptile-mysql.o - -libpgosm.so: maptile-pgsql.o - cc ${LDFLAGS} -o libpgosm.so maptile-pgsql.o + $(RM) ${DESTDIR}/*.so ${DESTDIR}/*.o -quadtile.o: quadtile.c ${QTDIR}/quad_tile.h - cc `mysql_config --include` -I${QTDIR} -fPIC -O3 -c -o quadtile.o quadtile.c +${DESTDIR}/libpgosm.so: ${DESTDIR}/quadtile.o ${DESTDIR}/maptile.o ${DESTDIR}/xid_to_int4.o + cc ${LDFLAGS} -o $@ $^ -maptile-mysql.o: maptile.c - cc `mysql_config --include` -fPIC -O3 -DUSE_MYSQL -c -o maptile-mysql.o maptile.c +${DESTDIR}/%.o: %.c + cc -I `${PG_CONFIG} --includedir` -I `${PG_CONFIG} --includedir-server` -I${QTDIR} -fPIC -O3 -DUSE_PGSQL -c -o $@ $< -maptile-pgsql.o: maptile.c - cc -I `pg_config --includedir-server` -O3 -fPIC -DUSE_PGSQL -c -o maptile-pgsql.o maptile.c +${DESTDIR}/quadtile.o: ${QTDIR}/quad_tile.h