[m-rev.] diff: fix github issue #34
Julien Fischer
jfischer at opturion.com
Thu Jan 28 22:05:47 AEDT 2016
Fix github issue #34: make uninstall leaves files behind.
Don't accidently strip the ".exe" extension from the deep profiler executables
on Windows when installing them. (Deep profiling doesn't really work on
Windows, which is why this hasn't been noticed until now.)
compiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
Add an uninstall target in these directories.
Delete a stray reference to the IL backend.
deep_profiler/Mmakefile:
Fix the issue mentioned above w.r.t the ".exe" extension.
We install mdprof_cgi in (potentially) two locations, make
sure we (attempt to) uninstall them both.
Update the uninstall target to handle the other executables in
this directory.
doc/Mmakefile:
Make the uninstall target remove the manual pages.
Mmakefile:
Invoke uninstall targets in directories where we previously didn't.
diff --git a/Mmakefile b/Mmakefile
index 0ac6e70..ba6f2d9 100644
--- a/Mmakefile
+++ b/Mmakefile
@@ -781,10 +781,14 @@ touch_files:
.PHONY: uninstall
uninstall:
- +cd scripts; $(SUBDIR_MMAKE) uninstall
+ +cd compiler; $(SUBDIR_MMAKE) uninstall
+cd deep_profiler; $(SUBDIR_MMAKE) uninstall
- +cd util; $(SUBDIR_MMAKE) uninstall
+cd doc; $(SUBDIR_MMAKE) uninstall
+ +cd mfilterjavac; $(SUBDIR_MMAKE) uninstall
+ +cd profiler; $(SUBDIR_MMAKE) uninstall
+ +cd scripts; $(SUBDIR_MMAKE) uninstall
+ +cd slice; $(SUBDIR_MMAKE) uninstall
+ +cd util; $(SUBDIR_MMAKE) uninstall
-rm -r $(INSTALL_LIBDIR)
#-----------------------------------------------------------------------------#
diff --git a/compiler/Mmakefile b/compiler/Mmakefile
index fec7e0a..32eeb5e 100644
--- a/compiler/Mmakefile
+++ b/compiler/Mmakefile
@@ -274,3 +274,9 @@ install_compiler: mercury_compile install_dirs
cp `vpath_find $(INSTALL_PROGRAM)` $(INSTALL_MERC_BIN_DIR)
#-----------------------------------------------------------------------------#
+
+.PHONY: uninstall
+uninstall:
+ -rm -f $(INSTALL_MERC_BIN_DIR)/$(INSTALL_PROGRAM)
+
+#-----------------------------------------------------------------------------#
diff --git a/deep_profiler/Mmakefile b/deep_profiler/Mmakefile
index 754abe5..c6752f4 100644
--- a/deep_profiler/Mmakefile
+++ b/deep_profiler/Mmakefile
@@ -277,15 +277,15 @@ install_cgi_progs: mdprof_cgi mdprof_dump mdprof_test \
# with the deep profiler, so we install them as well.
-[ -d $(INSTALL_MERC_BIN_DIR) ] || mkdir -p $(INSTALL_MERC_BIN_DIR)
cp `vpath_find mdprof_cgi$(EXT_FOR_EXE)` \
- $(INSTALL_MERC_BIN_DIR)/mdprof_cgi
+ $(INSTALL_MERC_BIN_DIR)/mdprof_cgi$(EXT_FOR_EXE)
cp `vpath_find mdprof_test$(EXT_FOR_EXE)` \
- $(INSTALL_MERC_BIN_DIR)/mdprof_test
+ $(INSTALL_MERC_BIN_DIR)/mdprof_test$(EXT_FOR_EXE)
cp `vpath_find mdprof_dump$(EXT_FOR_EXE)` \
- $(INSTALL_MERC_BIN_DIR)/mdprof_dump
+ $(INSTALL_MERC_BIN_DIR)/mdprof_dump$(EXT_FOR_EXE)
cp `vpath_find mdprof_create_feedback$(EXT_FOR_EXE)` \
- $(INSTALL_MERC_BIN_DIR)/mdprof_create_feedback
+ $(INSTALL_MERC_BIN_DIR)/mdprof_create_feedback$(EXT_FOR_EXE)
cp `vpath_find mdprof_report_feedback$(EXT_FOR_EXE)` \
- $(INSTALL_MERC_BIN_DIR)/mdprof_report_feedback
+ $(INSTALL_MERC_BIN_DIR)/mdprof_report_feedback$(EXT_FOR_EXE)
ifeq ($(findstring java,$(GRADE)),java)
cp `vpath_find mdprof_cgi.jar` $(INSTALL_MERC_BIN_DIR)
cp `vpath_find mdprof_create_feedback.jar` $(INSTALL_MERC_BIN_DIR)
@@ -295,6 +295,9 @@ ifeq ($(findstring java,$(GRADE)),java)
cp `vpath_find mdprof_test.jar` $(INSTALL_MERC_BIN_DIR)
endif
+#-----------------------------------------------------------------------------#
+
+.PHONY: uninstall
uninstall:
# We try to uninstall mdprof_cgi, but failure to do so is not an
# error for two reasons: because we may simply lack permission to
@@ -303,6 +306,12 @@ uninstall:
# value of $(ENABLE_DEEP_PROFILER) to check for the latter wouldn't
# necessarily do any good, since its setting may have changed since
# the original install.)
- -rm -f $(INSTALL_CGI_DIR)/mdprof_cgi
+ -rm -f $(INSTALL_CGI_DIR)/mdprof_cgi$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mdprof_cgi$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mdprof_test$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mdprof_dump$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mdprof_create_feedback$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mdprof_report_feedback$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mdprof_procrep$(EXT_FOR_EXE)
#-----------------------------------------------------------------------------#
diff --git a/doc/Mmakefile b/doc/Mmakefile
index 926b665..4ab5de7 100644
--- a/doc/Mmakefile
+++ b/doc/Mmakefile
@@ -362,7 +362,8 @@ install_mdb_doc: $(MDB_DOC) install_dirs
# are removed by the top-level uninstall rule.
.PHONY: uninstall
uninstall:
- -cd $(INSTALL_INFO_DIR); rm mercury*.info*
+ -cd $(INSTALL_INFO_DIR); rm -f mercury*.info*
+ -cd $(INSTALL_MAN_DIR)/man1; rm -f $(MANPAGE_PROGS:%=%.1)
#-----------------------------------------------------------------------------#
diff --git a/mfilterjavac/Mmakefile b/mfilterjavac/Mmakefile
index cfad8b6..5e7e636 100644
--- a/mfilterjavac/Mmakefile
+++ b/mfilterjavac/Mmakefile
@@ -149,3 +149,9 @@ install: mfilterjavac
cp `vpath_find $(INSTALL_PROGRAM)` $(INSTALL_MERC_BIN_DIR)/$(INSTALL_PROGRAM)
#-----------------------------------------------------------------------------#
+
+.PHONY: uninstall
+uninstall:
+ -rm -f $(INSTALL_MERC_BIN_DIR)/$(INSTALL_PROGRAM)
+
+#-----------------------------------------------------------------------------#
diff --git a/profiler/Mmakefile b/profiler/Mmakefile
index 7046653..badd31a 100644
--- a/profiler/Mmakefile
+++ b/profiler/Mmakefile
@@ -43,7 +43,7 @@ all: mercury_profile $(TAGS_FILE_EXISTS)
# Add some additional dependencies, so that Mmake knows to remake the
# profiler if one of the libraries changes.
-ifeq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
+ifeq ("$(filter csharp% java% erlang%,$(GRADE))","")
mercury_profile: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A
mercury_profile: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
# XXX Should also depend on $(BOEHM_GC_DIR)/libgc(_prof).$A, but only
@@ -119,3 +119,9 @@ ifeq ($(findstring java,$(GRADE)),java)
endif
#-----------------------------------------------------------------------------#
+
+.PHONY: uninstall
+uninstall:
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mercury_profile$(EXT_FOR_EXE)
+
+#-----------------------------------------------------------------------------#
diff --git a/slice/Mmakefile b/slice/Mmakefile
index 912fede..d4b0872 100644
--- a/slice/Mmakefile
+++ b/slice/Mmakefile
@@ -221,3 +221,13 @@ ifeq ($(findstring java,$(GRADE)),java)
endif
#-----------------------------------------------------------------------------#
+
+.PHONY: uninstall
+uninstall:
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mslice$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mdice$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mtc_union$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mcov$(EXT_FOR_EXE)
+ -rm -f $(INSTALL_MERC_BIN_DIR)/mtc_diff$(EXT_FOR_EXE)
+
+#-----------------------------------------------------------------------------#
More information about the reviews
mailing list