openstreetmap-website/db/functions/Makefile
Andy Allan 8db7f5aeac Alter the Makefile to be robust against bundler warnings
In bundle < 2.0, warnings are printed to stdout, along with the path information
that we need. This takes the final line of the output and assumes it's the path.

Fixes #1930
2018-08-29 12:36:31 +08:00

24 lines
569 B
Makefile

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