Files
mercury/scripts/Mmakefile
Fergus Henderson c5a69daae3 Add support for debugging Mercury code using mdb to "Gud",
Estimated hours taken: 16

Add support for debugging Mercury code using mdb to "Gud",
the Emacs "Grand Unified Debugger".  This lets you run mdb
under emacs, using the tags file provided by `mtags --emacs'
for source code linking.

scripts/gud.el:
	Add support for Mercury.

Mmake.common.in:
scripts/Mmakefile:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
	Modify the installation scripts to install gud.el in
	.../lib/mercury/elisp.

.INSTALL.in:
bindist/bindist.INSTALL:
	Document what you need to add to your ~/.emacs file to
	use the Emacs mdb interface.
1998-12-21 11:34:00 +00:00

113 lines
3.7 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 scripts
MAIN_TARGET=all
MERCURY_DIR=..
include $(MERCURY_DIR)/Mmake.common
#-----------------------------------------------------------------------------#
SCRIPTS = mmake mmc mdb c2init mgnuc ml mprof mprof_merge_runs \
sicstus_conv mtags vpath_find mercury_update_interface \
mkfifo_using_mknod
DEBUGGER_SCRIPTS = mdbrc
EMACS_SCRIPTS = gud.el
NUPROLOG_SCRIPTS = mnc mnl mnp
SICSTUS_SCRIPTS = msc msl msp
#-----------------------------------------------------------------------------#
.SUFFIXES: .in
.in:
CONFIG_FILES=$@ CONFIG_HEADERS= $(MERCURY_DIR)/config.status
# check to ensure there were no mispelt autoconf variable names
if grep -n '[^$$]@' $@; then false; else true; fi
#-----------------------------------------------------------------------------#
.PHONY: all
all: $(SCRIPTS) $(DEBUGGER_SCRIPTS) $(EMACS_SCRIPTS)
all: $(NUPROLOG_SCRIPTS) $(SICSTUS_SCRIPTS) Mmake.vars
#-----------------------------------------------------------------------------#
ml mgnuc: init_grade_options.sh-subr
ml mgnuc: parse_grade_options.sh-subr
ml mgnuc: final_grade_options.sh-subr
#-----------------------------------------------------------------------------#
.PHONY: install
install: install_mmake install_scripts install_debugger_scripts
install: $(INSTALL_NUPROLOG) $(INSTALL_SICSTUS)
.PHONY: install_mmake
install_mmake: Mmake.vars Mmake.rules
[ -d $(INSTALL_LIBDIR)/mmake ] || mkdir -p $(INSTALL_LIBDIR)/mmake
rm -f $(INSTALL_LIBDIR)/mmake/Mmake.vars
cp `vpath_find Mmake.vars Mmake.rules` $(INSTALL_LIBDIR)/mmake
.PHONY: install_scripts
install_scripts: $(SCRIPTS)
[ -d $(INSTALL_BINDIR) ] || mkdir -p $(INSTALL_BINDIR)
# we remove the installed `mmake' script before (re)installing it
# to avoid overwriting the script while it is running
-rm -f $(INSTALL_BINDIR)/mmake
cp $(SCRIPTS) $(INSTALL_BINDIR)
for file in $(SCRIPTS); do \
chmod u+w $(INSTALL_BINDIR)/$$file ;\
done
.PHONY: install_emacs_scripts
install_emacs_scripts: $(EMACS_SCRIPTS) install_libdir
[ -d $(INSTALL_ELISP_DIR) ] || mkdir -p $(INSTALL_ELISP_DIR)
cp $(EMACS_SCRIPTS) $(INSTALL_ELISP_DIR)
.PHONY: install_debugger_scripts
install_debugger_scripts: $(DEBUGGER_SCRIPTS)
[ -d $(INSTALL_LIBDIR)/mdb ] || mkdir -p $(INSTALL_LIBDIR)/mdb
cp $(DEBUGGER_SCRIPTS) $(INSTALL_LIBDIR)/mdb
.PHONY: install_nuprolog
install_nuprolog: $(NUPROLOG_SCRIPTS)
[ -d $(INSTALL_BINDIR) ] || mkdir -p $(INSTALL_BINDIR)
cp $(NUPROLOG_SCRIPTS) $(INSTALL_BINDIR)
for file in $(NUPROLOG_SCRIPTS); do \
chmod u+w $(INSTALL_BINDIR)/$$file ;\
done
.PHONY: install_sicstus
install_sicstus: $(SICSTUS_SCRIPTS)
[ -d $(INSTALL_BINDIR) ] || mkdir -p $(INSTALL_BINDIR)
cp $(SICSTUS_SCRIPTS) $(INSTALL_BINDIR)
for file in $(SICSTUS_SCRIPTS); do \
chmod u+w $(INSTALL_BINDIR)/$$file ;\
done
#-----------------------------------------------------------------------------#
.PHONY: uninstall
uninstall:
-rm -r $(INSTALL_LIBDIR)/mmake
-cd $(INSTALL_BINDIR) && \
rm $(SCRIPTS) $(SICSTUS_SCRIPTS) $(NUPROLOG_SCRIPTS)
-cd $(INSTALL_LIBDIR)/mdb && rm $(DEBUGGER_SCRIPTS)
#-----------------------------------------------------------------------------#
realclean: clean_scripts
.PHONY: clean_scripts
clean_scripts:
for file in *.in; do rm -f `basename $$file .in`; done
#-----------------------------------------------------------------------------#