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 /rules | |
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.
Diffstat (limited to 'rules')
-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 |
15 files changed, 107 insertions, 107 deletions
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) |