OSDN Git Service

Add support for automated catalogue publication.
[mingw/mingw-dist.git] / Makefile.in
1 # @configure_input@
2 #
3 # $Id$
4 #
5 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
6 # Copyright (C) 2010, 2011, 2013, MinGW.org Project
7 #
8 #
9 # Makefile template for generating mingw-get distribution manifests.
10 #
11 #   Project: @PACKAGE_TARNAME@
12 #   Version: @PACKAGE_VERSION@
13 #
14 #
15 # This is free software.  Permission is granted to copy, modify and
16 # redistribute this software, under the provisions of the GNU General
17 # Public License, Version 3, (or, at your option, any later version),
18 # as published by the Free Software Foundation; see the file COPYING
19 # for licensing details.
20 #
21 # Note, in particular, that this software is provided "as is", in the
22 # hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
23 # even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
24 # PARTICULAR PURPOSE.  Under no circumstances will the author, or the
25 # MinGW Project, accept liability for any damages, however caused,
26 # arising from the use of this software.
27 #
28 all: @mingw_ac_subdirs@ update-references
29
30 @SET_MAKE@
31 @mingw_ac_subdirs@: FORCE
32         @if test -r $@/Makefile; then \
33           cd $@; $(MAKE) $(MAKECMDGOALS); \
34           fi
35
36 .PHONY: FORCE
37 FORCE:
38
39 # Capture repository infrastructure changes.  The following rules ensure
40 # that configure, config.status, and all working makefiles will be updated,
41 # when any of their respective sources are modified.
42 #
43 top_srcdir = @top_srcdir@
44 VPATH = ${top_srcdir}
45
46 configure: configure.ac makeopts.m4
47         cd ${top_srcdir}; autoconf
48
49 config.status: configure
50         ./config.status --recheck
51
52 Makefile: config.status Makefile.in Makefile.stub.in Makefile.comm.in
53         ./config.status
54
55 # We must list all goals which may be specified for sub-directories,
56 # so that they may be correctly passed through $(MAKECMDGOALS); at this
57 # level, the action for each is equivalent to that to be performed for
58 # the `all' goal.
59 #
60 all-distfiles: all
61
62 # To support optimised "mingw-get update", the package lists must be
63 # dynamically updated, to correctly identify the latest issue of each
64 # individual package catalogue file; the following rule, (which MUST
65 # be invoked at top level), creates a "sed" script which may then be
66 # paste the appropriate tags into the package list files.
67 #
68 ref = @top_srcdir@/*/
69 issue.sed: FORCE
70         echo 's/issue=.*\(catalogue=\)/\\1/' > $@
71         for tag in `sed -n '/.*catalogue="/{s///;s/".*//p;}' ${ref}*.xml`; \
72           do awk /$$tag'.xml$$/{ \
73                print "s/catalogue=\"'$$tag'\"/issue=\"" $$2 "\" &/" \
74              }' ${ref}issue.log; \
75           done >> $@
76
77 # The generated "sed" script must be applied iteratively, to each of
78 # the catalogue files which contains "package-list" references, until
79 # all cross references have been fully resolved...
80 #
81 update-references: FORCE
82         echo check > issue.chk
83         @while test x"`cat issue.chk`" != xclean; \
84           do echo clean > issue.chk; \
85              $(MAKE) update-local-references; \
86           done
87         rm -f issue.chk
88
89 # ...considering all catalogues, in all registered sub-directories.
90 #
91 update-local-references: @mingw_ac_subdirs@
92
93 # Approiately authenticated users may publish updated catalogues
94 # via the SourceForge file release system.
95 #
96 FRS_CATALOGUE_HOST = frs.sourceforge.net
97 FRS_CATALOGUE_ROOT = /home/frs/project/mingw
98 FRS_CATALOGUE_PATH = $(FRS_CATALOGUE_ROOT)/Installer/mingw-get/catalogue
99
100 FRS_CATALOGUE = $(FRS_CATALOGUE_HOST):$(FRS_CATALOGUE_PATH)
101
102 published:
103         rm -rf tmp; mkdir tmp
104         cd tmp; @LN_S@ ../*/unpublished/* .
105         @test "x`cd tmp; echo *`x" = 'x*x' \
106           && echo "NOTE: there are no catalogue files awaiting publication" \
107           || $(MAKE_RECURSIVE) frs-publish
108         rm -rf tmp
109
110 # Publication of updated catalogues, to the file release system,
111 # requires an authorised SourceForge user name specification.
112 #
113 FRS_USERNAME = @FRS_USERNAME@
114 MAKE_RECURSIVE = $(MAKE)@NO_PRINT_DIRECTORY@ PRIMARY_GOALS=$(MAKECMDGOALS)
115 frs-username-check:
116         @test "x$(FRS_USERNAME)" = "xanonymous" && \
117           { echo 'ERROR: "$(FRS_USERNAME)" is not a valid FRS_USERNAME'; \
118             echo 'please try "make FRS_USERNAME=username $(PRIMARY_GOALS)"'; \
119             exit 1; \
120           } || true
121
122 # For potentially valid user names, publication entails an sftp
123 # upload of all staged catalogues, to the file release system.
124 #
125 frs-publish: frs-username-check
126         cd tmp; echo 'put *' | sftp $(FRS_USERNAME)@$(FRS_CATALOGUE)
127         rm -f */unpublished/*
128
129 # The following goals may be specified, when building as a sub-project
130 # of mingw-get-setup; pass each request to all designated subdirectories,
131 # in each of which it will become a no-op.
132 #
133 NO_OP_GOALS = build.tag dist clean distclean maintainer-clean
134 $(NO_OP_GOALS): @mingw_ac_subdirs@
135
136 # $RCSfile$: end of file