sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql \
$(NULL)
-UPGRADE_SCRIPTS = $(wildcard sql/*--*.sql)
+# Scripts making up the extension file
+# NOTE: order matters
+EXTENSION_SCRIPTS = \
+ sql_bits/postgis.sql \
+ sql_bits/postgis_comments.sql \
+ sql_bits/rtpostgis.sql \
+ sql_bits/spatial_ref_sys_config_dump.sql \
+ sql_bits/raster_comments.sql \
+ sql_bits/spatial_ref_sys.sql
+
+# Scripts making up the extension minor upgrade file
+# NOTE: order matters
+EXTENSION_UPGRADE_SCRIPTS = \
+ ../postgis_extension_helper.sql \
+ sql_bits/postgis_upgrade.sql \
+ sql_bits/rtpostgis_upgrade.sql \
+ ../../doc/raster_comments.sql \
+ ../../doc/postgis_comments.sql \
+ ../postgis_extension_helper_uninstall.sql
+
+# Scripts making up the extension upgrade-from-unpackaged file
+# NOTE: order matters
+EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS = \
+ sql_bits/postgis.sql \
+ sql_bits/rtpostgis.sql
#DOCS = $(wildcard ../../doc/html/*.html)
PG_CONFIG = @PG_CONFIG@
all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
-sql/$(EXTENSION).sql: sql_bits/postgis.sql sql_bits/postgis_comments.sql sql_bits/rtpostgis.sql sql_bits/spatial_ref_sys_config_dump.sql sql_bits/raster_comments.sql sql_bits/spatial_ref_sys.sql
+sql/$(EXTENSION).sql: $(EXTENSION_SCRIPTS)
mkdir -p sql
printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
cat $^ >> $@
mkdir -p sql
cp $< $@
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/postgis.sql sql_bits/rtpostgis.sql ../../utils/create_unpackaged.pl
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) ../../utils/create_unpackaged.pl
mkdir -p sql
- cat ../../postgis/postgis.sql ../../raster/rt_pg/rtpostgis.sql | $(PERL) ../../utils/create_unpackaged.pl postgis > $@
+ cat $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) | $(PERL) ../../utils/create_unpackaged.pl postgis > $@
#strip BEGIN/COMMIT since these are not allowed in extensions
sql_bits/spatial_ref_sys.sql: ../../spatial_ref_sys.sql
cp $< $@
#postgis_extension_upgrade_minor.sql is the one that contains both postgis AND raster
-sql_bits/postgis_extension_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/postgis_upgrade.sql sql_bits/rtpostgis_upgrade.sql ../../doc/raster_comments.sql ../../doc/postgis_comments.sql ../postgis_extension_helper_uninstall.sql
+sql_bits/postgis_extension_upgrade_minor.sql: $(EXTENSION_UPGRADE_SCRIPTS)
printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
cat $^ >> $@