diff --git a/doc/Mmakefile b/doc/Mmakefile index 5854d18a4..b92aeedc7 100644 --- a/doc/Mmakefile +++ b/doc/Mmakefile @@ -38,21 +38,20 @@ mmc.1: ../compiler/handle_options.m ../compiler/options.m mprof.1: ../profiler/mercury_profile.m ../profiler/options.m # This variable specifies the (top-level) TexInfo files. -# The mapping of these names to `.info' file names is not regular, -# so we also need to specify the names of the `.info' files. TEXINFO_FILES = \ - user_guide \ - reference_manual \ - library \ - faq \ - transition_guide -TEXINFO_INFO_FILES = \ - mercury_ref.info \ - mercury_user_guide.info \ - mercury_library.info \ - mercury_faq.info \ - mercury_trans_guide.info + mercury_user_guide \ + mercury_reference_manual \ + mercury_library_manual \ + mercury_faq \ + mercury_transition_guide +# The old names of the TEXINFO_INFO_FILES: +# mercury_user_guide.info +# mercury_ref.info +# mercury_library.info +# mercury_faq.info +# mercury_trans_guide.info +TEXINFO_INFO_FILES = $(patsubst %,%.info,$(TEXINFO_FILES)) # The following variables specify which programs should be used to # to format the documentation. @@ -141,11 +140,11 @@ mercury.html: mercury.html.in ../VERSION mercury.info: mercury.info.in ../VERSION $(SED_CMD) -# user_guide.texi_pp @includes ug_invocation.texi, so all targets -# that want to process user_guide.texi must make user_guide.texi first. -# user_guide.texi_pp is the only such *direct* target; all the others -# go through it. -user_guide.texi_pp: ug_invocation.texi +# mercury_user_guide.texi_pp @includes ug_invocation.texi, so all targets +# that want to process mercury_user_guide.texi must make ug_invocation.texi +# first. mercury_user_guide.texi_pp is the only such *direct* target; +# all the others go through it. +mercury_user_guide.texi_pp: ug_invocation.texi # The rule for ug_invocation.texi_date compares any existing # file ug_invocation.texi against its "new" intended contents, and @@ -207,18 +206,14 @@ ug_invocation.texi_date: $(UG_INVOCATION_DEP) fi @date > ug_invocation.texi_date -.PHONY: new_opts -new_opts: user_guide.texi update_opts ../compiler/mercury_compile - ./update_opts - #-----------------------------------------------------------------------------# # Currently `mmake all' does not build the PostScript, PDF or plain-text # versions of the documentation. Nor does it build the formatted versions # of the man pages. But it might make sense to add them. .PHONY: all -all: $(INFOPAGES) $(DVI) $(HTML) manpages $(MDB_DOC) -#all: ps pdf text formatted_manpages +all: $(INFOPAGES) $(DVI) $(HTML) pdf manpages $(MDB_DOC) +# all: ps text formatted_manpages #-----------------------------------------------------------------------------# @@ -279,37 +274,22 @@ help: $(MANPAGE_PROGS:%=%.help) #-----------------------------------------------------------------------------# -mercury_user_guide.info: user_guide.texi_pp - "$(MAKEINFO)" --no-split $< -mercury_ref.info: reference_manual.texi_pp - "$(MAKEINFO)" --no-split $< -mercury_trans_guide.info: transition_guide.texi_pp - "$(MAKEINFO)" --no-split $< -mercury_faq.info: faq.texi_pp - "$(MAKEINFO)" --no-split $< -mercury_library.info: library.texi_pp +%.info: %.texi_pp "$(MAKEINFO)" --no-split $< -mercury_user_guide.html: user_guide.texi_pp - $(TEXI2HTML) $< -mercury_ref.html: reference_manual.texi_pp - $(TEXI2HTML) $< -mercury_trans_guide.html: transition_guide.texi_pp - $(TEXI2HTML) $< -mercury_faq.html: faq.texi_pp - $(TEXI2HTML) $< -mercury_library.html: library.texi_pp +%.html: %.texi_pp $(TEXI2HTML) $< -mercury_user_guide/index.html: user_guide.texi_pp +# XXX Why is one, and only one, of these files split by chapter? +mercury_user_guide/index.html: mercury_user_guide.texi_pp $(TEXI2HTML_SPLIT) $< -mercury_ref/index.html: reference_manual.texi_pp +mercury_reference_manual/index.html: mercury_reference_manual.texi_pp $(TEXI2HTML_SPLIT) --split=chapter --no-headers $< -mercury_trans_guide/index.html: transition_guide.texi_pp +mercury_transition_guide/index.html: mercury_transition_guide.texi_pp $(TEXI2HTML_SPLIT) $< -mercury_faq/index.html: faq.texi_pp +mercury_faq/index.html: mercury_faq.texi_pp $(TEXI2HTML_SPLIT) $< -mercury_library/index.html: library.texi_pp +mercury_library_manual/index.html: mercury_library_manual.texi_pp $(TEXI2HTML_SPLIT) $< #-----------------------------------------------------------------------------# @@ -341,18 +321,18 @@ mdb_command_test.inp: generate_mdb_command_test mdb_doc # The following rules automatically build the library documentation # by extracting the module interfaces from the library source code. -# Note that some modules are just implementation details of the library, -# so they are not documented. +# Note that some modules are just implementation details of the Mercury +# system, so they are not documented. -library-menu.texi_pp: ../VERSION $(LIBRARY_DIR)/*.m +mercury_library_menu.texi_pp: ../VERSION $(LIBRARY_DIR)/*.m { \ echo ""; \ for filename in `cat $(LIBRARY_DIR)/MODULES_DOC`; do \ echo "* `basename $$filename .m`::"; \ done; \ - } > library-menu.texi_pp + } > mercury_library_menu.texi_pp -library-chapters.texi_pp: ../VERSION $(LIBRARY_DIR)/*.m +mercury_library_chapters.texi_pp: ../VERSION $(LIBRARY_DIR)/*.m for filename in `cat $(LIBRARY_DIR)/MODULES_DOC`; do \ file="`basename $$filename .m`"; \ echo "@node $$file"; \ @@ -369,12 +349,14 @@ library-chapters.texi_pp: ../VERSION $(LIBRARY_DIR)/*.m $(LIBRARY_DIR)/"$$filename"; \ echo "@end example"; \ echo ""; \ - done > library-chapters.texi_pp + done > mercury_library_chapters.texi_pp -library.dvi_log library_toc.html library_1.html mercury_library.info \ - mercury_library.html mercury_library/index.html \ - library.dvi: \ - library-menu.texi_pp library-chapters.texi_pp +mercury_library_manual.dvi_log \ + mercury_library_manual.info \ + mercury_library_manual.html \ + mercury_library_manual/index.html \ + mercury_library_manual.dvi: \ + mercury_library_menu.texi_pp mercury_library_chapters.texi_pp #-----------------------------------------------------------------------------# @@ -395,7 +377,7 @@ doc.ps.tar.gz: ps # Currently `mmake all' does not build the PostScript or plain-text versions # of the documentation. If they are added they should be installed here. .PHONY: install -install: install_info install_html install_dvi install_manpages \ +install: install_info install_html install_dvi install_pdf install_manpages \ install_mdb_doc # install_text install_ps @@ -422,7 +404,7 @@ install_info: $(INFOPAGES) install_dirs .PHONY: warn_no_install_info warn_no_install_info: # Warning: Unable to install .info files. - # This is probably due to a missing `install-info' + # This is probably due to a missing `install-info'. .PHONY: install_html install_html: $(HTML) install_dirs @@ -456,6 +438,10 @@ install_mdb_doc: $(MDB_DOC) install_dirs # The uninstall rule here only removes the info files; the others # are removed by the top-level uninstall rule. +# +# XXX What is the reason for this split, or indeed for any other split? +# +# XXX We also remove man pages here. .PHONY: uninstall uninstall: -cd $(INSTALL_INFO_DIR); rm -f mercury*.info* @@ -468,7 +454,7 @@ uninstall: # INSTALL_WEBPAGE_DIR). .PHONY: install_webpage -install_webpage: library-chapters.texi_pp split_html ps pdf +install_webpage: mercury_library_chapters.texi_pp split_html ps pdf -test -d $(INSTALL_WEBPAGE_DIR) || mkdir -p $(INSTALL_WEBPAGE_DIR) ( \ . ../VERSION; \ @@ -502,19 +488,21 @@ realclean_local: distclean clean_texi: rm -f *.aux *.cp *.cps *.fn *.ky *.log *.pg *.toc *.tp *.vr rm -f *.dvi *.dvi_log *.pdf *.pdf_log *.ps *.ps_log *.text - rm -f library*.html user_guide*.html reference_manual*.html - rm -f faq*.html transition_guide*.html + rm -f library*.html mercury_library_manual*.html + rm -f mercury_user_guide*.html mercury_reference_manual*.html + rm -f mercuy_faq*.html mercuy_transition_guide*.html rm -f mercury.html mercury.info rm -f mercury_*.info* - rm -f mercury_faq.html mercury_library.html mercury_ref.html \ - mercury_trans_guide.html mercury_user_guide.html + rm -f mercury_faq.html mercury_library_manual.html \ + mercury_reference_manual.html \ + mercury_transition_guide.html mercury_user_guide.html rm -f ug_invocation.texi_date ug_invocation.texi rm -rf $(TEXINFO_INFO_FILES:%.info=%) .PHONY: clean_text_files clean_text_files: rm -f mdb_command_list mdb_command_test.inp mdb_doc - rm -f library-menu.texi library-chapters.texi *.texi_pp + rm -f mercury_library_menu.texi mercury_library_chapters.texi *.texi_pp .PHONY: clean_manpages clean_manpages: diff --git a/doc/mercury.html.in b/doc/mercury.html.in index 3bba61b91..85d3cfb9f 100644 --- a/doc/mercury.html.in +++ b/doc/mercury.html.in @@ -9,10 +9,10 @@

