111 lines
3.8 KiB
Makefile
111 lines
3.8 KiB
Makefile
# **********************************************************************
|
|
# *
|
|
# * PostGIS - Spatial Types for PostgreSQL
|
|
# * http://postgis.net
|
|
# *
|
|
# * Copyright (C) 2018-2022 Sandro Santilli <strk@kbt.io>
|
|
# *
|
|
# * This is free software; you can redistribute and/or modify it under
|
|
# * the terms of the GNU General Public Licence. See the COPYING file.
|
|
# *
|
|
# **********************************************************************
|
|
|
|
top_srcdir = @top_srcdir@
|
|
top_builddir = @top_builddir@
|
|
builddir = @builddir@
|
|
srcdir = @srcdir@
|
|
|
|
PERL=@PERL@
|
|
MINGWBUILD=@MINGWBUILD@
|
|
HAVE_SFCGAL=@HAVE_SFCGAL@
|
|
|
|
POSTGIS_MAJOR_VERSION=@POSTGIS_MAJOR_VERSION@
|
|
POSTGIS_MINOR_VERSION=@POSTGIS_MINOR_VERSION@
|
|
POSTGIS_MICRO_VERSION=@POSTGIS_MICRO_VERSION@
|
|
|
|
# Where we put our regression installation
|
|
# See https://trac.osgeo.org/postgis/ticket/5066
|
|
ifeq ($(MINGWBUILD),1)
|
|
abs_builddir=$(shell bash -c "pwd -W")
|
|
else
|
|
abs_builddir=$(shell pwd)
|
|
endif
|
|
REGRESS_INSTALLDIR = $(abs_builddir)/00-regress-install
|
|
|
|
# MingW hack: rather than use PGSQL_BINDIR directly, we change to the directory and
|
|
# then use "pwd" to return the path. This ensures that the returned path is in MSYS
|
|
# format, otherwise colons in drive letters will break PATH.
|
|
PGSQL_BINDIR=$(shell cd "@PGSQL_BINDIR@" && pwd)
|
|
|
|
#
|
|
# Put path from pg_config into front of search path
|
|
#
|
|
PATH := $(PGSQL_BINDIR):$(PATH)
|
|
export PATH
|
|
|
|
all install uninstall:
|
|
|
|
check: check-regress
|
|
|
|
check-unit:
|
|
|
|
include $(builddir)/core/tests.mk
|
|
include $(srcdir)/loader/tests.mk
|
|
include $(srcdir)/dumper/tests.mk
|
|
|
|
include $(srcdir)/runtest.mk
|
|
|
|
clean:
|
|
rm -rf $(REGRESS_INSTALLDIR)
|
|
rm -f postgis_garden_result.txt
|
|
|
|
distclean: clean
|
|
rm -f Makefile
|
|
rm -f core/Makefile
|
|
rm -f core/tests.mk
|
|
rm -f loader/Makefile
|
|
rm -f dumper/Makefile
|
|
|
|
staged-install-sfcgal:
|
|
@if test x"@SFCGAL@" != "x"; then \
|
|
$(MAKE) -C ../sfcgal REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install; \
|
|
fi
|
|
|
|
staged-install-topology:
|
|
@if test x"@TOPOLOGY@" != "x"; then \
|
|
$(MAKE) -C ../topology REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install; \
|
|
fi
|
|
|
|
staged-install-raster:
|
|
@if test x"@RASTER@" != "x"; then \
|
|
$(MAKE) -C ../raster/rt_pg REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install; \
|
|
fi
|
|
|
|
staged-install-core:
|
|
$(MAKE) -C ../postgis REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install
|
|
$(MAKE) -C ../ REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) comments-install
|
|
#$(MAKE) -C ../loader REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install
|
|
|
|
staged-install:
|
|
$(MAKE) staged-install-core
|
|
$(MAKE) staged-install-raster
|
|
$(MAKE) staged-install-topology
|
|
$(MAKE) staged-install-sfcgal
|
|
$(PERL) -pi -e 's,\$$libdir,$(REGRESS_INSTALLDIR)/lib,g' $(REGRESS_INSTALLDIR)/share/contrib/postgis/*.sql
|
|
|
|
garden: staged-install
|
|
createdb postgis_garden
|
|
createlang plpgsql postgis_garden || true #tolerate an error here
|
|
psql --no-psqlrc --variable ON_ERROR_STOP=true -d postgis_garden < $(REGRESS_INSTALLDIR)/share/contrib/postgis/postgis.sql && \
|
|
psql --no-psqlrc --variable ON_ERROR_STOP=true -d postgis_garden < $(REGRESS_INSTALLDIR)/share/contrib/postgis/spatial_ref_sys.sql || true # tolerate an error here
|
|
psql --no-psqlrc --variable ON_ERROR_STOP=true -d postgis_garden < $(REGRESS_INSTALLDIR)/share/contrib/postgis/rtpostgis.sql || true #tolerate an error here
|
|
@echo '-------------------------------------------------'
|
|
@echo 'Regression tests in progress (it will take time)'
|
|
@echo 'Result output: ./regress/postgis_garden_result.txt'
|
|
@echo '-------------------------------------------------'
|
|
psql --no-psqlrc -ad postgis_garden < ../doc/postgis_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql > postgis_garden_result.txt 2>&1
|
|
tail postgis_garden_result.txt
|
|
psql --no-psqlrc -ad postgis_garden < ../doc/raster_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql > raster_garden_result.txt 2>&1
|
|
tail raster_garden_result.txt
|
|
#dropdb postgis_garden
|