X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e660e609661edadc1ed5ad49d6e83e936b2f91cd..40a3ecb66de42ed7d0bb538377d17abc505d8acd:/db/functions/Makefile diff --git a/db/functions/Makefile b/db/functions/Makefile index 231496d40..3fa4ae526 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,19 +11,15 @@ else LDFLAGS=-shared endif -all: libpgosm.so +all: ${DESTDIR}/libpgosm.so clean: - $(RM) *.so *.o - -libpgosm.so: quadtile-pgsql.o maptile-pgsql.o xid_to_int4-pgsql.o - cc ${LDFLAGS} -o libpgosm.so quadtile-pgsql.o maptile-pgsql.o xid_to_int4-pgsql.o + $(RM) ${DESTDIR}/*.so ${DESTDIR}/*.o -quadtile-pgsql.o: quadtile.c ${QTDIR}/quad_tile.h - cc -I `pg_config --includedir` -I `pg_config --includedir-server` -I${QTDIR} -fPIC -O3 -DUSE_PGSQL -c -o quadtile-pgsql.o quadtile.c +${DESTDIR}/libpgosm.so: ${DESTDIR}/quadtile.o ${DESTDIR}/xid_to_int4.o + cc ${LDFLAGS} -o $@ $^ -maptile-pgsql.o: maptile.c - cc -I `pg_config --includedir` -I `pg_config --includedir-server` -fPIC -O3 -DUSE_PGSQL -c -o maptile-pgsql.o maptile.c +${DESTDIR}/%.o: %.c + cc -I `${PG_CONFIG} --includedir` -I `${PG_CONFIG} --includedir-server` -I${QTDIR} -fPIC -O3 -DUSE_PGSQL -c -o $@ $< -xid_to_int4-pgsql.o: xid_to_int4.c - cc -I `pg_config --includedir` -I `pg_config --includedir-server` -fPIC -O3 -DUSE_PGSQL -c -o xid_to_int4-pgsql.o xid_to_int4.c +${DESTDIR}/quadtile.o: ${QTDIR}/quad_tile.h