Mercury documentation, version

diff --git a/doc/mercury.info.in b/doc/mercury.info.in index e5bdf89fb..452401236 100644 --- a/doc/mercury.info.in +++ b/doc/mercury.info.in @@ -12,10 +12,10 @@ Mercury Documentation, version * Menu: -* Language Reference Manual: (mercury_ref). +* Language Reference Manual: (mercury_reference_manual). * User's Guide: (mercury_user_guide). -* Library Reference Manual: (mercury_library). -* Prolog to Mercury Transition Guide: (mercury_trans_guide). +* Library Reference Manual: (mercury_library_manual). +* Prolog to Mercury Transition Guide: (mercury_transition_guide). * Frequently Asked Questions: (mercury_faq). See also the Mercury WWW home page . diff --git a/doc/faq.texi b/doc/mercury_faq.texi similarity index 100% rename from doc/faq.texi rename to doc/mercury_faq.texi diff --git a/doc/library.texi b/doc/mercury_library_manual.texi similarity index 95% rename from doc/library.texi rename to doc/mercury_library_manual.texi index f04bd63ac..f2d3b250a 100644 --- a/doc/library.texi +++ b/doc/mercury_library_manual.texi @@ -1,11 +1,11 @@ \input texinfo -@setfilename mercury_library.info +@setfilename mercury_library_manual.info @settitle The Mercury Library Reference Manual @c vim: ts=4 sw=4 expandtab ft=texinfo @dircategory The Mercury Programming Language @direntry -* Mercury Library: (mercury_library). The Mercury Library Reference Manual. +* Mercury Library: (mercury_library_manual). The Mercury Library Reference Manual. @end direntry @c @smallbook @@ -104,7 +104,7 @@ modules whose stability is described as either ``medium to high'' or ``high''. @menu -@include library-menu.texi_pp +@include mercury_library_menu.texi_pp @end menu -@include library-chapters.texi_pp +@include mercury_library_chapters.texi_pp @bye diff --git a/doc/reference_manual.texi b/doc/mercury_reference_manual.texi similarity index 99% rename from doc/reference_manual.texi rename to doc/mercury_reference_manual.texi index d94f19bdb..014c976aa 100644 --- a/doc/reference_manual.texi +++ b/doc/mercury_reference_manual.texi @@ -1,11 +1,11 @@ \input texinfo -@setfilename mercury_ref.info +@setfilename mercury_reference_manual.info @settitle The Mercury Language Reference Manual @c vim: ts=4 sw=4 expandtab ft=texinfo @dircategory The Mercury Programming Language @direntry -* Mercury Language: (mercury_ref). The Mercury Language Reference Manual. +* Mercury Language: (mercury_reference_manual). The Mercury Language Reference Manual. @end direntry @c @smallbook diff --git a/doc/transition_guide.texi b/doc/mercury_transition_guide.texi similarity index 99% rename from doc/transition_guide.texi rename to doc/mercury_transition_guide.texi index a1ea3284e..be3a5d4b2 100644 --- a/doc/transition_guide.texi +++ b/doc/mercury_transition_guide.texi @@ -1,11 +1,11 @@ \input texinfo -@setfilename mercury_trans_guide.info +@setfilename mercury_transition_guide.info @settitle The Prolog to Mercury transition guide @c vim: ts=4 sw=4 expandtab ft=texinfo @dircategory The Mercury Programming Language @direntry -* Mercury Transition Guide: (mercury_trans_guide). The Prolog to Mercury Transition Guide. +* Mercury Transition Guide: (mercury_transition_guide). The Prolog to Mercury Transition Guide. @end direntry @c @smallbook diff --git a/doc/user_guide.texi b/doc/mercury_user_guide.texi similarity index 99% rename from doc/user_guide.texi rename to doc/mercury_user_guide.texi index 6ec948698..7dcc1c494 100644 --- a/doc/user_guide.texi +++ b/doc/mercury_user_guide.texi @@ -1178,7 +1178,7 @@ the update to the constraint store must be undone. This is why in the right grades, Mercury can support a trail. @c XXX CHECKME (@pxref{Trailing, , , -mercury_ref,The Mercury language Reference Manual}). +mercury_reference_manual,The Mercury language Reference Manual}). The trail is a stack-like data structure that consists of a sequence of entries, each of which effectively describes how to undo an update to a data structure. @@ -1242,7 +1242,7 @@ most of which must be explicit enabled for each procedure that are intended to apply to @c XXX CHECKME (@pxref{Tabled evaluation, , , -mercury_ref,The Mercury language Reference Manual}). +mercury_reference_manual,The Mercury language Reference Manual}). (Recall that a @dfn{procedure} is one mode of a predicate or function.) Tabling operates by recording (in a table, hence the name), for each vector of input values to a procedure, diff --git a/doc/update_opts b/doc/update_opts deleted file mode 100755 index f29c5ad9d..000000000 --- a/doc/update_opts +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# vim: sw=4 ts=4 et ft=sh - -# This script replaces the body of the Invocation chapter of the User's Guide -# with the texinfo version of the mmc help text. -# -# It is here in a separate shell script because including a dollar sign -# in the last invocation of sed below is unreasonably hard when the -# command is in an action in a makefile, given that we actually want -# the two characters $ and w, not the value of a shell or make variable -# named w. -cp user_guide.texi USER_GUIDE_TEXI_OLD -/bin/rm -f USER_GUIDE_TEXI_START USER_GUIDE_TEXI_END > /dev/null 2>&1 -/bin/rm -f INVOCATION_OLD0 INVOCATION_OLD INVOCATION_NEW > /dev/null 2>&1 -echo > INVOCATION_NEW -../compiler/mercury_compile --help-texinfo \ - --no-mercury-stdlib-dir \ - --config-file ../scripts/Mercury.config \ - >> INVOCATION_NEW -echo >> INVOCATION_NEW -sed -e '1,/INCLUDE_HELP_TEXT_START/w USER_GUIDE_TEXI_START' \ - < user_guide.texi > /dev/null 2>&1 -sed -e '/INCLUDE_HELP_TEXT_START/,/INCLUDE_HELP_TEXT_END/w INVOCATION_OLD0' \ - < user_guide.texi > /dev/null 2>&1 -sed -e '/INCLUDE_HELP_TEXT/d' < INVOCATION_OLD0 > INVOCATION_OLD -sed -e '/INCLUDE_HELP_TEXT_END/,$w USER_GUIDE_TEXI_END' \ - < user_guide.texi > /dev/null 2>&1 -cat USER_GUIDE_TEXI_START INVOCATION_NEW USER_GUIDE_TEXI_END \ - > user_guide.texi.new -mv -f user_guide.texi.new user_guide.texi -/bin/rm -f USER_GUIDE_TEXI_START USER_GUIDE_TEXI_END > /dev/null 2>&1 -/bin/rm -f INVOCATION_OLD0 > /dev/null 2>&1 - -diff -u INVOCATION_OLD INVOCATION_NEW > INVOCATION_DIFF -diff -u USER_GUIDE_TEXI_OLD user_guide.texi > USER_GUIDE_TEXI_DIFF - -echo "The diff to invocation chapter is in INVOCATION_DIFF." -echo "The diff to user_guide.texi is in USER_GUIDE_TEXI_DIFF." -exit 0