# Make all PostGIS objects depend upon liblwgeom, so that if an underlying
# change is made, a PostGIS rebuild is triggered.
-$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a
+#
+# Also they are all dependent on postgis_config.h
+#
+$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postgis_config.h
# Borrow the $libdir substitution from PGXS but customise by adding the version number
%.sql: %.sql.in
$(SQL_OBJS): %.in: %.in.c
$(CPP) -traditional-cpp -I../libpgcommon $< | grep -v '^#' > $@
+# SQL objects are also dependent on postgis_config.h for PostgreSQL version
+$(SQL_OBJS): ../postgis_config.h
+
postgis.sql.in: geography.sql.in.c