summaryrefslogtreecommitdiff
path: root/ghc/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-11-19 01:29:05 +0000
committerIan Lynagh <igloo@earth.li>2011-11-19 01:52:32 +0000
commit80e9070c77718b7ff0e913182e54842754726ce8 (patch)
tree12804916372a3675a7d1beb00bd41e70083c5edf /ghc/ghc.mk
parent042841713eb6468696eeb437de994c52eb7a858e (diff)
downloadhaskell-80e9070c77718b7ff0e913182e54842754726ce8.tar.gz
Improve the way we call "rm" in the build system; fixes trac #4916
We avoid calling "rm -rf" with no file arguments; this fixes cleaning on Solaris, where that fails. We also check for suspicious arguments: anything containing "..", starting "/", or containing a "*" (you need to call $(wildcard ...) yourself now if you really want globbing). This should make things a little safer.
Diffstat (limited to 'ghc/ghc.mk')
-rw-r--r--ghc/ghc.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index aa6d7ca560..38b3016b30 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -143,7 +143,7 @@ ifeq "$(Windows)" "NO"
install: install_ghc_link
.PNONY: install_ghc_link
install_ghc_link:
- "$(RM)" $(RM_OPTS) "$(DESTDIR)$(bindir)/ghc"
+ $(call removeFiles,"$(DESTDIR)$(bindir)/ghc")
$(LN_S) ghc-$(ProjectVersion) "$(DESTDIR)$(bindir)/ghc"
else
# On Windows we install the main binary as $(bindir)/ghc.exe
@@ -151,7 +151,7 @@ else
install: install_ghc_post
.PHONY: install_ghc_post
install_ghc_post: install_bins
- "$(RM)" $(RM_OPTS) $(DESTDIR)$(bindir)/ghc.exe
+ $(call removeFiles,$(DESTDIR)$(bindir)/ghc.exe)
"$(MV)" -f $(DESTDIR)$(bindir)/ghc-stage$(INSTALL_GHC_STAGE).exe $(DESTDIR)$(bindir)/ghc.exe
endif