openstreetmap-website/db/functions/Makefile
Benjamin Reynolds d5672aed4a Remove quad_tile library and extract to gem
Quad tile functions are now installed via a gem with native extension
automatically. This improves the run time of the test suite by ~30% for
users that didn't bother to build the C version of the functions.

Closes #1314
Closes #1899
2018-06-14 18:29:37 +01:00

24 lines
557 B
Makefile

PG_CONFIG ?= pg_config
DESTDIR ?= .
QTDIR=$(shell bundle show quad_tile)/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 ${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