mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 18:33:58 +00:00
Estimated hours taken: 6
Fix various invasions of the user's namespace by `mercury_builtin.m',
by splitting mercury_builtin.m into two modules, called builtin.m and
private_builtin.m, and ensuring that the latter is imported as if
by `:- use_module' rather than `:- import_module'.
library/builtin.m:
library/private_builtin.m:
Split mercury_builtin.m into two modules, builtin.m,
which contains stuff intended to be public,
and private_builtin.m, which contains implementation
details that are not supposed to be public.
library/mercury_builtin.m:
Add a comment saying that this module is no longer used, and
should eventually be removed. I have not removed it yet, since
that would prevent bootstrapping with the current compiler. It
will be removed as a seperate change later, once all the
changes have propagated.
compiler/prog_util.m:
Change the definition of mercury_private_builtin_module/1 and
mercury_public_builtin_module so that instead of automatically
importing mercury_builtin.m as if by `import_module', the
copiler will now automatically import builtin.m as if by
`import_module' and private_builtin.m as if by `use_module'.
compiler/polymorphism.m:
Change a call to mercury_private_builtin_module/1 for
unsafe_promise_unique to instead call mercury_public_builtin_module/1.
compiler/unify_proc.m:
Avoid hard-coding "mercury_builtin" by instead
calling one of mercury_{private,public}_builtin_module/1.
runtime/mercury_type_info.[ch]:
library/term.m:
library/std_util.m:
compiler/code_util.m:
Change a few hard-coded instances of "mercury_builtin"
to "builtin" or "private_builtin" as appropriate.
runtime/mercury_trace_util.c:
runtime/mercury_trace_internal.c:
library/prolog.m:
compiler/*.m:
Update comments that refer to "mercury_builtin" to instead
refer to either "builtin" or "private_builtin".
doc/Mmakefile:
Don't include the interface to private_builtin.m in the
library reference manual.
tools/bootcheck:
Add `-p'/`--copy-profiler' option. This is needed to get
the above changes to bootstrap.
tools/test_mercury:
Pass `-p' to tools/bootcheck.
tests/term/*.trans_opt_exp:
s/mercury_builtin/builtin/g
243 lines
6.6 KiB
Plaintext
243 lines
6.6 KiB
Plaintext
#-----------------------------------------------------------------------------#
|
|
# Copyright (C) 1996-1998 The University of Melbourne.
|
|
# This file may only be copied under the terms of the GNU General
|
|
# Public License - see the file COPYING in the Mercury distribution.
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Mmake - Mmake file for the Mercury documentation.
|
|
|
|
MAIN_TARGET=all
|
|
|
|
MERCURY_DIR=..
|
|
include $(MERCURY_DIR)/Mmake.common
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
TEXI2DVI=texi2dvi
|
|
MAKEINFO=makeinfo
|
|
TEXI2HTML=perl texi2html
|
|
TEXI2HTML_SPLIT=perl texi2html -split
|
|
DVIPS=dvips
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
.SUFFIXES: .texi .dvi .ps .text
|
|
|
|
.texi.dvi:
|
|
$(TEXI2DVI) $<
|
|
|
|
.texi.text:
|
|
$(MAKEINFO) --no-headers -o $@ $<
|
|
|
|
.dvi.ps:
|
|
$(DVIPS) $<
|
|
|
|
%.html %_toc.html: %.texi
|
|
$(TEXI2HTML) $<
|
|
|
|
%_1.html: %.texi
|
|
$(TEXI2HTML_SPLIT) $<
|
|
|
|
%.1: ../scripts/% make_manpage
|
|
MERCURY_PROFILER=../profiler/mercury_profile \
|
|
MERCURY_COMPILER=../compiler/mercury_compile \
|
|
MERCURY_MKINIT=../util/mkinit \
|
|
./make_manpage $< > $@
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
.PHONY: all
|
|
all: info dvi html manpages # ps text
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
.PHONY: dvi
|
|
dvi: user_guide.dvi reference_manual.dvi library.dvi faq.dvi \
|
|
transition_guide.dvi
|
|
|
|
.PHONY: info
|
|
info: mercury.info mercury_ref.info mercury_user_guide.info \
|
|
mercury_library.info mercury_faq.info mercury_trans_guide.info
|
|
|
|
.PHONY: html
|
|
html: mercury.html user_guide_toc.html reference_manual_toc.html \
|
|
library_toc.html faq_toc.html transition_guide_toc.html
|
|
|
|
.PHONY: ps
|
|
ps: user_guide.ps reference_manual.ps library.ps faq.ps transition_guide.ps
|
|
|
|
.PHONY: text
|
|
text: user_guide.text reference_manual.text library.text faq.text \
|
|
transition_guide.text
|
|
|
|
.PHONY: split_html
|
|
split_html: mercury.html user_guide_1.html reference_manual_1.html \
|
|
library_1.html faq_1.html transition_guide_1.html
|
|
|
|
.PHONY: manpages
|
|
manpages: c2init.1 mmc.1 mgnuc.1 ml.1 mmake.1 mdb.1 msc.1 mprof.1 \
|
|
mprof_merge_runs.1
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
mercury_user_guide.info: user_guide.texi
|
|
$(MAKEINFO) $<
|
|
mercury_ref.info: reference_manual.texi
|
|
$(MAKEINFO) $<
|
|
mercury_trans_guide.info: transition_guide.texi
|
|
$(MAKEINFO) $<
|
|
mercury_faq.info: faq.texi
|
|
$(MAKEINFO) $<
|
|
mercury_library.info: library.texi
|
|
$(MAKEINFO) $<
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# The following rules automatically build the library documentation
|
|
# by extracting the module interfaces from the library source code.
|
|
# Note that the debugger_interface.m module is just an implementation
|
|
# detail of the library, so it is not documented.
|
|
# Same goes for private_builtin.m.
|
|
|
|
library-menu.texi: $(LIBRARY_DIR)/*.m
|
|
{ \
|
|
echo ""; \
|
|
for filename in $(LIBRARY_DIR)/*.m; do \
|
|
case $$filename in \
|
|
$(LIBRARY_DIR)/debugger_interface.m) \
|
|
;; \
|
|
$(LIBRARY_DIR)/private_builtin.m) \
|
|
;; \
|
|
*) \
|
|
echo "* `basename $$filename .m`::"; \
|
|
;; \
|
|
esac; \
|
|
done; \
|
|
} > library-menu.texi
|
|
|
|
library-chapters.texi: $(LIBRARY_DIR)/*.m
|
|
for filename in $(LIBRARY_DIR)/*.m; do \
|
|
case $$filename in \
|
|
$(LIBRARY_DIR)/debugger_interface.m) \
|
|
;; \
|
|
$(LIBRARY_DIR)/private_builtin.m) \
|
|
;; \
|
|
*) \
|
|
file="`basename $$filename .m`"; \
|
|
echo "@node $$file"; \
|
|
echo "@chapter $$file"; \
|
|
echo "@example"; \
|
|
sed -n -e '/:- implementation/q' \
|
|
-e 's/^%----*----% *$$/%--------------------------------------------------%/' \
|
|
-e 's/@/@@/g' \
|
|
-e 's/{/@{/g' \
|
|
-e 's/}/@}/g' \
|
|
-e 'p' \
|
|
"$$filename"; \
|
|
echo "@end example"; \
|
|
echo ""; \
|
|
;; \
|
|
esac; \
|
|
done > library-chapters.texi
|
|
|
|
library.dvi library_toc.html mercury_library.info: \
|
|
library-menu.texi library-chapters.texi
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
.PHONY: dist
|
|
dist: tar
|
|
|
|
.PHONY: tar
|
|
tar: doc.text.tar.gz doc.ps.tar.gz
|
|
|
|
doc.text.tar.gz: text
|
|
tar -cf - *.text | gzip > doc.text.tar.gz
|
|
|
|
doc.ps.tar.gz: ps
|
|
tar -cf - *.ps | gzip > doc.ps.tar.gz
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
.PHONY: install
|
|
install: install_info install_html install_dvi install_manpages
|
|
# install_text install_ps
|
|
|
|
.PHONY: install_info
|
|
install_info: info
|
|
-[ -d $(INSTALL_INFO_DIR) ] || mkdir -p $(INSTALL_INFO_DIR)
|
|
cp *.info* $(INSTALL_INFO_DIR)
|
|
|
|
.PHONY: install_html
|
|
install_html: html
|
|
-[ -d $(INSTALL_HTML_DIR) ] || mkdir -p $(INSTALL_HTML_DIR)
|
|
cp *.html $(INSTALL_HTML_DIR)
|
|
|
|
.PHONY: install_dvi
|
|
install_dvi: dvi
|
|
-[ -d $(INSTALL_DVI_DIR) ] || mkdir -p $(INSTALL_DVI_DIR)
|
|
cp *.dvi $(INSTALL_DVI_DIR)
|
|
|
|
.PHONY: install_text
|
|
install_text: text
|
|
-[ -d $(INSTALL_TEXT_DIR) ] || mkdir -p $(INSTALL_TEXT_DIR)
|
|
cp *.txt $(INSTALL_TEXT_DIR)
|
|
|
|
.PHONY: install_ps
|
|
install_ps: ps
|
|
-[ -d $(INSTALL_PS_DIR) ] || mkdir -p $(INSTALL_PS_DIR)
|
|
cp *.ps $(INSTALL_PS_DIR)
|
|
|
|
.PHONY: install_manpages
|
|
install_manpages: manpages
|
|
-[ -d $(INSTALL_MAN_DIR)/man1 ] || \
|
|
mkdir -p $(INSTALL_MAN_DIR)/man1
|
|
cp *.1 $(INSTALL_MAN_DIR)/man1
|
|
|
|
# The uninstall rule here only removes the info files; the others
|
|
# are removed by the top-level uninstall rule.
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
-cd $(INSTALL_INFO_DIR); rm mercury*.info*
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# This install is for installing the Mercury webpage, which goes to
|
|
# a different directory (supplied by the environment variable
|
|
# INSTALL_WEBPAGE_DIR).
|
|
|
|
.PHONY: install_webpage
|
|
install_webpage: library-chapters.texi split_html ps
|
|
[ -d $(INSTALL_WEBPAGE_DIR) ] || mkdir -p $(INSTALL_WEBPAGE_DIR)
|
|
cp *.ps $(INSTALL_WEBPAGE_DIR)
|
|
for file in $(INSTALL_WEBPAGE_DIR)/*.ps ; do \
|
|
gzip -f -9 $$file ; \
|
|
done
|
|
cp *.html $(INSTALL_WEBPAGE_DIR)
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
clean: distclean clean_texi
|
|
|
|
.PHONY: distclean
|
|
distclean:
|
|
rm -f *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr
|
|
|
|
.PHONY: clean_texi
|
|
clean_texi:
|
|
rm -f library-menu.texi library-chapters.texi
|
|
|
|
realclean: realclean_texi realclean_manpages
|
|
|
|
.PHONY: realclean_texi
|
|
realclean_texi:
|
|
rm -f library*.html user_guide*.html reference_manual*.html
|
|
rm -f faq*.html transition_guide*.html
|
|
rm -f mercury_*.info* *.dvi *.text *.ps
|
|
|
|
.PHONY: realclean_manpages
|
|
realclean_manpages:
|
|
rm -f *.1
|
|
|
|
#-----------------------------------------------------------------------------#
|