# MinGW Project, accept liability for any damages, however caused,
# arising from the use of this software.
#
-all: @mingw_ac_subdirs@ update-references
+all: check @mingw_ac_subdirs@ update-references
@SET_MAKE@
@mingw_ac_subdirs@: FORCE
#
all-distfiles: all
+# Before building a set of catalogues, for publication, we should run
+# the test suite to validate all source documents; the following rules
+# provide the interface which is needed to run the test suite.
+#
+srcdir = @srcdir@
+check: tests/Makefile
+ cd tests; $(MAKE_RECURSIVE) $@
+
+${srcdir}/tests/configure: ${srcdir}/tests/configure.ac VERSION.m4
+ cd ${srcdir}/tests; autoconf
+
+tests/Makefile: ${srcdir}/tests/configure
+ test -d tests || mkdir tests
+ cd tests; ../${srcdir}/tests/configure
+
# To support optimised "mingw-get update", the package lists must be
# dynamically updated, to correctly identify the latest issue of each
# individual package catalogue file; the following rule, (which MUST
#
update-local-references: @mingw_ac_subdirs@
+# Approiately authenticated users may publish updated catalogues
+# via the SourceForge file release system.
+#
+FRS_CATALOGUE_HOST = frs.sourceforge.net
+FRS_CATALOGUE_ROOT = /home/frs/project/mingw
+FRS_CATALOGUE_PATH = $(FRS_CATALOGUE_ROOT)/Installer/mingw-get/catalogue
+
+FRS_CATALOGUE = $(FRS_CATALOGUE_HOST):$(FRS_CATALOGUE_PATH)
+
+published:
+ rm -rf tmp; mkdir tmp
+ cd tmp; @LN_S@ ../*/unpublished/* .
+ @test "x`cd tmp; echo *`x" = 'x*x' \
+ && echo "NOTE: there are no catalogue files awaiting publication" \
+ || $(MAKE_RECURSIVE) frs-publish
+ rm -rf tmp
+
+# Publication of updated catalogues, to the file release system,
+# requires an authorised SourceForge user name specification.
+#
+FRS_USERNAME = @FRS_USERNAME@
+MAKE_RECURSIVE = $(MAKE)@NO_PRINT_DIRECTORY@ PRIMARY_GOALS=$(MAKECMDGOALS)
+frs-username-check:
+ @test "x$(FRS_USERNAME)" = "xanonymous" && \
+ { echo 'ERROR: "$(FRS_USERNAME)" is not a valid FRS_USERNAME'; \
+ echo 'please try "make FRS_USERNAME=username $(PRIMARY_GOALS)"'; \
+ exit 1; \
+ } || true
+
+# For potentially valid user names, publication entails an sftp
+# upload of all staged catalogues, to the file release system.
+#
+frs-publish: frs-username-check
+ cd tmp; echo 'put *' | sftp $(FRS_USERNAME)@$(FRS_CATALOGUE)
+ rm -f */unpublished/*
+
# The following goals may be specified, when building as a sub-project
# of mingw-get-setup; pass each request to all designated subdirectories,
# in each of which it will become a no-op.