5 PACKAGE_TARNAME = @PACKAGE_TARNAME@
6 PACKAGE_VERSION = @PACKAGE_VERSION@
8 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
9 # Copyright (C) 2009-2013, MinGW.org Project
12 # Makefile template for mingw-get
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.org Project, accept liability for any damages, however caused,
26 # arising from the use of this software.
28 PACKAGE_SUBSYSTEM = @host_os@
30 CLI_RELEASE_CLASS = @CLI_RELEASE_CLASS@
31 GUI_RELEASE_CLASS = @GUI_RELEASE_CLASS@
33 BUILD_TAG = `test -f build.tag && cat build.tag`
34 DEBUGLEVEL = @DEBUGLEVEL@
36 # Establish the appropriate mechanism for invoking 'make' recursively,
37 # WITHOUT incurring the noise of its "Entering directory..." messages.
39 QUIET_MAKE = $(MAKE)@NO_PRINT_DIRECTORY@
42 # Establish source code directory organisation, and set reference
43 # paths for access to source files.
46 abs_top_srcdir = @abs_top_srcdir@
48 vpath %.ico @srcdir@/icons
49 VPATH = @top_srcdir@/src:@top_srcdir@/src/pkginfo:@top_srcdir@/tinyxml
51 # Identify common build tools, and set their default options.
55 CPPFLAGS = @CPPFLAGS@ -D DEBUGLEVEL=$(DEBUGLEVEL) $(INCLUDES)
60 INCLUDES = -I ${srcdir}/src -I ${srcdir}/src/pkginfo -I ${srcdir}/tinyxml
65 # A 'lex' compatible LALR(1) scanner is required for SCM sourced builds,
66 # or if the user modifies any 'lex' source. This AC_PROG_LEX compatible
67 # macro set facilitates the handling of any situation where 'lex' is not
68 # available, but is required to complete the build.
71 LEX_COMMAND = $(LEX) $(LFLAGS) -t $< > $(LEX_OUTPUT)
72 LEX_COMMAND_ABORT = { $(LEX_MISSING); rm -f $(LEX_OUTPUT); exit 2; }
73 LEX_MISSING = (echo; echo $(LEX_MISSING_MESSAGE); echo) | $(FORMAT_MESSAGE)
74 LEX_MISSING_MESSAGE = "I cannot find the program 'lex' on your system; \
75 it is required because you either do not have the file '$@', or you appear \
76 to have modified the file '$<'. If neither of these is the case, then you \
77 may wish to update the time stamp of '$@', so that it appears to be newer \
78 than '$<', before you run make again."
79 LEX_OUTPUT = @LEX_OUTPUT_ROOT@.c
81 # The following macro uses 'awk' to emulate a rudimentary 'nroff' filter,
82 # for formatting notification messages, such as those which are emitted to
83 # report the above "missing 'lex'" condition.
85 FORMAT_MESSAGE = awk '\
86 BEGIN { $(AWK_CLEAR_LINE_BUFFER) }\
87 /^\. *br$$/ { $(AWK_PRINT_AND_CLEAR_BUFFER) }\
88 NF == 0 { $(AWK_COLLECT_BLANK_LINE) }\
89 /^[^.]/ { $(AWK_COLLECT_MESSAGE) }\
90 END { $(AWK_FLUSH_LINE_BUFFER) }'
92 # Establish a default line length for formatting messages.
94 MESSAGE_FOLD_WIDTH = 68
96 # The following macros implement the internals of the message formatter.
98 AWK_CLEAR_LINE_BUFFER = linebuf = "";
99 AWK_FLUSH_LINE_BUFFER = if( linebuf != "" ){ $(AWK_PRINT_AND_CLEAR_BUFFER) }
100 AWK_PRINT_AND_CLEAR_BUFFER = $(AWK_PRINT_LINE_BUFFER) $(AWK_CLEAR_LINE_BUFFER)
101 AWK_COLLECT_MESSAGE = \
102 for( i = 0; i < NF; ) \
103 { if( linebuf == "" ) newbuf = $$++i; else \
104 { newbuf = linebuf; \
105 if( match( linebuf, "[.!?]$$" ) ) newbuf = newbuf " "; \
106 newbuf = newbuf " " $$++i; \
108 if( length( newbuf ) > $(MESSAGE_FOLD_WIDTH) ) \
112 else linebuf = newbuf; \
114 AWK_COLLECT_BLANK_LINE = $(AWK_FLUSH_LINE_BUFFER) $(AWK_PRINT_LINE_BUFFER)
115 AWK_PRINT_LINE_BUFFER = print linebuf;
117 # Identify an appropriate resource compiler, for GUI builds,
118 # and define a set of script macros to propagate the build-time
119 # specific package meta-data into compiled resource modules.
122 RC_SCRIPT = tag_class=$(GUI_RELEASE_CLASS) \
125 VERSION_SCRIPT = tag_class=$(CLI_RELEASE_CLASS) \
128 TAG_SCRIPT = tag=$(BUILD_TAG); \
129 test "x$$tag_class" != x && test "x$$tag" != x && tag="$$tag_class-$$tag"; \
130 test "x$$tag" != x && tag="-$$tag"; \
132 -e "s!%PACKAGE_NAME%!$(PACKAGE_TARNAME)!g" \
133 -e "s!%PACKAGE_VERSION%!$(PACKAGE_VERSION)$$tag!g" \
134 -e "s!%PACKAGE_VERINFO_PRODUCT_VERSION%!`$(PACKAGE_VERINFO_SCRIPT)`!g" \
135 -e "s!%PACKAGE_BASE_DISTNAME%!$(PACKAGE_DISTNAME)$$tag-bin.$(TAREXT)!g" \
136 -e "s!%PACKAGE_GUI_DISTNAME%!$(PACKAGE_DISTNAME)$$tag-gui.$(TAREXT)!g" \
137 -e "s!%PACKAGE_DATA_DISTNAME%!$(SETUP_DISTNAME)$$tag-%s.$(TAREXT)!g" \
138 -e "s!%COPYRIGHT_HOLDER%!@COPYRIGHT_HOLDER@!g" \
139 -e "s!%YEARS_OF_ISSUE%!@YEARS_OF_ISSUE@!g"
141 PACKAGE_VERINFO_SCRIPT = \
142 echo $(PACKAGE_VERSION) | awk -F. '{ \
143 printf "%d, %d, ", $$1, $$2 * 100 + $$3 \
144 }'; (test "x$$tag" = x && date +%Y%m%d-0 || echo $$tag) | awk -F- '{ \
145 DF = NF - 1; printf "%d, %d", (( substr( $$DF, 1, 4 ) - 1970 ) * 16 \
146 + substr( $$DF, 5, 2 )) * 32 + substr( $$DF, 7, 2 ), $$NF \
149 RC_INCLUDES = -I . -I ${srcdir}/src -I ${srcdir}/icons
151 # Specify extensions, and link-time requirements, for binary
152 # package deliverables.
158 GUI_LDFLAGS = -mwindows $(LDFLAGS)
159 LIBS = -Wl,-Bstatic -llua -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
161 # Define the content of package deliverables.
163 CORE_DLL_OBJECTS = climain.$(OBJEXT) pkgshow.$(OBJEXT) dmhcore.$(OBJEXT) \
164 pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \
165 pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \
166 pkgopts.$(OBJEXT) sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) \
167 pkgdeps.$(OBJEXT) pkgreqs.$(OBJEXT) pkginst.$(OBJEXT) pkgunst.$(OBJEXT) \
168 tarproc.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) \
169 tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
170 apihook.$(OBJEXT) mkpath.$(OBJEXT) tinyxmlerror.$(OBJEXT)
173 clistub.$(OBJEXT) version.$(OBJEXT) approot.$(OBJEXT) getopt.$(OBJEXT)
176 guimain.$(OBJEXT) guiexec.$(OBJEXT) dmhguix.$(OBJEXT) \
177 approot.$(OBJEXT) pkgview.$(OBJEXT) pkgtree.$(OBJEXT) pkglist.$(OBJEXT) \
178 pkgdata.$(OBJEXT) pkgnget.$(OBJEXT) guimain.res.$(OBJEXT)
180 GUIMAIN_LIBS = -lwtklite -lcomctl32
182 SETUP_TOOL_OBJECTS = setup.$(OBJEXT) setup.res.$(OBJEXT) apihook.$(OBJEXT)
183 SETUP_TOOL_LIBS = -lwtklite -lwininet -lcomctl32 -lole32 -Wl,-Bstatic -llzma
185 SETUP_DLL_OBJECTS = dllhook.$(OBJEXT)
188 script_srcdir = ${srcdir}/scripts/libexec
190 BIN_PROGRAMS = pkginfo$(EXEEXT) mingw-get$(EXEEXT)
191 LIBEXEC_PROGRAMS = guistub$(EXEEXT) guimain$(EXEEXT) lastrites$(EXEEXT)
192 LIBEXEC_SCRIPTS = ${script_srcdir}/setup.lua ${script_srcdir}/wsh.lua \
193 ${script_srcdir}/shlink.js ${script_srcdir}/unlink.js
194 LIBEXEC_DATA = mingw-get-0.dll
196 # Primary build goals...
198 all: all-core all-setup
199 all-core: $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA)
200 all-setup: all-setup-dll all-setup-exe
201 all-setup-dll: mingw-get-setup-0.dll
204 @$(QUIET_MAKE) CXXFLAGS='$(CXXFLAGS) -Os' mingw-get-setup$(EXEEXT)
206 mingw-get-setup$(EXEEXT): $(SETUP_TOOL_OBJECTS)
207 $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+ $(SETUP_TOOL_LIBS)
209 pkginfo$(EXEEXT): driver.$(OBJEXT) pkginfo.$(OBJEXT)
210 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
212 mingw-get$(EXEEXT): $(CLI_EXE_OBJECTS)
213 $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+
215 guistub$(EXEEXT): guistub.$(OBJEXT) pkgicon.$(OBJEXT)
216 $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+
218 guimain$(EXEEXT): $(GUIMAIN_OBJECTS) $(LIBEXEC_DATA)
219 $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+ $(GUIMAIN_LIBS)
221 lastrites$(EXEEXT): rites.$(OBJEXT)
222 $(CC) -o $@ $(CFLAGS) $(GUI_LDFLAGS) $+
224 mingw-get-0.dll: $(CORE_DLL_OBJECTS)
225 $(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $+ $(LIBS)
227 mingw-get-setup-0.dll: $(SETUP_DLL_OBJECTS) mingw-get-0.dll
228 $(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $+ $(SETUP_DLL_LIBS)
230 # The following recursive invocation hook provides a mechanism for
231 # accessing make's facility for reporting what it is doing, even when
232 # the command to be invoked is encapsulated within a more complex block,
233 # which has been marked for explicit silent execution; usage is:
235 # $(WITH_REQUEST)='command to be executed' execute-command
237 # (with no intervening white space around the assignment operator, and
238 # ensuring that the command to be executed is appropriately quoted).
240 WITH_REQUEST = $(QUIET_MAKE) COMMAND
244 # Compilation and dependency tracking...
247 RC_DEPFLAGS = -MM -MP -MD -MF $*.res.x
252 && { $(QUIET_MAKE) LEX=lex $(@F) || $(LEX_COMMAND_ABORT); } \
253 || $(WITH_REQUEST)='$(LEX_COMMAND)' execute-command
254 @test -f $(LEX_OUTPUT) && test -n "`cat $(LEX_OUTPUT)`" \
255 && $(WITH_REQUEST)='mv $(LEX_OUTPUT) $(@F)' execute-command \
256 || $(WITH_REQUEST)='rm -f $(LEX_OUTPUT)' execute-command
259 $(CC) $(DEPFLAGS) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
262 $(CXX) $(DEPFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
264 %.res.$(OBJEXT): %.rc
265 $(CC) $(RC_DEPFLAGS) $(RC_INCLUDES) -DRC_INVOKED -xc-header $<
266 sed 's,$*\.$(OBJEXT):,$@:,' $*.res.x > $*.res.d; rm -f $*.res.x
267 $(RC_SCRIPT) $< | $(RC) $(RC_INCLUDES) -o $@
270 echo $* ICON $*.ico | $(RC) -I ${srcdir}/icons -o $@
272 # Release tagging; note that, whereas %.time is nominally updated as
273 # a side effect of %.tag, we also must provide an explicit rule which
274 # will update it directly. This ensures that we may INDIRECTLY force
275 # a dependency on the TIME when %.tag is updated, WITHOUT creating an
276 # explicit dependency on %.tag itself.
281 >> $@; tag=`date +%Y%m%d`; \
282 tag=`awk -F- -v today=$$tag ' \
283 BEGIN { tag = 1 } $$1 == today { tag += $$2 } \
284 END { print today "-" tag }' $@`; \
289 $(VERSION_SCRIPT) $< > $@
292 $(VERSION_SCRIPT) $< > $@
294 # The following dependencies must be explicitly declared.
296 guimain.res.$(OBJEXT) setup.res.$(OBJEXT): Makefile build.time verinfo.h
297 verinfo.h version.c: Makefile build.time
299 # Installation tools and directory paths...
301 mkinstalldirs = @MKDIR_P@
304 exec_prefix = @exec_prefix@
305 localstatedir = @localstatedir@
306 libexecdir = @libexecdir@
309 PACKAGE_CONFIG_DIR = ${localstatedir}/lib/${PACKAGE_TARNAME}/data
312 INSTALL_DATA = @INSTALL_DATA@
313 INSTALL_PROGRAM = @INSTALL_PROGRAM@
314 INSTALL_SCRIPT = @INSTALL_SCRIPT@
319 # Installation rules...
322 $(mkinstalldirs) ${bindir}
323 $(mkinstalldirs) ${libexecdir}/${PACKAGE_TARNAME}
324 $(mkinstalldirs) ${PACKAGE_CONFIG_DIR}
326 install: installdirs install-profile
327 for image in $(BIN_PROGRAMS); do \
328 $(INSTALL_PROGRAM) $$image ${bindir}; \
330 for image in $(LIBEXEC_PROGRAMS); do \
331 $(INSTALL_PROGRAM) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
333 for image in $(LIBEXEC_DATA) $(LIBEXEC_SCRIPTS); do \
334 $(INSTALL_DATA) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
338 $(INSTALL_DATA) ${srcdir}/xml/profile.xml \
339 ${PACKAGE_CONFIG_DIR}/defaults.xml
341 install-strip: install
342 for image in $(BIN_PROGRAMS); do \
343 $(STRIP) ${bindir}/$$image; \
345 for image in $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA); do \
346 $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/$$image; \
349 # Packaging and distribution...
350 # "Native" source files, (i.e. those specific to mingw-get), are...
352 LICENCE_FILES = README COPYING
353 SRCDIST_FILES = $(LICENCE_FILES) ChangeLog NEWS INSTALL \
354 aclocal.m4 configure.ac configure Makefile.in
356 # ...plus the entire content of the sub-directories...
358 SRCDIST_SUBDIRS = src src/pkginfo srcdist-doc icons \
359 scripts/libexec tinyxml xml
361 # In addition to the native sources for mingw-get, our source distribution
362 # must include a filtered subset of those additional files which we import
363 # from the project's global build-aux repository...
365 BUILD_AUX_DIRS = build-aux build-aux/m4
366 BUILD_AUX_FILES = config.guess config.sub install-sh missing.m4
368 # The names of distributed package archive files incorporate version
369 # information, derived from PACKAGE_VERSION; this is decomposed, so that
370 # the PACKAGE_SUBSYSTEM may be interposed between the principal version
371 # number and any qualifying suffix, which specifies development status.
372 # Additionally, the package maintainer may specify, (at `make dist' time),
373 # a SNAPSHOT qualifier; if specified, this will be appended, (literally),
374 # to the principal version number component of the package version number,
375 # as it appears in the distributed archive file names.
377 PACKAGE_DISTROOT = $(PACKAGE_TARNAME)-$(PACKAGE_ROOTVERSION)
378 PACKAGE_ROOTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9].*,,'`
379 PACKAGE_DISTVERSION = `echo $(PACKAGE_VERSION)-$(PACKAGE_SUBSYSTEM) | sed \
380 -e 's,-[^0-9],-$(PACKAGE_SUBSYSTEM)&,' \
381 -e 's,\(-$(PACKAGE_SUBSYSTEM).*\)-$(PACKAGE_SUBSYSTEM),\1,' \
382 -e 's,-$(PACKAGE_SUBSYSTEM),$(SNAPSHOT)&,'`
383 PACKAGE_DISTNAME = $(PACKAGE_TARNAME)-$(PACKAGE_DISTVERSION)
385 SETUP_DISTNAME = $(PACKAGE_TARNAME)-setup-$(PACKAGE_DISTVERSION)
387 dist: srcdist bindist readme.txt.dist
389 # Specify where distributable files should be collected; by default,
390 # we will simply use the current build directory.
392 distdir = @abs_builddir@
394 # "Install" distributable text files into the distribution directory.
397 cmp -s $< ${distdir}/$(<F) 2>/dev/null || $(INSTALL_DATA) $< ${distdir}
399 # Specify default compression command, and associated file name extension,
400 # for creation and identification of packaged tar archives.
403 TAREXT = tar.$(TARZIP)
405 # The following macros facilitate the inclusion of SCM build tags within
406 # the generated names for the release tarballs; the GCMTAG macro is used
407 # to identify explicitly GUI components, while SCMTAG is used otherwise.
409 BLDTAG = @abs_top_builddir@/build.tag
410 SCMTAG = `>> $(BLDTAG); cat $(BLDTAG) | sed 's,.,-$(CLI_RELEASE_CLASS)-&,'`
411 GCMTAG = `>> $(BLDTAG); cat $(BLDTAG) | sed 's,.,-$(GUI_RELEASE_CLASS)-&,'`
415 $(mkinstalldirs) ${distdir}
416 $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip
417 cd staged; tar chf - bin/pkginfo$(EXEEXT) | $(TARZIP) -c > \
418 ${distdir}/pkginfo-$(PACKAGE_DISTVERSION)$(SCMTAG)-bin.$(TAREXT)
419 rm staged/bin/pkginfo$(EXEEXT)
420 cd staged; tar chf - libexec/mingw-get/guimain$(EXEEXT) | \
421 $(TARZIP) -c > ${distdir}/$(PACKAGE_DISTNAME)$(GCMTAG)-gui.$(TAREXT)
422 rm staged/libexec/mingw-get/guimain$(EXEEXT)
423 cd staged; tar chf - * | $(TARZIP) -c > \
424 ${distdir}/$(PACKAGE_DISTNAME)$(SCMTAG)-bin.$(TAREXT)
425 cd staged; zip -r ${distdir}/$(PACKAGE_DISTNAME)$(SCMTAG)-bin.zip *
430 $(mkinstalldirs) ${distdir} ./share/doc/${PACKAGE_TARNAME}
431 cd ./share/doc/${PACKAGE_TARNAME}; for file in $(LICENCE_FILES); \
432 do test -f ${abs_top_srcdir}/$$file \
433 && $(LN_S) ${abs_top_srcdir}/$$file . \
434 || $(LN_S) ${CURDIR}/$$file .; \
436 tar chf - share | $(TARZIP) -c > \
437 ${distdir}/$(PACKAGE_DISTNAME)$(SCMTAG)-lic.$(TAREXT)
440 srcdist: srcdist-doc pkginfo.c
441 rm -rf ${PACKAGE_DISTROOT}
442 $(mkinstalldirs) ${distdir} ${PACKAGE_DISTROOT}
443 cd ${PACKAGE_DISTROOT}; for file in $(SRCDIST_FILES); do \
444 test -f ${abs_top_srcdir}/$$file \
445 && $(LN_S) ${abs_top_srcdir}/$$file . \
446 || $(LN_S) ../$$file .; \
448 for dir in $(SRCDIST_SUBDIRS); do \
449 $(mkinstalldirs) ${PACKAGE_DISTROOT}/$$dir \
450 && cd ${PACKAGE_DISTROOT}/$$dir; \
451 for file in `cd ${abs_top_srcdir}/$$dir && echo *`; do \
452 if test -f ${abs_top_srcdir}/$$dir/$$file; then \
453 $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
457 for dir in $(BUILD_AUX_DIRS); do \
458 $(mkinstalldirs) ${PACKAGE_DISTROOT}/$$dir \
459 && cd ${PACKAGE_DISTROOT}/$$dir; \
460 for file in $(BUILD_AUX_FILES); do \
461 if test -f ${abs_top_srcdir}/$$dir/$$file; then \
462 $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
466 cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/pkginfo.c .
467 tar chf - ${PACKAGE_DISTROOT} | $(TARZIP) -c > \
468 ${distdir}/$(PACKAGE_DISTNAME)$(SCMTAG)-src.$(TAREXT)
469 rm -rf ${PACKAGE_DISTROOT}
471 # README, INSTALL and NEWS files to be included in the source distribution
472 # are generated on demand, as indirect side effects of a set of phoney goals
473 # so that they are always regenerated for each distribution, from templates
474 # in srcdist-doc so that we can make them version specific.
476 vpath %.in ${srcdir}/srcdist-doc
477 srcdist-doc: README.dist NEWS.dist INSTALL.dist
479 # We need to ensure that, when we invoke nroff, the generated output
480 # will be suited to an ASCII class of typesetter; without the -Tascii
481 # option, GNU nroff will substitute Unicode hyphens (u2010) in place
482 # of ASCII hyphens (code 45).
484 NROFF = nroff -Tascii
486 %.dist: %.in gendoc.simple.sed
487 sed -f gendoc.simple.sed $< | $(NROFF) > $*
489 %.simple.sed: %.sed.in
490 sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
491 -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", $< > $@
493 %.combined.sed: %.sed.in
494 sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
495 -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", \
496 -e s,'^# *cut:',, $< > $@
498 # The following rules use sed and awk to match the RCS Id keyword;
499 # we define and use the following macro, in the form "$(DOLLAR)Id:",
500 # to avoid unwanted substitution on CVS checkout.
504 # The following rule provides a mechanism for generating a composite from
505 # README, INSTALL and NEWS, for use as an on-line package description.
507 readme.txt: gendoc.combined.sed readme.txt.tag readme.txt.in
508 sed s,'$(DOLLAR)Id:.*',"`cat $@.tag`", $@.in > $@
509 echo '$$Document: $@ $$: end of file' >> $@
510 rm -f gendoc.combined.sed $@.*
512 # There should be a new generation of readme.txt for each package release;
513 # since each release should also include an updated NEWS file; we adopt the
514 # ID tag-line from NEWS.in, as most the appropriate template for generation
515 # of a corresponding tag-line for readme.in
517 readme.txt.tag: NEWS.in
518 awk '/\$(DOLLAR)Id:/{ $$2 = "readme.txt\\,v"; print }' $^ > $@
520 # The tag-line generated by the preceding rule may then be substituted, by
521 # the primary readme.txt generation rule above, into the document template
522 # generated by the following rule
524 readme.txt.in: README.in NEWS.in INSTALL.in
526 for input in $^; do \
527 sed -f gendoc.combined.sed $$input | $(NROFF) >> $@; \
530 # Workspace clean-up...
533 rm -f *.$(OBJEXT) *.d *.dll $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS)
536 rm -f config.* version.c build.tag build.time
538 maintainer-clean: distclean
539 rm -f README NEWS INSTALL readme.txt Makefile pkginfo.c
540 rm -f *-$(PACKAGE_DISTVERSION)-*.tar.* *-$(PACKAGE_DISTVERSION)-*.zip
541 rm -rf ${PACKAGE_DISTROOT} staged ${srcdir}/autom4te.cache
543 # $RCSfile$: end of file