# ********************************************************************** # * # * PostGIS - Spatial Types for PostgreSQL # * http://postgis.net # * # * Copyright (C) 2018-2022 Sandro Santilli # * # * 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@ # To use a custom database name, run: # # make garden GARDENDB=custom_db_name # GARDENDB=postgis_garden EXAMPLETESTDB=postgis_exampletest EXAMPLETEST_RUN_FLAGS = --keep-going EXAMPLETEST_VISUAL_JOBS ?= 2 # 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 $(builddir)/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 rm -f dumper/tests.mk 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 dropdb --if-exists $(GARDENDB) createdb $(GARDENDB) psql -qX -v ON_ERROR_STOP=true -d $(GARDENDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/postgis.sql psql -qX -v ON_ERROR_STOP=true -d $(GARDENDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/spatial_ref_sys.sql psql -qX -v ON_ERROR_STOP=true -d $(GARDENDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/rtpostgis.sql psql -qX -v ON_ERROR_STOP=true -d $(GARDENDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/topology.sql psql -qX -v ON_ERROR_STOP=true -d $(GARDENDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/sfcgal.sql @echo '-------------------------------------------------' @echo 'PostGIS garden tests in progress (it will take time)' @echo '-------------------------------------------------' psql -X -ad $(GARDENDB) < \ ../doc/postgis_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql \ > postgis_garden_result.txt 2>&1 || { \ tail -n 20 postgis_garden_result.txt; false; } tail -n 20 postgis_garden_result.txt @echo '-------------------------------------------------' @echo 'PostGIS Raster garden tests in progress (it will take time)' @echo '-------------------------------------------------' psql -X -ad $(GARDENDB) < \ ../doc/raster_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql \ > raster_garden_result.txt 2>&1 || { \ tail -n 20 raster_garden_result.txt; false; } tail -n 20 raster_garden_result.txt @echo '-------------------------------------------------' @echo 'PostGIS Topology garden tests in progress (it will take time)' @echo '-------------------------------------------------' psql -X -ad $(GARDENDB) < \ ../doc/topology_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql \ > topology_garden_result.txt 2>&1 || { \ tail -n 20 topology_garden_result.txt; false; } tail -n 20 topology_garden_result.txt @echo '-------------------------------------------------' @echo 'PostGIS SFCGAL garden tests in progress (it will take time)' @echo '-------------------------------------------------' psql -X -ad $(GARDENDB) < \ ../doc/sfcgal_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql \ > sfcgal_garden_result.txt 2>&1 || { \ tail -n 20 sfcgal_garden_result.txt; false; } tail -n 20 sfcgal_garden_result.txt @echo '-------------------------------------------------' @echo 'Manual example tests in progress' @echo '-------------------------------------------------' $(MAKE) exampletest-run exampletest: staged-install exampletest-run visual-examples: staged-install visual-examples-run visual-examples-run: EXAMPLETEST_RUN_FLAGS = --keep-going --visual-only --jobs $(EXAMPLETEST_VISUAL_JOBS) visual-examples-run: EXAMPLETEST_CHECK_ENVIRONMENT = no visual-examples-run: exampletest-run exampletest-unit: python3 $(top_srcdir)/utils/docs/tests/test_postgis_exampletest.py exampletest-run: exampletest-unit $(MAKE) -C ../doc postgis-out.xml dropdb --if-exists $(EXAMPLETESTDB) createdb $(EXAMPLETESTDB) psql -qX -v ON_ERROR_STOP=true -d $(EXAMPLETESTDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/postgis.sql psql -qX -v ON_ERROR_STOP=true -d $(EXAMPLETESTDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/spatial_ref_sys.sql @if test x"@RASTER@" != x; then \ psql -qX -v ON_ERROR_STOP=true -d $(EXAMPLETESTDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/rtpostgis.sql; \ fi @if test x"@TOPOLOGY@" != x; then \ psql -qX -v ON_ERROR_STOP=true -d $(EXAMPLETESTDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/topology.sql; \ fi @if test x"@SFCGAL@" != x; then \ psql -qX -v ON_ERROR_STOP=true -d $(EXAMPLETESTDB) < $(REGRESS_INSTALLDIR)/share/contrib/postgis/sfcgal.sql; \ fi @if test x"$(EXAMPLETEST_CHECK_ENVIRONMENT)" != xno; then \ $(top_srcdir)/utils/docs/postgis_exampletest.py --check-environment --database $(EXAMPLETESTDB) ../doc/postgis-out.xml \ > postgis_exampletest_environment.txt 2>&1 || { \ cat postgis_exampletest_environment.txt; false; }; \ fi $(top_srcdir)/utils/docs/postgis_exampletest.py --run --database $(EXAMPLETESTDB) ../doc/postgis-out.xml \ $(EXAMPLETEST_RUN_FLAGS) \ --render-dir $(abs_top_builddir)/doc/html/images/visual-examples