diff --git a/doc/Mmakefile b/doc/Mmakefile index 90cf4e03b..a557c332f 100644 --- a/doc/Mmakefile +++ b/doc/Mmakefile @@ -1,3 +1,4 @@ +# vim: ts=8 sw=8 noet #-----------------------------------------------------------------------------# # Copyright (C) 1996-2007, 2009-2012 The University of Melbourne. # This file may only be copied under the terms of the GNU General @@ -228,9 +229,17 @@ mdb_doc: generate_mdb_doc mercury_user_guide.info mdb_categories mdb_command_list: generate_mdb_command_list mdb_doc ./generate_mdb_command_list < mdb_doc > mdb_command_list + -@if test `wc -l < mdb_command_list` -lt 100; then \ + echo "There was a problem when creating mdb_command_list"; \ + exit 1; \ + fi mdb_command_test.inp: generate_mdb_command_test mdb_doc ./generate_mdb_command_test < mdb_doc > mdb_command_test.inp + -@if test `wc -l < mdb_command_test.inp` -lt 100; then \ + echo "There was a problem when creating mdb_command_test.inp"; \ + exit 1; \ + fi #-----------------------------------------------------------------------------# @@ -433,11 +442,11 @@ install_webpage: library-chapters.texi_pp split_html ps pdf -[ -d $(INSTALL_WEBPAGE_DIR) ] || mkdir -p $(INSTALL_WEBPAGE_DIR) ( \ . ../VERSION; \ - if [ "$$VERSION" = DEV ]; then \ + if [ "$$VERSION" = DEV ]; then \ echo "Set the version before you build the website"; \ exit 1; \ fi; \ - ) + ) cp *.ps $(INSTALL_WEBPAGE_DIR) cp *.pdf $(INSTALL_WEBPAGE_DIR) for file in $(INSTALL_WEBPAGE_DIR)/*.ps ; do \ diff --git a/doc/generate_mdb_doc b/doc/generate_mdb_doc index 95b42365c..55ed68fb1 100755 --- a/doc/generate_mdb_doc +++ b/doc/generate_mdb_doc @@ -1,4 +1,5 @@ #!/bin/sh +# vim: sw=4 ts=8 et #---------------------------------------------------------------------------# # Copyright (C) 1998-1999,2002, 2004-2006 The University of Melbourne. # This file may only be copied under the terms of the GNU General @@ -9,36 +10,39 @@ cat mdb_categories > mdb_doc tmp="mdb_doc_tmp.$$" -trap 'rm -f $tmp' 0 1 2 3 15 +trap 'rm -f ${tmp}' 0 1 2 3 15 -info -f ./mercury_user_guide.info -o $tmp -n "Mercury debugger concepts" -../util/info_to_mdb concepts $tmp >> mdb_doc +info -f ./mercury_user_guide.info -o ${tmp} \ + -n "Mercury debugger concepts" +../util/info_to_mdb concepts ${tmp} >> mdb_doc # Document the declarative debugger. -info -f ./mercury_user_guide.info -o $tmp -n "Declarative debugging overview" +info -f ./mercury_user_guide.info -o ${tmp} \ + -n "Declarative debugging overview" echo "document concepts 10 decl_debug" >> mdb_doc -sed 's/^ //' < $tmp | sed -n '6,1000s/^/ /p' >> mdb_doc +sed 's/^ //' < ${tmp} | sed -n '6,1000s/^/ /p' >> mdb_doc echo >> mdb_doc -info -f ./mercury_user_guide.info -o $tmp -n "Declarative debugging commands" -echo "The following commands are available from within the \ -declarative debugger:" `./commands $tmp` | \ -fold -w72 -s | sed "s/^/ /" >> mdb_doc +info -f ./mercury_user_guide.info -o ${tmp} \ + -n "Declarative debugging commands" +echo "The following commands are available from within the" \ + "declarative debugger:" `./commands ${tmp}` | \ + fold -w72 -s | sed "s/^/ /" >> mdb_doc echo end >> mdb_doc -../util/info_to_mdb decl $tmp >> mdb_doc +../util/info_to_mdb decl ${tmp} >> mdb_doc debug_cmd_path="debug debugger" for section in interactive forward backward browsing breakpoint \ - i/o parameter help declarative misc exp developer + i/o parameter help declarative misc exp developer do - case $section in - interactive) category=queries ;; - i/o) category=io_tabling ;; - declarative) category=mdb_dd ;; - *) category=$section ;; - esac - info -f ./mercury_user_guide.info -o $tmp $debug_cmd_path $section - ../util/info_to_mdb $category $tmp >> mdb_doc + case ${section} in + interactive) category=queries ;; + i/o) category=io_tabling ;; + declarative) category=mdb_dd ;; + *) category=$section ;; + esac + info -f ./mercury_user_guide.info -o ${tmp} ${debug_cmd_path} ${section} + ../util/info_to_mdb ${category} ${tmp} >> mdb_doc done -mv mdb_doc $tmp -./squeeze < $tmp > mdb_doc +mv mdb_doc ${tmp} +./squeeze < ${tmp} > mdb_doc diff --git a/tools/bootcheck b/tools/bootcheck index df23b8610..a744d4793 100755 --- a/tools/bootcheck +++ b/tools/bootcheck @@ -1473,6 +1473,8 @@ fi #-----------------------------------------------------------------------------# +mdb_command_test_inp_status=0 + if test "$runtests" = "true" -o "$extras" = "true" then # Use everything from stage 2, unless the options say that the tests @@ -1559,7 +1561,16 @@ then /bin/rm ${tests_prefix}tests/Mmake.params > /dev/null 2>&1 fi - cp $root/doc/mdb_command_test.inp ${tests_prefix}tests/debugger + if cmp \ + ${root}/doc/mdb_command_test.inp \ + ${tests_prefix}tests/debugger/mdb_command_test.inp + then + true + else + mdb_command_test_inp_status=1 + fi + + cp ${root}/doc/mdb_command_test.inp ${tests_prefix}tests/debugger sed -e "s:@WORKSPACE@:$WORKSPACE:" \ < ${tests_prefix}tests/WS_FLAGS.ws \ @@ -1829,6 +1840,14 @@ then exitstatus=1 fi +if test "$mdb_command_test_inp_status" != 0 +then + + echo "error exit: unexpected change in" \ + "${tests_prefix}tests/debugger/mdb_command_test.inp" + exitstatus=1 +fi + if test "$test_status" != 0 then echo "error exit: some tests failed" diff --git a/util/Mmakefile b/util/Mmakefile index 80ba6d2f9..f1549cde5 100644 --- a/util/Mmakefile +++ b/util/Mmakefile @@ -1,3 +1,4 @@ +# vim: ts=8 sw=8 noexpandtab #-----------------------------------------------------------------------------# # Copyright (C) 1995-2002, 2005, 2006-2007, 2010, 2012 The University of Melbourne. # This file may only be copied under the terms of the GNU General @@ -28,7 +29,6 @@ PROGS=mkinit mkinit_erl mdemangle mfiltercc info_to_mdb PROGFILENAMES=$(PROGS:%=%$(EXT_FOR_EXE)) SRC=$(PROGS:%=%.c) - # Only if getopt.h doesn't exist do we link in a version of getopt. ifeq ("$(GETOPT_H_AVAILABLE)","no") GETOPT_SRC=$(RUNTIME_DIR)/GETOPT/getopt.c $(RUNTIME_DIR)/GETOPT/getopt1.c diff --git a/util/info_to_mdb.c b/util/info_to_mdb.c index e7de1c8e9..b63d6b4d7 100644 --- a/util/info_to_mdb.c +++ b/util/info_to_mdb.c @@ -174,7 +174,7 @@ is_command(const char *line, MR_bool *is_concept) int len; len = strlen(line); - if ((line[0] == '`') && (line[len-2] == '\'')) { + if (((line[0] == '`') || (line[0] == '\'')) && (line[len-2] == '\'')) { *is_concept = MR_FALSE; return MR_TRUE; } else if ((line[0] == '_') && (line[len-2] == '_')) {