5 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
6 # Copyright (C) 2010, MinGW Project
9 # Makefile template for generating mingw-get distribution manifests.
11 # Project: @PACKAGE_TARNAME@
12 # Version: @PACKAGE_VERSION@
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.
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.
30 all: update all-distfiles
32 # To accommodate a top-level make on just a single subdirectory, we list
33 # each of the managed subdirectories as an independent goal, invoking the
34 # "all" action for the target subdirectory.
36 @mingw_ac_subdirs@: all
38 # We use an automatically generated Makefile.sub to manage the list
39 # of distributable files, ensuring that we automatically capture all
40 # XML files in the source directory, and converting them to serialised
41 # LZMA compressed format for upload to the repository server.
43 Makefile.sub: ${srcdir}/*.xml
44 echo "auto-distfiles = \\" > $@
45 for file in $^; do echo "$$file.lzma \\" | sed 's,.*/, ,' >> $@; done
46 echo ' $$(EXTRA_DISTFILES)' >> $@
49 all-distfiles: $(DISTFILES) $(auto-distfiles)
51 # Distributed manifests are serialised by incorporating a date-stamped
52 # issue number, of the form YYYYMMDDNN; we track issue numbers using the
53 # issue.log file, (which we keep in CVS to ensure that all maintainers
54 # can share a common issue number registry).
56 issue_number = YYYYMMDDNN
57 issue_log = ${srcdir}/issue.log
60 cd ${srcdir}; cvs -z3 -Q update -AC issue.log
61 rm -f ${srcdir}'/.#issue.log'*
63 # Formatting within issue.log is controlled by PAD and TAB settings.
68 # The following generic rule processes an XML source template, inserting
69 # the appropriate issue number, and compressing to yield the required LZMA
70 # distribution manifest. The generated issue number which gets applied is
71 # appropriately serialised relative to the original record for the source
72 # XML file being processed, as noted in the local copy of issue.log, which
73 # is then updated to record the new issue number; to avoid any regression
74 # of issue numbers, all maintainers are advised to update issue.log from
75 # CVS immediately prior manifest generation, and to commit back as soon
76 # as possible thereafter; any ensuing conflict must be resolved before
77 # any updated manifest is uploaded to the repository server.
81 sed '/^$(TAB)*$$/d;/^$(TAB)*#/d' $(issue_log) > issue.tmp
82 sed -n '/^$(TAB)*$$/q;/^$(TAB)*[^#]/q;p' $(issue_log) > issue.new
83 test x$${issue="`sed -n 's/^$(TAB)*$*.xml://p' $(issue_log)`"} = x && \
84 issue=0 && echo $(PAD)"$*.xml:0" >> issue.tmp; \
85 test $$issue -lt $${mark="`date -u +%Y%m%d`00"} && \
86 issue=$$mark || issue=`expr $$issue + 1`; \
87 sed "s/^\($(TAB)*$*.xml:\).*/\1$$issue/" issue.tmp | sort >> issue.new; \
88 sed "s/@$(issue_number)@/$$issue/" $< | lzma -c > $@
89 sed -n 's/^$(TAB)*$$/break/;1,/^$(TAB)*[^#]/d;/^$(TAB)*#/p' \
90 $(issue_log) >> issue.new
91 rm -f $(issue_log) issue.tmp
92 mv issue.new $(issue_log)
95 # An internal target, to specify a dependency which must always be updated.
98 # $RCSfile$: end of file