diff options
author | Ian Lynagh <igloo@earth.li> | 2009-05-30 22:00:21 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2009-05-30 22:00:21 +0000 |
commit | 0ef6ba7b28187a4bf5309f9702eeaf53a281204b (patch) | |
tree | 653c84d5647c6efa71836dbd7a7231b2ae725988 | |
parent | d5629b335a3254612887be8091b76dbdf2b582f8 (diff) | |
download | haskell-0ef6ba7b28187a4bf5309f9702eeaf53a281204b.tar.gz |
Quote commands that we run, so they work if there are space in their paths
I've also added some missing $s to some makefiles. These aren't
technically necessary, but it's nice to be consistent.
-rw-r--r-- | compiler/ghc.mk | 36 | ||||
-rw-r--r-- | docs/users_guide/ghc.mk | 2 | ||||
-rw-r--r-- | driver/ghci/ghc.mk | 12 | ||||
-rw-r--r-- | ghc.mk | 118 | ||||
-rw-r--r-- | ghc/ghc.mk | 10 | ||||
-rw-r--r-- | includes/ghc.mk | 2 | ||||
-rw-r--r-- | libffi/ghc.mk | 22 | ||||
-rw-r--r-- | mk/tree.mk | 3 | ||||
-rw-r--r-- | rts/ghc.mk | 48 | ||||
-rw-r--r-- | rules/build-dependencies.mk | 12 | ||||
-rw-r--r-- | rules/build-package-data.mk | 4 | ||||
-rw-r--r-- | rules/build-package-way.mk | 16 | ||||
-rw-r--r-- | rules/build-package.mk | 4 | ||||
-rw-r--r-- | rules/build-perl.mk | 14 | ||||
-rw-r--r-- | rules/build-prog.mk | 12 | ||||
-rw-r--r-- | rules/c-suffix-rules.mk | 52 | ||||
-rw-r--r-- | rules/clean-target.mk | 2 | ||||
-rw-r--r-- | rules/docbook.mk | 16 | ||||
-rw-r--r-- | rules/haddock.mk | 4 | ||||
-rw-r--r-- | rules/hs-suffix-rules-srcdir.mk | 44 | ||||
-rw-r--r-- | rules/hs-suffix-rules.mk | 8 | ||||
-rw-r--r-- | rules/manual-package-config.mk | 8 | ||||
-rw-r--r-- | rules/package-config.mk | 4 | ||||
-rw-r--r-- | rules/shell-wrapper.mk | 14 | ||||
-rw-r--r-- | utils/ghc-cabal/ghc.mk | 12 | ||||
-rw-r--r-- | utils/ghc-pkg/ghc.mk | 18 | ||||
-rw-r--r-- | utils/mkdependC/ghc.mk | 4 | ||||
-rw-r--r-- | utils/mkdirhier/ghc.mk | 2 | ||||
-rw-r--r-- | utils/runghc/ghc.mk | 8 |
29 files changed, 256 insertions, 255 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 8a34723bf6..5b59bbefb7 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -36,7 +36,7 @@ compiler/stage3/package-data.mk : $(compiler_CONFIG_HS) endif $(compiler_CONFIG_HS) : mk/config.mk - $(RM) -f $@ + "$(RM)" $(RM_OPTS) $@ @echo "Creating $@ ... " @echo "module Config where" >>$@ @echo "cProjectName :: String" >> $@ @@ -142,8 +142,8 @@ $(eval $(call clean-target,compiler,config_hs,$(compiler_CONFIG_HS))) PLATFORM_H = ghc_boot_platform.h compiler/stage1/$(PLATFORM_H) : mk/config.mk - $(MKDIRHIER) $(dir $@) - $(RM) $@ + "$(MKDIRHIER)" $(dir $@) + "$(RM)" $(RM_OPTS) $@ @echo "Creating $@..." @echo "#ifndef __PLATFORM_H__" >$@ @echo "#define __PLATFORM_H__" >>$@ @@ -189,8 +189,8 @@ endif # the HOST platform is the TARGET of stage1. The TARGET remains the same # (stage1 is the cross-compiler, not stage2). compiler/stage2/$(PLATFORM_H) : mk/config.mk - $(MKDIRHIER) $(dir $@) - $(RM) $@ + "$(MKDIRHIER)" $(dir $@) + "$(RM)" $(RM_OPTS) $@ @echo "Creating $@..." @echo "#ifndef __PLATFORM_H__" >$@ @echo "#define __PLATFORM_H__" >>$@ @@ -233,7 +233,7 @@ endif @echo "Done." compiler/stage3/$(PLATFORM_H) : compiler/stage2/$(PLATFORM_H) - $(CP) $< $@ + "$(CP)" $< $@ # Every Constants.o object file depends on includes/GHCConstants.h: $(eval $(call compiler-hs-dependency,Constants,$(includes_GHCCONSTANTS))) @@ -263,25 +263,25 @@ $(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H) $(eval $(call clean-target,compiler,primop, $(PRIMOPS_TXT) compiler/parser/Parser.y $(PRIMOP_BITS))) compiler/primop-data-decl.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --data-decl < $< > $@ + "$(GENPRIMOP_INPLACE)" --data-decl < $< > $@ compiler/primop-tag.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --primop-tag < $< > $@ + "$(GENPRIMOP_INPLACE)" --primop-tag < $< > $@ compiler/primop-list.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --primop-list < $< > $@ + "$(GENPRIMOP_INPLACE)" --primop-list < $< > $@ compiler/primop-has-side-effects.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --has-side-effects < $< > $@ + "$(GENPRIMOP_INPLACE)" --has-side-effects < $< > $@ compiler/primop-out-of-line.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --out-of-line < $< > $@ + "$(GENPRIMOP_INPLACE)" --out-of-line < $< > $@ compiler/primop-commutable.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --commutable < $< > $@ + "$(GENPRIMOP_INPLACE)" --commutable < $< > $@ compiler/primop-needs-wrapper.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --needs-wrapper < $< > $@ + "$(GENPRIMOP_INPLACE)" --needs-wrapper < $< > $@ compiler/primop-can-fail.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --can-fail < $< > $@ + "$(GENPRIMOP_INPLACE)" --can-fail < $< > $@ compiler/primop-strictness.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --strictness < $< > $@ + "$(GENPRIMOP_INPLACE)" --strictness < $< > $@ compiler/primop-primop-info.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) - $(GENPRIMOP_INPLACE) --primop-primop-info < $< > $@ + "$(GENPRIMOP_INPLACE)" --primop-primop-info < $< > $@ # Every PrimOp.o object file depends on $(PRIMOP_BITS): $(eval $(call compiler-hs-dependency,PrimOp,$(PRIMOP_BITS))) @@ -289,7 +289,7 @@ $(eval $(call compiler-hs-dependency,PrimOp,$(PRIMOP_BITS))) # Usages aren't used any more; but the generator # can still generate them if we want them back compiler/primop-usage.hs-incl: $(PRIMOPS_TXT) - $(GENPRIMOP_INPLACE) --usage < $< > $@ + "$(GENPRIMOP_INPLACE)" --usage < $< > $@ # ----------------------------------------------------------------------------- # Configuration @@ -466,7 +466,7 @@ compiler/stage1/inplace-pkg-config-munged: compiler/stage1/inplace-pkg-config sed -e 's/^\(version: .*\)\.$(ProjectPatchLevel)$$/\1/' \ -e 's/^\(hs-libraries: HSghc-.*\)\.$(ProjectPatchLevel)$$/\1/' \ < $< > $@ - $(compiler_stage1_GHC_PKG) update --force $(compiler_stage1_GHC_PKG_OPTS) $@ + "$(compiler_stage1_GHC_PKG)" update --force $(compiler_stage1_GHC_PKG_OPTS) $@ $(compiler_stage1_v_LIB) : compiler/stage1/inplace-pkg-config-munged endif diff --git a/docs/users_guide/ghc.mk b/docs/users_guide/ghc.mk index 6d9b275503..ceb6db4d36 100644 --- a/docs/users_guide/ghc.mk +++ b/docs/users_guide/ghc.mk @@ -28,6 +28,6 @@ src_ug_book = $(dir $(realpath $(dir $(build_ug_book))/ug-book.xml.in))ug-book. ifneq "$(build_ug_book)" "$(src_ug_book)" $(src_ug_book) : $(build_ug_book) - $(CP) $< $@ + "$(CP)" $< $@ docs/users_guide/users_guide.pdf docs/users_guide/users_guide.ps: $(src_ug_book) endif diff --git a/driver/ghci/ghc.mk b/driver/ghci/ghc.mk index dd3f213af3..4e6cc7b832 100644 --- a/driver/ghci/ghc.mk +++ b/driver/ghci/ghc.mk @@ -17,12 +17,12 @@ install: install_driver_ghci .PHONY: install_driver_ghci install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion) install_driver_ghci: - $(MKDIRHIER) $(DESTDIR)$(bindir) - $(RM) -f $(WRAPPER) + "$(MKDIRHIER)" $(DESTDIR)$(bindir) + "$(RM)" $(RM_OPTS) $(WRAPPER) echo '#!$(SHELL)' >> $(WRAPPER) echo 'exec $(bindir)/ghc-$(ProjectVersion) --interactive ${1+"$@"}' >> $(WRAPPER) $(EXECUTABLE_FILE) $(WRAPPER) - $(RM) -f $(DESTDIR)$(bindir)/ghci + "$(RM)" $(RM_OPTS) $(DESTDIR)$(bindir)/ghci $(LN_S) ghci-$(ProjectVersion) $(DESTDIR)$(bindir)/ghci else # Windows... @@ -42,7 +42,7 @@ driver/ghci/ghci.res : driver/ghci/ghci.rc driver/ghci/ghci.ico windres --preprocessor="$(CPP) -xc -DRC_INVOKED" -o driver/ghci/ghci.res -i driver/ghci/ghci.rc -O coff driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG_VER) : driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG) - $(CP) $< $@ + "$(CP)" $< $@ install : install_driver_ghcii @@ -50,8 +50,8 @@ install : install_driver_ghcii install_driver_ghcii: GHCII_SCRIPT=$(DESTDIR)$(bindir)/ghcii.sh install_driver_ghcii: GHCII_SCRIPT_VERSIONED = $(DESTDIR)$(bindir)/ghcii-$(ProjectVersion).sh install_driver_ghcii: - $(MKDIRHIER) $(DESTDIR)$(bindir) - $(RM) -f $(GHCII_SCRIPT) + "$(MKDIRHIER)" $(DESTDIR)$(bindir) + "$(RM)" $(RM_OPTS) $(GHCII_SCRIPT) echo "#!$(SHELL)" >> $(GHCII_SCRIPT) echo 'exec "$$0"/../ghc --interactive $${1+"$$@"}' >> $(GHCII_SCRIPT) $(EXECUTABLE_FILE) $(GHCII_SCRIPT) @@ -414,11 +414,11 @@ endef PRIMOPS_TXT = $(GHC_COMPILER_DIR)/prelude/primops.txt libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs : $(GENPRIMOP_INPLACE) $(PRIMOPS_TXT) - $(MKDIRHIER) $(dir $@) - $(GENPRIMOP_INPLACE) --make-haskell-wrappers <$(PRIMOPS_TXT) >$@ + "$(MKDIRHIER)" $(dir $@) + "$(GENPRIMOP_INPLACE)" --make-haskell-wrappers <$(PRIMOPS_TXT) >$@ libraries/ghc-prim/GHC/Prim.hs : $(GENPRIMOP_INPLACE) $(PRIMOPS_TXT) - $(GENPRIMOP_INPLACE) --make-haskell-source <$(PRIMOPS_TXT) >$@ + "$(GENPRIMOP_INPLACE)" --make-haskell-source <$(PRIMOPS_TXT) >$@ # ----------------------------------------------------------------------------- @@ -628,20 +628,20 @@ $(INPLACE)/stamp-mingw : $(MKDIRHIER) $(MKDIRHIER) $(INPLACE_MINGW)/bin GCC=`type -p $(WhatGccIsCalled)`; \ GccDir=`dirname $$GCC`; \ - $(CP) -p $$GccDir/{gcc.exe,ar.exe,as.exe,dlltool.exe,dllwrap.exe,windres.exe} $(INPLACE_MINGW)/bin; \ - $(CP) -Rp $$GccDir/../include $(INPLACE_MINGW); \ - $(CP) -Rp $$GccDir/../lib $(INPLACE_MINGW); \ - $(CP) -Rp $$GccDir/../libexec $(INPLACE_MINGW); \ - $(CP) -Rp $$GccDir/../mingw32 $(INPLACE_MINGW) + "$(CP)" -p $$GccDir/{gcc.exe,ar.exe,as.exe,dlltool.exe,dllwrap.exe,windres.exe} $(INPLACE_MINGW)/bin; \ + "$(CP)" -Rp $$GccDir/../include $(INPLACE_MINGW); \ + "$(CP)" -Rp $$GccDir/../lib $(INPLACE_MINGW); \ + "$(CP)" -Rp $$GccDir/../libexec $(INPLACE_MINGW); \ + "$(CP)" -Rp $$GccDir/../mingw32 $(INPLACE_MINGW) touch $(INPLACE)/stamp-mingw install : install_mingw .PHONY: install_mingw install_mingw : $(INPLACE_MINGW) - $(CP) -Rp $(INPLACE_MINGW) $(prefix) + "$(CP)" -Rp $(INPLACE_MINGW) $(prefix) $(INPLACE_LIB)/perl.exe $(INPLACE_LIB)/perl56.dll : - $(CP) $(GhcDir)../{perl.exe,perl56.dll} $(INPLACE_LIB) + "$(CP)" $(GhcDir)../{perl.exe,perl56.dll} $(INPLACE_LIB) endif # Windows @@ -651,13 +651,13 @@ libraries/ghc-prim/dist-install/doc/html/ghc-prim/ghc-prim.haddock: \ libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs: \ $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) $(MKDIRHIER) - $(MKDIRHIER) $(dir $@) - $(GENPRIMOP_INPLACE) --make-haskell-source < $< > $@ + "$(MKDIRHIER)" $(dir $@) + "$(GENPRIMOP_INPLACE)" --make-haskell-source < $< > $@ libraries/ghc-prim/dist-install/build/autogen/GHC/PrimopWrappers.hs: \ $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) $(MKDIRHIER) - $(MKDIRHIER) $(dir $@) - $(GENPRIMOP_INPLACE) --make-haskell-wrappers < $< > $@ + "$(MKDIRHIER)" $(dir $@) + "$(GENPRIMOP_INPLACE)" --make-haskell-wrappers < $< > $@ # ----------------------------------------------------------------------------- # Installation @@ -694,13 +694,13 @@ install_libs: $(INSTALL_LIBS) done install_libexec_scripts: $(INSTALL_LIBEXEC_SCRIPTS) - $(MKDIRHIER) $(DESTDIR)$(libexecdir) + "$(MKDIRHIER)" $(DESTDIR)$(libexecdir) for i in $(INSTALL_LIBEXEC_SCRIPTS); do \ $(INSTALL_SCRIPT) $(INSTALL_OPTS) $$i $(DESTDIR)$(libexecdir); \ done install_libexecs: $(INSTALL_LIBEXECS) - $(MKDIRHIER) $(DESTDIR)$(libexecdir) + "$(MKDIRHIER)" $(DESTDIR)$(libexecdir) for i in $(INSTALL_LIBEXECS); do \ $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i $(DESTDIR)$(libexecdir); \ done @@ -723,17 +723,17 @@ endif install_packages: install_libexecs install_packages: libffi/package.conf.install rts/package.conf.install - $(MKDIRHIER) $(DESTDIR)$(libdir) + "$(MKDIRHIER)" $(DESTDIR)$(libdir) echo "[]" > $(INSTALLED_PACKAGE_CONF) - $(INSTALLED_GHC_PKG_REAL) --force --global-conf $(INSTALLED_PACKAGE_CONF) update libffi/package.conf.install - $(INSTALLED_GHC_PKG_REAL) --force --global-conf $(INSTALLED_PACKAGE_CONF) update rts/package.conf.install + "$(INSTALLED_GHC_PKG_REAL)" --force --global-conf $(INSTALLED_PACKAGE_CONF) update libffi/package.conf.install + "$(INSTALLED_GHC_PKG_REAL)" --force --global-conf $(INSTALLED_PACKAGE_CONF) update rts/package.conf.install $(foreach p, $(PACKAGES) $(PACKAGES_STAGE2),\ - $(GHC_CABAL_INPLACE) install \ + "$(GHC_CABAL_INPLACE)" install \ $(INSTALLED_GHC_PKG_REAL) \ $(INSTALLED_PACKAGE_CONF) \ libraries/$p dist-install \ '$(DESTDIR)' '$(prefix)' '$(libdir)' '$(docdir)/libraries' &&) true - $(GHC_CABAL_INPLACE) install \ + "$(GHC_CABAL_INPLACE)" install \ $(INSTALLED_GHC_PKG_REAL) \ $(INSTALLED_PACKAGE_CONF) \ compiler stage2 \ @@ -769,15 +769,15 @@ $(eval $(call bindist,.,\ # the bindist with a relative path binary-dist: - $(RM) -rf $(BIN_DIST_NAME) + "$(RM)" $(RM_OPTS) -r $(BIN_DIST_NAME) mkdir $(BIN_DIST_NAME) set -e; for i in LICENSE compiler ghc rts libraries utils gmp docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh extra-gcc-opts.in ghc.mk inplace; do ln -s ../$$i $(BIN_DIST_NAME)/; done ln -s ../distrib/configure-bin.ac $(BIN_DIST_NAME)/configure.ac cd $(BIN_DIST_NAME) && autoreconf - $(RM) -f $(BIN_DIST_TAR) + "$(RM)" $(RM_OPTS) $(BIN_DIST_TAR) # h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source # tree then we want to include the real file, not a symlink to it - $(TAR) hcf - -T $(BIN_DIST_LIST) | bzip2 -c >$(BIN_DIST_TAR_BZ2) + "$(TAR)" hcf - -T $(BIN_DIST_LIST) | bzip2 -c >$(BIN_DIST_TAR_BZ2) nTimes = set -e; for i in `seq 1 $(1)`; do echo Try "$$i: $(2)"; if $(2); then break; fi; done @@ -832,7 +832,7 @@ sdist : VERSION # "stage2" is the dist dir. sdist_file = \ if test -f $(TOP)/$1/$2/build/$4.hs; then \ - $(CP) $(TOP)/$1/$2/build/$4.hs $1/$3/ ; \ + "$(CP)" $(TOP)/$1/$2/build/$4.hs $1/$3/ ; \ mv $1/$3/$4.$5 $1/$3/$4.$5.source ;\ else \ echo "does not exist: $1/$2//build/$4.hs"; \ @@ -841,14 +841,14 @@ sdist_file = \ .PHONY: sdist-prep sdist-prep : - $(RM) -rf $(SRC_DIST_DIR) - $(RM) $(SRC_DIST_NAME).tar.gz + "$(RM)" $(RM_OPTS) -r $(SRC_DIST_DIR) + "$(RM)" $(SRC_DIST_NAME).tar.gz mkdir $(SRC_DIST_DIR) ( cd $(SRC_DIST_DIR) \ && for i in $(SRC_DIST_DIRS); do mkdir $$i; (cd $$i && lndir $(TOP)/$$i ); done \ && for i in $(SRC_DIST_FILES); do $(LN_S) $(TOP)/$$i .; done \ && $(MAKE) distclean \ - && if test -f $(TOP)/libraries/haskell-src/dist/build/Language/Haskell/Parser.hs; then $(CP) $(TOP)/libraries/haskell-src/dist/build/Language/Haskell/Parser.hs libraries/haskell-src/Language/Haskell/ ; mv libraries/haskell-src/Language/Haskell/Parser.ly libraries/haskell-src/Language/Haskell/Parser.ly.source ; fi \ + && if test -f $(TOP)/libraries/haskell-src/dist/build/Language/Haskell/Parser.hs; then "$(CP)" $(TOP)/libraries/haskell-src/dist/build/Language/Haskell/Parser.hs libraries/haskell-src/Language/Haskell/ ; mv libraries/haskell-src/Language/Haskell/Parser.ly libraries/haskell-src/Language/Haskell/Parser.ly.source ; fi \ && $(call sdist_file,compiler,stage2,cmm,CmmLex,x) \ && $(call sdist_file,compiler,stage2,cmm,CmmParse,y) \ && $(call sdist_file,compiler,stage2,main,ParsePkgConf,y) \ @@ -860,13 +860,13 @@ sdist-prep : && $(call sdist_file,utils/hpc,dist,,HpcParser,y) \ && $(call sdist_file,utils/genprimopcode,dist,,Lexer,x) \ && $(call sdist_file,utils/genprimopcode,dist,,Parser,y) \ - && $(RM) -rf compiler/stage[123] mk/build.mk \ - && $(FIND) $(SRC_DIST_DIRS) \( -name _darcs -o -name SRC -o -name "autom4te*" -o -name "*~" -o -name ".cvsignore" -o -name "\#*" -o -name ".\#*" -o -name "log" -o -name "*-SAVE" -o -name "*.orig" -o -name "*.rej" -o -name "*-darcs-backup*" \) -print | xargs $(RM) -rf \ + && "$(RM)" $(RM_OPTS) -r compiler/stage[123] mk/build.mk \ + && "$(FIND)" $(SRC_DIST_DIRS) \( -name _darcs -o -name SRC -o -name "autom4te*" -o -name "*~" -o -name ".cvsignore" -o -name "\#*" -o -name ".\#*" -o -name "log" -o -name "*-SAVE" -o -name "*.orig" -o -name "*.rej" -o -name "*-darcs-backup*" \) -print | xargs "$(RM)" $(RM_OPTS) -r \ ) .PHONY: sdist sdist : sdist-prep - $(TAR) chf - $(SRC_DIST_NAME) 2>$src_log | bzip2 >$(TOP)/$(SRC_DIST_TARBALL) + "$(TAR)" chf - $(SRC_DIST_NAME) 2>$src_log | bzip2 >$(TOP)/$(SRC_DIST_TARBALL) sdist-manifest : $(SRC_DIST_TARBALL) tar tjf $(SRC_DIST_TARBALL) | sed "s|^ghc-$(ProjectVersion)/||" | sort >sdist-manifest @@ -898,43 +898,43 @@ clean : clean_files clean_libraries .PHONY: clean_files clean_files : - $(RM) $(CLEAN_FILES) + "$(RM)" $(RM_OPTS) $(CLEAN_FILES) .PHONY: clean_libraries clean_libraries: - $(RM) -r $(patsubst %, libraries/%/dist, $(PACKAGES) $(PACKAGES_STAGE2)) - $(RM) -r $(patsubst %, libraries/%/dist-install, $(PACKAGES) $(PACKAGES_STAGE2)) - $(RM) -r $(patsubst %, libraries/%/dist-boot, $(PACKAGES) $(PACKAGES_STAGE2)) + "$(RM)" $(RM_OPTS) -r $(patsubst %, libraries/%/dist, $(PACKAGES) $(PACKAGES_STAGE2)) + "$(RM)" $(RM_OPTS) -r $(patsubst %, libraries/%/dist-install, $(PACKAGES) $(PACKAGES_STAGE2)) + "$(RM)" $(RM_OPTS) -r $(patsubst %, libraries/%/dist-boot, $(PACKAGES) $(PACKAGES_STAGE2)) distclean : clean - $(RM) config.cache config.status config.log mk/config.h mk/stamp-h - $(RM) mk/config.mk mk/are-validating.mk mk/project.mk - $(RM) extra-gcc-opts docs/users_guide/ug-book.xml - $(RM) compiler/ghc.cabal ghc/ghc-bin.cabal - $(RM) libraries/base/include/HsBaseConfig.h - $(RM) libraries/directory/include/HsDirectoryConfig.h - $(RM) libraries/process/include/HsProcessConfig.h - $(RM) libraries/unix/include/HsUnixConfig.h - $(RM) libraries/old-time/include/HsTimeConfig.h - $(RM) $(patsubst %, libraries/%/config.log, $(PACKAGES) $(PACKAGES_STAGE2)) - $(RM) $(patsubst %, libraries/%/config.status, $(PACKAGES) $(PACKAGES_STAGE2)) - $(RM) $(patsubst %, libraries/%/include/Hs*Config.h, $(PACKAGES) $(PACKAGES_STAGE2)) - $(RM) -r $(patsubst %, libraries/%/autom4te.cache, $(PACKAGES) $(PACKAGES_STAGE2)) + "$(RM)" $(RM_OPTS) config.cache config.status config.log mk/config.h mk/stamp-h + "$(RM)" $(RM_OPTS) mk/config.mk mk/are-validating.mk mk/project.mk + "$(RM)" $(RM_OPTS) extra-gcc-opts docs/users_guide/ug-book.xml + "$(RM)" $(RM_OPTS) compiler/ghc.cabal ghc/ghc-bin.cabal + "$(RM)" $(RM_OPTS) libraries/base/include/HsBaseConfig.h + "$(RM)" $(RM_OPTS) libraries/directory/include/HsDirectoryConfig.h + "$(RM)" $(RM_OPTS) libraries/process/include/HsProcessConfig.h + "$(RM)" $(RM_OPTS) libraries/unix/include/HsUnixConfig.h + "$(RM)" $(RM_OPTS) libraries/old-time/include/HsTimeConfig.h + "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/config.log, $(PACKAGES) $(PACKAGES_STAGE2)) + "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/config.status, $(PACKAGES) $(PACKAGES_STAGE2)) + "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/include/Hs*Config.h, $(PACKAGES) $(PACKAGES_STAGE2)) + "$(RM)" $(RM_OPTS) -r $(patsubst %, libraries/%/autom4te.cache, $(PACKAGES) $(PACKAGES_STAGE2)) maintainer-clean : distclean - $(RM) configure mk/config.h.in - $(RM) -r autom4te.cache libraries/*/autom4te.cache - $(RM) ghc.spec - $(RM) $(patsubst %, libraries/%/GNUmakefile, \ + "$(RM)" $(RM_OPTS) configure mk/config.h.in + "$(RM)" $(RM_OPTS) -r autom4te.cache libraries/*/autom4te.cache + "$(RM)" $(RM_OPTS) ghc.spec + "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/GNUmakefile, \ $(PACKAGES) $(PACKAGES_STAGE2)) - $(RM) $(patsubst %, libraries/%/ghc.mk, $(PACKAGES) $(PACKAGES_STAGE2)) - $(RM) $(patsubst %, libraries/%/configure, \ + "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/ghc.mk, $(PACKAGES) $(PACKAGES_STAGE2)) + "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/configure, \ $(PACKAGES) $(PACKAGES_STAGE2)) - $(RM) libraries/base/include/HsBaseConfig.h.in - $(RM) libraries/directory/include/HsDirectoryConfig.h.in - $(RM) libraries/process/include/HsProcessConfig.h.in - $(RM) libraries/unix/include/HsUnixConfig.h.in - $(RM) libraries/old-time/include/HsTimeConfig.h.in + "$(RM)" $(RM_OPTS) libraries/base/include/HsBaseConfig.h.in + "$(RM)" $(RM_OPTS) libraries/directory/include/HsDirectoryConfig.h.in + "$(RM)" $(RM_OPTS) libraries/process/include/HsProcessConfig.h.in + "$(RM)" $(RM_OPTS) libraries/unix/include/HsUnixConfig.h.in + "$(RM)" $(RM_OPTS) libraries/old-time/include/HsTimeConfig.h.in .PHONY: all_libraries diff --git a/ghc/ghc.mk b/ghc/ghc.mk index 1115946c4e..8f2c74155e 100644 --- a/ghc/ghc.mk +++ b/ghc/ghc.mk @@ -117,7 +117,7 @@ all_ghc_stage2 : $(GHC_STAGE2) all_ghc_stage3 : $(GHC_STAGE3) $(INPLACE_LIB)/extra-gcc-opts : extra-gcc-opts - $(CP) $< $@ + "$(CP)" $< $@ # The GHC programs need to depend on all the helper programs they might call ifeq "$(GhcUnregisterised)" "NO" @@ -149,15 +149,15 @@ ifeq "$(Windows)" "NO" install: install_ghc_link .PNONY: install_ghc_link install_ghc_link: - $(RM) -f $(DESTDIR)$(bindir)/ghc - $(LN_S) ghc-$(ProjectVersion) $(DESTDIR)$(bindir)/ghc + "$(RM)" $(RM_OPTS) $(DESTDIR)$(bindir)/ghc + "$(LN_S)" ghc-$(ProjectVersion) $(DESTDIR)$(bindir)/ghc else # On Windows we install the main binary as $(bindir)/ghc.exe # To get ghc-<version>.exe we have a little C program in driver/ghc install: install_ghc_post .PHONY: install_ghc_post install_ghc_post: install_bins - $(RM) -f $(DESTDIR)$(bindir)/ghc.exe - $(MV) -f $(DESTDIR)$(bindir)/ghc-stage$(INSTALL_GHC_STAGE).exe $(DESTDIR)$(bindir)/ghc.exe + "$(RM)" $(RM_OPTS) $(DESTDIR)$(bindir)/ghc.exe + "$(MV)" -f $(DESTDIR)$(bindir)/ghc-stage$(INSTALL_GHC_STAGE).exe $(DESTDIR)$(bindir)/ghc.exe endif diff --git a/includes/ghc.mk b/includes/ghc.mk index dd90fa2977..66a379aa29 100644 --- a/includes/ghc.mk +++ b/includes/ghc.mk @@ -73,7 +73,7 @@ $(includes_H_CONFIG) : mk/config.h mk/config.mk includes/ghc.mk endif $(includes_H_PLATFORM) : includes/Makefile - $(RM) $@ + "$(RM)" $(RM_OPTS) $@ @echo "Creating $@..." @echo "#ifndef __GHCPLATFORM_H__" >$@ @echo "#define __GHCPLATFORM_H__" >>$@ diff --git a/libffi/ghc.mk b/libffi/ghc.mk index 0394d1d389..4613447d4c 100644 --- a/libffi/ghc.mk +++ b/libffi/ghc.mk @@ -105,14 +105,14 @@ endif ifneq "$(BINDIST)" "YES" $(libffi_STAMP_CONFIGURE): - $(RM) -rf $(LIBFFI_DIR) libffi/build + "$(RM)" $(RM_OPTS) -r $(LIBFFI_DIR) libffi/build cd libffi && $(TAR) -zxf tarball/libffi*.tar.gz mv libffi/libffi-* libffi/build chmod +x libffi/ln cd libffi && $(PATCH) -p0 < libffi.dllize-3.0.6.patch # This patch is just the resulting delta from running automake, autoreconf, libtoolize --force --copy - cd libffi && $(PATCH) -p0 < libffi.autotools-update.patch + cd libffi && "$(PATCH)" -p0 < libffi.autotools-update.patch cd libffi && \ (set -o igncr 2>/dev/null) && set -o igncr; export SHELLOPTS; \ @@ -122,7 +122,7 @@ $(libffi_STAMP_CONFIGURE): CC=$(WhatGccIsCalled) \ CFLAGS="$(SRC_CC_OPTS)" \ LDFLAGS="$(SRC_LD_OPTS)" \ - $(SHELL) configure \ + "$(SHELL)" configure \ --enable-static=yes \ --enable-shared=$(libffi_EnableShared) \ --host=$(PLATFORM) --build=$(PLATFORM) @@ -131,18 +131,18 @@ $(libffi_STAMP_CONFIGURE): # NOTE: this builds libffi_convience.so with the incorrect # soname, but we don't need that anyway! cd libffi && \ - $(CP) build/libtool build/libtool.orig; \ + "$(CP)" build/libtool build/libtool.orig; \ sed -e s/soname_spec=.*/soname_spec="$(libffi_HS_DYN_LIB_NAME)"/ build/libtool.orig > build/libtool # We don't want libtool's cygwin hacks cd libffi && \ - $(CP) build/libtool build/libtool.orig; \ + "$(CP)" build/libtool build/libtool.orig; \ sed -e s/dlname=\'\$$tdlname\'/dlname=\'\$$dlname\'/ build/libtool.orig > build/libtool touch $@ libffi/ffi.h: $(libffi_STAMP_CONFIGURE) - $(CP) libffi/build/include/ffi.h $@ + "$(CP)" libffi/build/include/ffi.h $@ $(libffi_STAMP_BUILD): $(libffi_STAMP_CONFIGURE) cd libffi && \ @@ -153,8 +153,8 @@ $(libffi_STAMP_BUILD): $(libffi_STAMP_CONFIGURE) $(libffi_STATIC_LIB): $(libffi_STAMP_BUILD) # Rename libffi.a to libHSffi.a libffi/libHSffi.a libffi/libHSffi_p.a: $(libffi_STATIC_LIB) - $(CP) $(libffi_STATIC_LIB) libffi/libHSffi.a - $(CP) $(libffi_STATIC_LIB) libffi/libHSffi_p.a + "$(CP)" $(libffi_STATIC_LIB) libffi/libHSffi.a + "$(CP)" $(libffi_STATIC_LIB) libffi/libHSffi_p.a $(eval $(call all-target,libffi,libffi/libHSffi.a libffi/libHSffi_p.a)) @@ -166,7 +166,7 @@ $(eval $(call all-target,libffi,libffi/libHSffi.a libffi/libHSffi_p.a)) libffi/HSffi.o: libffi/libHSffi.a cd libffi && \ touch empty.c; \ - $(CC) $(SRC_CC_OPTS) -c empty.c -o HSffi.o + "$(CC)" $(SRC_CC_OPTS) -c empty.c -o HSffi.o $(eval $(call all-target,libffi,libffi/HSffi.o)) @@ -178,7 +178,7 @@ libffi/libffi.dll.a $(libffi_HS_DYN_LIB): $(libffi_STAMP_BUILD) # However, the renaming is still required for the import library # libffi.dll.a. $(libffi_HS_DYN_LIB).a: libffi/libffi.dll.a - $(CP) libffi/libffi.dll.a $(libffi_HS_DYN_LIB).a + "$(CP)" libffi/libffi.dll.a $(libffi_HS_DYN_LIB).a $(eval $(call all-target,libffi,$(libffi_HS_DYN_LIB).a)) @@ -186,7 +186,7 @@ else $(libffi_DYNAMIC_LIBS): $(libffi_STAMP_BUILD) # Rename libffi.so to libHSffi...so $(libffi_HS_DYN_LIB): $(libffi_DYNAMIC_LIBS) - $(CP) $(word 1,$(libffi_DYNAMIC_LIBS)) $(libffi_HS_DYN_LIB) + "$(CP)" $(word 1,$(libffi_DYNAMIC_LIBS)) $(libffi_HS_DYN_LIB) $(eval $(call all-target,libffi,$(libffi_HS_DYN_LIB))) endif diff --git a/mk/tree.mk b/mk/tree.mk index 4d1416a3ef..b7d2875ad3 100644 --- a/mk/tree.mk +++ b/mk/tree.mk @@ -46,5 +46,6 @@ INPLACE_BIN = $(INPLACE)/bin INPLACE_LIB = $(INPLACE)/lib INPLACE_MINGW = $(INPLACE)/mingw -RM = rm -f +RM = rm +RM_OPTS = -f diff --git a/rts/ghc.mk b/rts/ghc.mk index a88ea931fe..9629aba5bb 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -63,21 +63,21 @@ endif rts_AUTO_APPLY_CMM = rts/dist/build/AutoApply.cmm $(rts_AUTO_APPLY_CMM): $(GENAPPLY_INPLACE) - $(RM) $@ - $(GENAPPLY_INPLACE) >$@ + "$(RM)" $(RM_OPTS) $@ + "$(GENAPPLY_INPLACE)" >$@ rts/dist/build/sm/Evac_thr.c : rts/sm/Evac.c - $(MKDIRHIER) $(dir $@) + "$(MKDIRHIER)" $(dir $@) cp $< $@ rts/dist/build/sm/Scav_thr.c : rts/sm/Scav.c - $(MKDIRHIER) $(dir $@) + "$(MKDIRHIER)" $(dir $@) cp $< $@ rts_H_FILES = $(wildcard $(GHC_INCLUDE_DIR)/*.h) $(wildcard rts/*.h) # collect the -l flags that we need to link the rts dyn lib. rts/libs.depend : $(GHC_PKG_INPLACE) - $(GHC_PKG_INPLACE) field rts extra-libraries \ + "$(GHC_PKG_INPLACE)" field rts extra-libraries \ | sed -e 's/^extra-libraries: //' -e 's/\([a-z]*\)/-l\1/g' > $@ #----------------------------------------------------------------------------- @@ -95,30 +95,30 @@ ifneq "$$(CLEANING)" "YES" ifneq "$$(BootingFromHc)" "YES" $1/$2/build/%.$$($3_way_)o : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC) - $$($1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)o : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC) - $$($1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)hc : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC) - $$($1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)hc : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC) - $$($1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)s : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC) - $$($1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC) - $$($1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@ endif $1/$2/build/%.$$($3_way_)o : $1/%.hc - $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@ + "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@ $1/$2/build/%.$$($3_way_)o : $1/$2/build/%.hc - $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@ + "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@ endif @@ -132,8 +132,8 @@ ifneq "$$(findstring debug, $1)" "" rts_dist_$1_HC_OPTS = rts_dist_$1_CC_OPTS = -g -O0 else -rts_dist_$1_HC_OPTS = $(GhcRtsHcOpts) -rts_dist_$1_CC_OPTS = $(GhcRtsCcOpts) +rts_dist_$1_HC_OPTS = $$(GhcRtsHcOpts) +rts_dist_$1_CC_OPTS = $$(GhcRtsCcOpts) endif ifneq "$$(findstring thr, $1)" "" @@ -148,19 +148,19 @@ rts_$1_LIB = rts/dist/build/libHSrts$$($1_libsuf) rts_$1_C_OBJS = $$(patsubst rts/%.c,rts/dist/build/%.$$($1_osuf),$$(rts_C_SRCS)) $$(patsubst %.c,%.$$($1_osuf),$$(rts_$1_EXTRA_C_SRCS)) rts_$1_S_OBJS = $$(patsubst rts/%.S,rts/dist/build/%.$$($1_osuf),$$(rts_S_SRCS)) -rts_$1_CMM_OBJS = $$(patsubst rts/%.cmm,rts/dist/build/%.$$($1_osuf),$$(rts_CMM_SRCS)) $$(patsubst %.cmm,%.$$($1_osuf),$(rts_AUTO_APPLY_CMM)) +rts_$1_CMM_OBJS = $$(patsubst rts/%.cmm,rts/dist/build/%.$$($1_osuf),$$(rts_CMM_SRCS)) $$(patsubst %.cmm,%.$$($1_osuf),$$(rts_AUTO_APPLY_CMM)) rts_$1_OBJS = $$(rts_$1_C_OBJS) $$(rts_$1_S_OBJS) $$(rts_$1_CMM_OBJS) ifneq "$$(findstring dyn, $1)" "" $$(rts_$1_LIB) : $$(rts_$1_OBJS) rts/libs.depend - $$(RM) $$@ - $$(rts_dist_HC) -shared -dynamic -dynload deploy \ + "$$(RM)" $$(RM_OPTS) $$@ + "$$(rts_dist_HC)" -shared -dynamic -dynload deploy \ -no-auto-link-packages `cat rts/libs.depend` $$(rts_$1_OBJS) -o $$@ else $$(rts_$1_LIB) : $$(rts_$1_OBJS) - $$(RM) $$@ - echo $$(rts_$1_OBJS) | $$(XARGS) $$(AR) $$(EXTRA_AR_ARGS) $$@ + "$$(RM)" $$(RM_OPTS) $$@ + echo $$(rts_$1_OBJS) | "$$(XARGS)" $$(AR) $$(EXTRA_AR_ARGS) $$@ endif endef @@ -399,7 +399,7 @@ rts_LD_OPTS += -Llibffi/build/include DYNWRAPPER_SRC = rts/dyn-wrapper.c DYNWRAPPER_PROG = rts/dyn-wrapper$(exeext) $(DYNWRAPPER_PROG): $(DYNWRAPPER_SRC) - $(HC) -cpp -optc-include -optcdyn-wrapper-patchable-behaviour.h $(INPLACE_EXTRA_FLAGS) $< -o $@ + "$(HC)" -cpp -optc-include -optcdyn-wrapper-patchable-behaviour.h $(INPLACE_EXTRA_FLAGS) $< -o $@ # ----------------------------------------------------------------------------- # build the static lib containing the C main symbol @@ -432,9 +432,9 @@ install : install_rts .PHONY: install_rts install_rts: - $(MKDIRHIER) $(DESTDIR)$(libdir) - $(MKDIRHIER) $(DESTDIR)$(libdir)/include - $(CP) $(ALL_RTS_LIBS) $(DESTDIR)$(libdir) + "$(MKDIRHIER)" $(DESTDIR)$(libdir) + "$(MKDIRHIER)" $(DESTDIR)$(libdir)/include + "$(CP)" $(ALL_RTS_LIBS) $(DESTDIR)$(libdir) # ----------------------------------------------------------------------------- # cleaning diff --git a/rules/build-dependencies.mk b/rules/build-dependencies.mk index ae1d5add72..962f07b3df 100644 --- a/rules/build-dependencies.mk +++ b/rules/build-dependencies.mk @@ -22,17 +22,17 @@ endif ifneq "$$($1_$2_NO_BUILD_DEPS)" "YES" $$($1_$2_depfile) : $$(MKDIRHIER) $$(MKDEPENDC) $$($1_$2_HS_SRCS) $$($1_$2_HS_BOOT_SRCS) $$($1_$2_HC_MK_DEPEND_DEP) $$($1_$2_C_FILES) $$($1_$2_S_FILES) - $$(MKDIRHIER) $1/$2/build - $$(RM) $$@ $$@.tmp + "$$(MKDIRHIER)" $1/$2/build + "$$(RM)" $$(RM_OPTS) $$@ $$@.tmp touch $$@.tmp ifneq "$$($1_$2_C_SRCS)$$($1_$2_S_SRCS)" "" - $$(MKDEPENDC) -f $$($1_$2_depfile).tmp $$($1_MKDEPENDC_OPTS) $$(foreach way,$$($1_WAYS),-s $$(way)) -- $$($1_$2_v_ALL_CC_OPTS) -- $$($1_$2_C_FILES) $$($1_$2_S_FILES) || ( $$(RM) $$@; exit 1 ) - sed -e "s|$1/\([^ :]*o[ :]\)|$1/$2/build/\1|g" -e "s|$(TOP)/||" <$$($1_$2_depfile).tmp >$$($1_$2_depfile) + "$$(MKDEPENDC)" -f $$($1_$2_depfile).tmp $$($1_MKDEPENDC_OPTS) $$(foreach way,$$($1_WAYS),-s $$(way)) -- $$($1_$2_v_ALL_CC_OPTS) -- $$($1_$2_C_FILES) $$($1_$2_S_FILES) || ( "$$(RM)" $$(RM_OPTS) $$@; exit 1 ) + sed -e "s|$1/\([^ :]*o[ :]\)|$1/$2/build/\1|g" -e "s|$$(TOP)/||" <$$($1_$2_depfile).tmp >$$($1_$2_depfile) endif ifneq "$$($1_$2_HS_SRCS)" "" - $$($1_$2_HC_MK_DEPEND) -M $$($1_$2_MKDEPENDHS_FLAGS) \ + "$$($1_$2_HC_MK_DEPEND)" -M $$($1_$2_MKDEPENDHS_FLAGS) \ $$(filter-out -split-objs, $$($1_$2_v_ALL_HC_OPTS)) \ - $$($1_$2_HS_SRCS) || ( $$(RM) $$@; exit 1 ) + $$($1_$2_HS_SRCS) || ( "$$(RM)" $$(RM_OPTS) $$@; exit 1 ) endif echo "$1_$2_depfile_EXISTS = YES" >> $$@ ifneq "$$($1_$2_SLASH_MODS)" "" diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk index 38a9620e33..3a4db89170 100644 --- a/rules/build-package-data.mk +++ b/rules/build-package-data.mk @@ -24,9 +24,9 @@ endif # for our build system, and registers the package for use in-place in # the build tree. $1/$2/package-data.mk $1/$2/inplace-pkg-config $1/$2/build/autogen/cabal_macros.h : $$(GHC_CABAL_INPLACE) $$($1_$2_GHC_PKG_DEP) $1/$$($1_PACKAGE).cabal $$(wildcard $1/configure) $$($1_$2_HC_CONFIG_DEP) - $$(GHC_CABAL_INPLACE) configure --with-ghc=$$($1_$2_HC_CONFIG) --with-ghc-pkg=$$($1_$2_GHC_PKG) --with-gcc=$$(WhatGccIsCalled) --configure-option=--with-cc=$$(WhatGccIsCalled) $$($1_CONFIGURE_OPTS) $$($1_$2_CONFIGURE_OPTS) -- $2 $1 + "$$(GHC_CABAL_INPLACE)" configure --with-ghc="$$($1_$2_HC_CONFIG)" --with-ghc-pkg="$$($1_$2_GHC_PKG)" --with-gcc="$$(WhatGccIsCalled)" --configure-option=--with-cc="$$(WhatGccIsCalled)" $$($1_CONFIGURE_OPTS) $$($1_$2_CONFIGURE_OPTS) -- $2 $1 if [ "$$($1_$2_PROG)" = "" ]; then \ - $$($1_$2_GHC_PKG) update --force $$($1_$2_GHC_PKG_OPTS) $1/$2/inplace-pkg-config; \ + "$$($1_$2_GHC_PKG)" update --force $$($1_$2_GHC_PKG_OPTS) $1/$2/inplace-pkg-config; \ fi endef diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index b8df37dd05..074ea404a8 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -41,8 +41,8 @@ endif ifeq "$3" "dyn" # Link a dynamic library $$($1_$2_$3_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_dyn_C_OBJS) $$($1_$2_dyn_S_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS) - $$(RM) $$@ - $$($1_$2_HC) $$($1_$2_dyn_C_OBJS) $$($1_$2_dyn_S_OBJS) $$($1_$2_$3_HS_OBJS) \ + "$$(RM)" $$(RM_OPTS) $$@ + "$$($1_$2_HC)" $$($1_$2_dyn_C_OBJS) $$($1_$2_dyn_S_OBJS) $$($1_$2_$3_HS_OBJS) \ `$$($1_$2_$3_MKSTUBOBJS)` \ -shared -dynamic -dynload deploy \ -no-auto-link-packages $$(addprefix -package,$$($1_$2_DEPS)) \ @@ -51,12 +51,12 @@ else # Build the ordinary .a library ifeq "$$($1_$2_SplitObjs)" "YES" $$($1_$2_$3_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) - $$(RM) $$@ - (echo $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)`; find $$(patsubst %.$$($3_osuf),%_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print) | $$(XARGS) $$(AR) $$(EXTRA_AR_ARGS) $$@ || $(RM) $$@ + "$$(RM)" $$(RM_OPTS) $$@ + (echo $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)`; find $$(patsubst %.$$($3_osuf),%_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print) | "$$(XARGS)" $$(AR) $$(EXTRA_AR_ARGS) $$@ || "$$(RM)" $$(RM_OPTS) $$@ else $$($1_$2_$3_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) - $$(RM) $$@ - echo $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_$3_HS_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` | $$(XARGS) $$(AR) $$(EXTRA_AR_ARGS) $$@ || $(RM) $$@ + "$$(RM)" $$(RM_OPTS) $$@ + echo $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_$3_HS_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` | "$$(XARGS)" $$(AR) $$(EXTRA_AR_ARGS) $$@ || "$$(RM)" $$(RM_OPTS) $$@ endif endif @@ -77,8 +77,8 @@ ifneq "$4" "0" BINDIST_LIBS += $$($1_$2_GHCI_LIB) endif $$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) - $$(RM) $$@ - $$(LD) -r -o $$@ $$(EXTRA_LD_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` + "$$(RM)" $$(RM_OPTS) $$@ + "$$(LD)" -r -o $$@ $$(EXTRA_LD_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` $(call all-target,$1_$2,$$($1_$2_GHCI_LIB)) endif diff --git a/rules/build-package.mk b/rules/build-package.mk index b5a1239cd0..711e56cf76 100644 --- a/rules/build-package.mk +++ b/rules/build-package.mk @@ -55,8 +55,8 @@ maintainer-clean : distclean .PHONY: clean_$1_$2_config clean_$1_$2_config: - $(RM) $1/config.log $1/config.status $1/include/Hs*Config.h - $(RM) -r $1/autom4te.cache + "$$(RM)" $$(RM_OPTS) $1/config.log $1/config.status $1/include/Hs*Config.h + "$$(RM)" $$(RM_OPTS) -r $1/autom4te.cache # --- CONFIGURATION diff --git a/rules/build-perl.mk b/rules/build-perl.mk index 8e31b89275..468572c571 100644 --- a/rules/build-perl.mk +++ b/rules/build-perl.mk @@ -36,21 +36,21 @@ clean_$1 : clean_$1_$2 ifneq "$$(BINDIST)" "YES" $1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$(UNLIT) - $$(MKDIRHIER) $1/$2 - $$(RM) -f $$@ - $$(UNLIT) $$(UNLIT_OPTS) $$< $$@ + "$$(MKDIRHIER)" $1/$2 + "$$(RM)" $$(RM_OPTS) $$@ + "$$(UNLIT)" $$(UNLIT_OPTS) $$< $$@ $1/$2/$$($1_$2_PROG): $1/$2/$$($1_$2_PROG).prl - $$(RM) -f $$@ + "$$(RM)" $$(RM_OPTS) $$@ echo '#!$$(PERL)' >> $$@ echo '$$$$TARGETPLATFORM = "$$(TARGETPLATFORM)";' >> $$@ cat $$< >> $$@ $$(EXECUTABLE_FILE) $$@ $$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) - $$(MKDIRHIER) $$(dir $$@) - $$(RM) -f $$@ - $$(CP) $$< $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(RM)" $$(RM_OPTS) $$@ + "$$(CP)" $$< $$@ $$(EXECUTABLE_FILE) $$@ endif diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 1bb9028f3b..321de02241 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -99,12 +99,12 @@ $(call hs-objs,$1,$2,v) ifeq "$$(BootingFromHc)" "NO" $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) - $$(MKDIRHIER) $$(dir $$@) - $$($1_$2_HC) -o $$@ $$($1_$2_v_ALL_HC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) + "$$(MKDIRHIER)" $$(dir $$@) + "$$($1_$2_HC)" -o $$@ $$($1_$2_v_ALL_HC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) else $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) - $$(MKDIRHIER) $$(dir $$@) - $$(CC) -o $$@ $$($1_$2_v_ALL_CC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) $$($1_$2_v_EXTRA_CC_OPTS) + "$$(MKDIRHIER)" $$(dir $$@) + "$$(CC)" -o $$@ $$($1_$2_v_ALL_CC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) $$($1_$2_v_EXTRA_CC_OPTS) endif # Note [lib-depends] if this program is built with stage1 or greater, we @@ -139,8 +139,8 @@ $(call clean-target,$1,$2_inplace,$$($1_$2_INPLACE)) # INPLACE_BIN might be empty if we're distcleaning ifneq "$$(INPLACE_BIN)" "" $$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG) $$(MKDIRHIER) - $$(MKDIRHIER) $$(dir $$@) - $$(CP) -p $$< $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(CP)" -p $$< $$@ touch $$@ endif diff --git a/rules/c-suffix-rules.mk b/rules/c-suffix-rules.mk index 5134b6ab28..f3e3ab6ca0 100644 --- a/rules/c-suffix-rules.mk +++ b/rules/c-suffix-rules.mk @@ -21,54 +21,54 @@ define c-suffix-rules ifeq "$4 $$(BootingFromHc)" "YES NO" $1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER) $$($1_$2_HC_DEP) - $$(RM) $$@ - $$(MKDIRHIER) $$(dir $$@) - $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c $$($1_$2_HC_DEP) - $$(RM) $$@ - $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s $$($1_$2_HC_DEP) - $$(RM) $$@ - $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER) $$($1_$2_HC_DEP) - $$(RM) $$@ - $$(MKDIRHIER) $$(dir $$@) - $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c $$($1_$2_HC_DEP) - $$(RM) $$@ - $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -S $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -S $$< -o $$@ $1/$2/build/%.$$($3_way_)s : $1/%.c $$($1_$2_HC_DEP) - $$(RM) $$@ - $$($1_$2_HC) $$($1_$2_$3_GHC_CC_OPTS) -S $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -S $$< -o $$@ else $1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER) - $$(RM) $$@ - $$(MKDIRHIER) $$(dir $$@) - $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c - $$(RM) $$@ - $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s - $$(RM) $$@ - $$(AS) $$($1_$2_$3_ALL_AS_OPTS) -o $$@ $$< + "$$(RM)" $$(RM_OPTS) $$@ + "$$(AS)" $$($1_$2_$3_ALL_AS_OPTS) -o $$@ $$< $1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER) - $$(RM) $$@ - $$(MKDIRHIER) $$(dir $$@) - $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c - $$(RM) $$@ - $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -S $$< -o $$@ + "$$(RM)" $$(RM_OPTS) $$@ + "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -S $$< -o $$@ endif diff --git a/rules/clean-target.mk b/rules/clean-target.mk index bc9e2da5f6..cf7c671e0b 100644 --- a/rules/clean-target.mk +++ b/rules/clean-target.mk @@ -17,5 +17,5 @@ clean : clean_$1 clean_$1 : clean_$1_$2 .PHONY: clean_$1_$2 clean_$1_$2: - $(RM) -rf $3 + "$$(RM)" $$(RM_OPTS) -r $3 endef diff --git a/rules/docbook.mk b/rules/docbook.mk index 75a69076ce..b25252c3d6 100644 --- a/rules/docbook.mk +++ b/rules/docbook.mk @@ -29,12 +29,12 @@ $(call all-target,$1,html_$1) html_$1 : $1/$2/index.html $1/$2/index.html: $$($1_DOCBOOK_SOURCES) - $$(RM) -r $$(dir $$@) - $$(XSLTPROC) --stringparam base.dir $$(dir $$@) \ - --stringparam use.id.as.filename 1 \ - --stringparam html.stylesheet fptools.css \ - $$(XSLTPROC_LABEL_OPTS) $$(XSLTPROC_OPTS) \ - $$(DIR_DOCBOOK_XSL)/html/chunk.xsl $1/$2.xml + "$$(RM)" $$(RM_OPTS) -r $$(dir $$@) + "$$(XSLTPROC)" --stringparam base.dir $$(dir $$@) \ + --stringparam use.id.as.filename 1 \ + --stringparam html.stylesheet fptools.css \ + $$(XSLTPROC_LABEL_OPTS) $$(XSLTPROC_OPTS) \ + $$(DIR_DOCBOOK_XSL)/html/chunk.xsl $1/$2.xml cp mk/fptools.css $$(dir $$@) endif @@ -45,7 +45,7 @@ $(call all-target,$1,ps_$1) ps_$1 : $1/$2.ps $1/$2.ps: $$($1_DOCBOOK_SOURCES) - $$(DBLATEX) $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@ + "$$(DBLATEX)" $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@ endif ifeq "$$(BUILD_DOCBOOK_PDF)" "YES" @@ -55,7 +55,7 @@ $(call all-target,$1,pdf_$1) pdf_$1 : $1/$2.pdf $1/$2.pdf: $$($1_DOCBOOK_SOURCES) - $$(DBLATEX) $$(DBLATEX_OPTS) $1/$2.xml --pdf -o $$@ + "$$(DBLATEX)" $$(DBLATEX_OPTS) $1/$2.xml --pdf -o $$@ endif endef diff --git a/rules/haddock.mk b/rules/haddock.mk index 371d5e14df..3f37a6452b 100644 --- a/rules/haddock.mk +++ b/rules/haddock.mk @@ -34,8 +34,8 @@ $1_$2_HADDOCK_FLAGS += --hyperlink-source endif $$($$($1_PACKAGE)_HADDOCK_FILE) : $$(MKDIRHIER) $$(INPLACE_BIN)/haddock$$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$($$($1_PACKAGE)_HADDOCK_DEPS) - $$(MKDIRHIER) $$(dir $$@) - $$(GHC_CABAL_INPLACE) haddock $2 $1 --with-haddock=$$(TOP)/$$(INPLACE_BIN)/haddock --with-ghc=$$(TOP)/$$(INPLACE_BIN)/ghc-stage2 $$($1_$2_HADDOCK_FLAGS) $$($1_$2_HADDOCK_OPTS) + "$$(MKDIRHIER)" $$(dir $$@) + "$$(GHC_CABAL_INPLACE)" haddock $2 $1 --with-haddock=$$(TOP)/$$(INPLACE_BIN)/haddock --with-ghc=$$(TOP)/$$(INPLACE_BIN)/ghc-stage2 $$($1_$2_HADDOCK_FLAGS) $$($1_$2_HADDOCK_OPTS) # Make the haddocking depend on the library .a file, to ensure # that we wait until the library is fully build before we haddock it diff --git a/rules/hs-suffix-rules-srcdir.mk b/rules/hs-suffix-rules-srcdir.mk index ceeede8e96..a08fac70e7 100644 --- a/rules/hs-suffix-rules-srcdir.mk +++ b/rules/hs-suffix-rules-srcdir.mk @@ -19,35 +19,35 @@ define hs-suffix-rules-srcdir ifneq "$$(BootingFromHc)" "YES" $1/$2/build/%.hs : $1/$4/%.ly $$(MKDIRHIER) - $$(MKDIRHIER) $$(dir $$@) - $$(HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(HAPPY)" $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ $1/$2/build/%.hs : $1/$4/%.y $$(MKDIRHIER) - $$(MKDIRHIER) $$(dir $$@) - $$(HAPPY) $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(HAPPY)" $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ $1/$2/build/%.hs : $1/$4/%.x $$(MKDIRHIER) - $$(MKDIRHIER) $$(dir $$@) - $$(ALEX) $$($1_$2_$3_ALL_ALEX_OPTS) $$< -o $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(ALEX)" $$($1_$2_$3_ALL_ALEX_OPTS) $$< -o $$@ $1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs : $1/$4/%.hsc $$(HSC2HS_INPLACE) - $$(MKDIRHIER) $$(dir $$@) - $$(HSC2HS_INPLACE) $$($1_$2_$3_ALL_HSC2HS_OPTS) $$< -o $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(HSC2HS_INPLACE)" $$($1_$2_$3_ALL_HSC2HS_OPTS) $$< -o $$@ touch $$(patsubst %.hsc,%_hsc.c,$$<) # Compiling Haskell source $1/$2/build/%.$$($3_osuf) : $1/$4/%.hs $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$4/%.lhs $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_hcsuf) : $1/$4/%.hs $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@ $1/$2/build/%.$$($3_hcsuf) : $1/$4/%.lhs $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@ endif @@ -55,34 +55,34 @@ endif # .hs->.o rule, I don't know why --SDM $1/$2/build/%.$$($3_osuf) : $1/$4/%.hc includes/ghcautoconf.h includes/ghcplatform.h $$(MKDIRHIER) - $$(MKDIRHIER) $$(dir $$@) - $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@ + "$$(MKDIRHIER)" $$(dir $$@) + "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hc includes/ghcautoconf.h includes/ghcplatform.h - $$(CC) $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@ + "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@ # $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)hc -# $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ +# "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ # # $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hc -# $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ +# "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ # # $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.$$($3_way_)hc -# $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -S $$< -o $$@ +# "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -S $$< -o $$@ # Now the rules for hs-boot files. $1/$2/build/%.hs-boot : $1/$4/%.hs-boot - $$(CP) $$< $$@ + "$$(CP)" $$< $$@ $1/$2/build/%.lhs-boot : $1/$4/%.lhs-boot - $$(CP) $$< $$@ + "$$(CP)" $$< $$@ $1/$2/build/%.$$($3_way_)o-boot : $1/$4/%.hs-boot $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)o-boot : $1/$4/%.lhs-boot $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ ifneq "$$(BootingFromHc)" "YES" # stubs are automatically generated and compiled by GHC diff --git a/rules/hs-suffix-rules.mk b/rules/hs-suffix-rules.mk index 263cbb2f4f..b5dc8fb02d 100644 --- a/rules/hs-suffix-rules.mk +++ b/rules/hs-suffix-rules.mk @@ -16,16 +16,16 @@ define hs-suffix-rules # args: $1 = dir, $2 = distdir, $3 = way ifneq "$$(BootingFromHc)" "YES" $1/$2/build/%.$$($3_hcsuf) : $1/$2/build/%.hs $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hs $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_hcsuf) : $1/$2/build/autogen/%.hs $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/autogen/%.hs $$($1_$2_HC_DEP) - $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ + "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ endif diff --git a/rules/manual-package-config.mk b/rules/manual-package-config.mk index 298fe47d48..da5cacffaf 100644 --- a/rules/manual-package-config.mk +++ b/rules/manual-package-config.mk @@ -14,20 +14,20 @@ define manual-package-config # args: $1 = dir $1/package.conf.inplace : $1/package.conf.in $(GHC_PKG_INPLACE) - $(CPP) $(RAWCPP_FLAGS) -P \ + $$(CPP) $$(RAWCPP_FLAGS) -P \ -DTOP='"$$(TOP)"' \ $$($1_PACKAGE_CPP_OPTS) \ -x c -I$$(GHC_INCLUDE_DIR) $$< | \ grep -v '^#pragma GCC' | \ sed -e 's/""//g' -e 's/:[ ]*,/: /g' >$$@ - $(GHC_PKG_INPLACE) update --force $$@ + "$$(GHC_PKG_INPLACE)" update --force $$@ # This is actually a real file, but we need to recreate it on every # "make install", so we declare it as phony .PHONY: $1/package.conf.install $1/package.conf.install: - $(CPP) $(RAWCPP_FLAGS) -P \ + $$(CPP) $$(RAWCPP_FLAGS) -P \ -DINSTALLING \ -DLIB_DIR='"$$(libdir)"' \ -DINCLUDE_DIR='"$$(libdir)/include"' \ @@ -39,6 +39,6 @@ $1/package.conf.install: distclean : clean_$1_package.conf .PHONY: clean_$1_package.conf clean_$1_package.conf : - $(RM) $1/package.conf.install $1/package.conf.inplace + "$$(RM)" $$(RM_OPTS) $1/package.conf.install $1/package.conf.inplace endef diff --git a/rules/package-config.mk b/rules/package-config.mk index 2801ff56b6..e1c563235e 100644 --- a/rules/package-config.mk +++ b/rules/package-config.mk @@ -17,7 +17,7 @@ $1_$2_HC = $$(GHC_STAGE$3) # configuration stuff that depends on which GHC we're building with ifeq "$3" "0" -$1_$2_ghc_ge_609 = $(ghc_ge_609) +$1_$2_ghc_ge_609 = $$(ghc_ge_609) $1_$2_HC_CONFIG = $$(GHC_STAGE0) $1_$2_HC_CONFIG_DEP = $1_$2_GHC_PKG = $$(GHC_PKG) @@ -28,7 +28,7 @@ $1_$2_HC_MK_DEPEND = $$($1_$2_HC) $1_$2_HC_MK_DEPEND_DEP = $1_$2_HC_DEP = ifeq "$$($1_$2_USE_BOOT_LIBS)" "YES" -$1_$2_HC_PKGCONF = -package-conf $(BOOTSTRAPPING_CONF) +$1_$2_HC_PKGCONF = -package-conf $$(BOOTSTRAPPING_CONF) $1_$2_GHC_PKG_OPTS = --package-conf=$$(BOOTSTRAPPING_CONF) $1_$2_CONFIGURE_OPTS += --package-db=$$(TOP)/$$(BOOTSTRAPPING_CONF) endif diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk index 742390b029..acdb06e72d 100644 --- a/rules/shell-wrapper.mk +++ b/rules/shell-wrapper.mk @@ -16,7 +16,7 @@ define shell-wrapper ifeq "$$($1_$2_SHELL_WRAPPER)" "YES" -ifeq "$(Windows)" "YES" +ifeq "$$(Windows)" "YES" ifeq "$$($1_$2_INSTALL_SHELL_WRAPPER)" "YES" # Just install the binary on Windows @@ -33,11 +33,11 @@ ifneq "$$($1_$2_INSTALL_INPLACE)" "NO" all_$1_$2 : $$(INPLACE_BIN)/$$($1_$2_PROG) $$(INPLACE_BIN)/$$($1_$2_PROG): $$($1_$2_INPLACE) - $$(RM) -f $$@ + "$$(RM)" $$(RM_OPTS) $$@ echo '#!$$(SHELL)' >> $$@ - echo 'executablename=$$(TOP)/$$<' >> $$@ - echo 'datadir=$$(TOP)/$$(INPLACE_LIB)' >> $$@ - echo 'bindir=$$(TOP)/$$(INPLACE_BIN)' >> $$@ + echo 'executablename=$$(TOP)/$$<' >> $$@ + echo 'datadir=$$(TOP)/$$(INPLACE_LIB)' >> $$@ + echo 'bindir=$$(TOP)/$$(INPLACE_BIN)' >> $$@ cat $$($1_$2_SHELL_WRAPPER_NAME) >> $$@ $$(EXECUTABLE_FILE) $$@ endif @@ -57,8 +57,8 @@ install: install_$1_$2_wrapper .PHONY: install_$1_$2_wrapper install_$1_$2_wrapper: WRAPPER=$$(DESTDIR)$$(bindir)/$$($1_$2_INSTALL_SHELL_WRAPPER_NAME) install_$1_$2_wrapper: - $$(MKDIRHIER) $$(DESTDIR)$$(bindir) - $$(RM) -f $$(WRAPPER) + "$$(MKDIRHIER)" $$(DESTDIR)$$(bindir) + "$$(RM)" $$(RM_OPTS) $$(WRAPPER) echo '#!$$(SHELL)' >> $$(WRAPPER) echo 'executablename=$$(libexecdir)/$$($1_$2_PROG)' >> $$(WRAPPER) echo 'datadir=$$(datadir)' >> $$(WRAPPER) diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk index 32f31b0a53..6ae87e5cc3 100644 --- a/utils/ghc-cabal/ghc.mk +++ b/utils/ghc-cabal/ghc.mk @@ -19,13 +19,13 @@ CABAL_VERSION := $(subst .,$(comma),$(CABAL_DOTTED_VERSION)) CABAL_CONSTRAINT := --constraint="Cabal == $(CABAL_DOTTED_VERSION)" $(GHC_CABAL_INPLACE) : $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext) - $(MKDIRHIER) $(dir $@) - $(CP) $< $@ + "$(MKDIRHIER)" $(dir $@) + "$(CP)" $< $@ $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/ghc-cabal.hs $(MKDIRHIER) - $(MKDIRHIER) bootstrapping - $(MKDIRHIER) $(dir $@) - $(GHC) $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \ + "$(MKDIRHIER)" bootstrapping + "$(MKDIRHIER)" $(dir $@) + "$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \ -Wall $(WERROR) \ -DCABAL_VERSION=$(CABAL_VERSION) \ -odir bootstrapping \ @@ -55,7 +55,7 @@ $(GHC_CABAL_DIR)_dist-dummy-ghc_PROG = dummy-ghc$(exeext) # depend on config.mk, so we pick up the new version number if it changes. $(GHC_CABAL_DIR)/dist-dummy-ghc/build/dummy-ghc.hs : $(GHC_CABAL_DIR)/ghc.mk $(MKDIRHIER) mk/config.mk - $(MKDIRHIER) $(dir $@) + "$(MKDIRHIER)" $(dir $@) echo "import System.Environment; import System.Cmd; import System.Exit" >$@ echo "main :: IO ()" >>$@ echo "main = do args <- getArgs; if args == [\"--numeric-version\"] then putStrLn \"$(ProjectVersion)\" else do e <- rawSystem \"$(GHC_STAGE0)\" args; exitWith e" >>$@ diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk index 1afd962112..0c99661ec6 100644 --- a/utils/ghc-pkg/ghc.mk +++ b/utils/ghc-pkg/ghc.mk @@ -21,7 +21,7 @@ inplace/bin/ghc-pkg : utils/ghc-pkg/dist-install/build/tmp/$(utils/ghc-pkg_dist_ ifeq "$(Windows)" "YES" cp $< $@ else - $(RM) $@ + "$(RM)" $(RM_OPTS) $@ echo "#!/bin/sh" >>$@ echo "PKGCONF=$(TOP)/$(INPLACE_PACKAGE_CONF)" >>$@ echo '$(TOP)/$< --global-conf $$PKGCONF $${1+"$$@"}' >> $@ @@ -31,12 +31,12 @@ endif else $(GHC_PKG_INPLACE) : utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext) $(MKDIRHIER) - $(MKDIRHIER) $(dir $(INPLACE_PACKAGE_CONF)) + "$(MKDIRHIER)" $(dir $(INPLACE_PACKAGE_CONF)) echo "[]" > $(INPLACE_PACKAGE_CONF) ifeq "$(Windows)" "YES" cp $< $@ else - $(RM) $@ + "$(RM)" $(RM_OPTS) $@ echo "#!/bin/sh" >>$@ echo "PKGCONF=$(TOP)/$(INPLACE_PACKAGE_CONF)" >>$@ echo '$(TOP)/$< --global-conf $$PKGCONF $${1+"$$@"}' >> $@ @@ -47,9 +47,9 @@ endif # depend on ghc-cabal, otherwise we build Cabal twice when building in parallel utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext): utils/ghc-pkg/Main.hs utils/ghc-pkg/Version.hs $(GHC_CABAL_INPLACE) $(MKDIRHIER) - $(MKDIRHIER) bootstrapping - $(MKDIRHIER) utils/ghc-pkg/dist/build - $(GHC) $(SRC_HC_OPTS) --make utils/ghc-pkg/Main.hs -o $@ \ + "$(MKDIRHIER)" bootstrapping + "$(MKDIRHIER)" utils/ghc-pkg/dist/build + "$(GHC)" $(SRC_HC_OPTS) --make utils/ghc-pkg/Main.hs -o $@ \ -Wall \ -DCABAL_VERSION=$(CABAL_VERSION) \ -odir bootstrapping \ @@ -62,7 +62,7 @@ utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext): utils/ghc-pkg/Main -ilibraries/hpc utils/ghc-pkg/Version.hs: mk/config.mk - $(RM) -f $@ + "$(RM)" $(RM_OPTS) $@ echo "module Version where" >> $@ echo "version, targetOS, targetARCH :: String" >> $@ echo "version = \"$(ProjectVersion)\"" >> $@ @@ -95,8 +95,8 @@ install: install_utils/ghc-pkg_link .PNONY: install_utils/ghc-pkg_link install_utils/ghc-pkg_link: - $(MKDIRHIER) $(DESTDIR)$(bindir) - $(RM) -f $(DESTDIR)$(bindir)/ghc-pkg + "$(MKDIRHIER)" $(DESTDIR)$(bindir) + "$(RM)" $(RM_OPTS) $(DESTDIR)$(bindir)/ghc-pkg $(LN_S) ghc-pkg-$(ProjectVersion) $(DESTDIR)$(bindir)/ghc-pkg endif diff --git a/utils/mkdependC/ghc.mk b/utils/mkdependC/ghc.mk index d49c5cf2f2..1fa673a767 100644 --- a/utils/mkdependC/ghc.mk +++ b/utils/mkdependC/ghc.mk @@ -11,8 +11,8 @@ # ----------------------------------------------------------------------------- $(MKDEPENDC) : utils/mkdependC/mkdependC.prl $(MKDIRHIER) - $(MKDIRHIER) $(dir $@) - $(RM) -f $@ + "$(MKDIRHIER)" $(dir $@) + "$(RM)" $(RM_OPTS) $@ echo '#!$(PERL)' >> $@ echo '$$DEFAULT_TMPDIR = "$(DEFAULT_TMPDIR)";' >> $@ echo '$$CPP = "$(CPP)";' >> $@ diff --git a/utils/mkdirhier/ghc.mk b/utils/mkdirhier/ghc.mk index 4ea063088f..5bc5fabf0f 100644 --- a/utils/mkdirhier/ghc.mk +++ b/utils/mkdirhier/ghc.mk @@ -14,7 +14,7 @@ $(MKDIRHIER) : utils/mkdirhier/mkdirhier.sh -mkdir $(INPLACE) -mkdir $(INPLACE_BIN) -mkdir $(INPLACE_LIB) - $(RM) -f $@ + "$(RM)" $(RM_OPTS) -f $@ echo '#!$(SHELL)' >> $@ cat utils/mkdirhier/mkdirhier.sh >> $@ $(EXECUTABLE_FILE) $@ diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk index 09d8044fee..7d6769d1a9 100644 --- a/utils/runghc/ghc.mk +++ b/utils/runghc/ghc.mk @@ -20,8 +20,8 @@ ifneq "$(BINDIST)" "YES" # hack: the build system has trouble with Main modules not called Main.hs utils/runghc/dist/build/Main.hs : utils/runghc/runghc.hs $(MKDIRHIER) - $(MKDIRHIER) $(dir $@) - $(CP) $< $@ + "$(MKDIRHIER)" $(dir $@) + "$(CP)" $< $@ $(eval $(call build-prog,utils/runghc,dist,1)) @@ -32,10 +32,10 @@ install: install_runhaskell .PHONY: install_runhaskell ifeq "$(Windows)" "YES" install_runhaskell: install_bins - $(CP) $(DESTDIR)$(bindir)/runghc$(exeext) $(DESTDIR)$(bindir)/runhaskell$(exeext) + "$(CP)" $(DESTDIR)$(bindir)/runghc$(exeext) $(DESTDIR)$(bindir)/runhaskell$(exeext) else install_runhaskell: - $(RM) $(DESTDIR)$(bindir)/runhaskell + "$(RM)" $(RM_OPTS) $(DESTDIR)$(bindir)/runhaskell $(LN_S) runghc $(DESTDIR)$(bindir)/runhaskell endif |