diff options
-rw-r--r-- | compiler/ghc.mk | 6 | ||||
-rw-r--r-- | ghc.mk | 22 | ||||
-rw-r--r-- | rts/ghc.mk | 6 | ||||
-rw-r--r-- | rules/build-dependencies.mk | 3 | ||||
-rw-r--r-- | rules/build-perl.mk | 6 | ||||
-rw-r--r-- | rules/build-prog.mk | 9 | ||||
-rw-r--r-- | rules/c-suffix-rules.mk | 12 | ||||
-rw-r--r-- | rules/cmm-suffix-rules.mk | 18 | ||||
-rw-r--r-- | rules/haddock.mk | 3 | ||||
-rw-r--r-- | rules/hs-suffix-rules-srcdir.mk | 15 | ||||
-rw-r--r-- | utils/ghc-cabal/ghc.mk | 10 | ||||
-rw-r--r-- | utils/ghc-pkg/ghc.mk | 7 | ||||
-rw-r--r-- | utils/mkdependC/ghc.mk | 3 | ||||
-rw-r--r-- | utils/runghc/ghc.mk | 3 |
14 files changed, 49 insertions, 74 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 70c95f3426..6f781925db 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -141,8 +141,7 @@ $(eval $(call clean-target,compiler,config_hs,$(compiler_CONFIG_HS))) PLATFORM_H = ghc_boot_platform.h -compiler/stage1/$(PLATFORM_H) : mk/config.mk mk/project.mk - "$(MKDIRHIER)" $(dir $@) +compiler/stage1/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/. "$(RM)" $(RM_OPTS) $@ @echo "Creating $@..." @echo "#ifndef __PLATFORM_H__" >$@ @@ -188,8 +187,7 @@ endif # For stage2 and above, the BUILD platform is the HOST of stage1, and # 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 mk/project.mk - "$(MKDIRHIER)" $(dir $@) +compiler/stage2/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/. "$(RM)" $(RM_OPTS) $@ @echo "Creating $@..." @echo "#ifndef __PLATFORM_H__" >$@ @@ -83,6 +83,11 @@ .PHONY: default all haddock +# We need second expansion for the way we handle directories, so that +# | $$$$(dir $$$$@)/. +# expands to the directoy of a rule that uses a % pattern. +.SECONDEXPANSION: + default : all # Catch make if it runs away into an infinite loop @@ -398,6 +403,12 @@ rts/package.conf.inplace : libffi/package.conf.inplace endif # ----------------------------------------------------------------------------- +# Directories + +%/. : $(MKDIRHIER) + "$(MKDIRHIER)" $@ + +# ----------------------------------------------------------------------------- # Special magic for the ghc-prim package # We want the ghc-prim package to include the GHC.Prim module when it @@ -417,8 +428,7 @@ endef PRIMOPS_TXT = $(GHC_COMPILER_DIR)/prelude/primops.txt -libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs : $(GENPRIMOP_INPLACE) $(PRIMOPS_TXT) - "$(MKDIRHIER)" $(dir $@) +libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs : $(GENPRIMOP_INPLACE) $(PRIMOPS_TXT) | $$(dir $$@)/. "$(GENPRIMOP_INPLACE)" --make-haskell-wrappers <$(PRIMOPS_TXT) >$@ libraries/ghc-prim/GHC/Prim.hs : $(GENPRIMOP_INPLACE) $(PRIMOPS_TXT) @@ -702,13 +712,13 @@ libraries/ghc-prim/dist-install/doc/html/ghc-prim/ghc-prim.haddock: \ libraries/ghc-prim/dist-install/build/autogen/GHC/PrimopWrappers.hs libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs: \ - $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) $(MKDIRHIER) - "$(MKDIRHIER)" $(dir $@) + $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) \ + | $$(dir $$@)/. "$(GENPRIMOP_INPLACE)" --make-haskell-source < $< > $@ libraries/ghc-prim/dist-install/build/autogen/GHC/PrimopWrappers.hs: \ - $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) $(MKDIRHIER) - "$(MKDIRHIER)" $(dir $@) + $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) \ + | $$(dir $$@)/. "$(GENPRIMOP_INPLACE)" --make-haskell-wrappers < $< > $@ # ----------------------------------------------------------------------------- diff --git a/rts/ghc.mk b/rts/ghc.mk index 3a746a9972..aee28ba8e6 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -62,11 +62,9 @@ rts_AUTO_APPLY_CMM = rts/dist/build/AutoApply.cmm $(rts_AUTO_APPLY_CMM): $(GENAPPLY_INPLACE) "$(GENAPPLY_INPLACE)" >$@ -rts/dist/build/sm/Evac_thr.c : rts/sm/Evac.c - "$(MKDIRHIER)" $(dir $@) +rts/dist/build/sm/Evac_thr.c : rts/sm/Evac.c | $$(dir $$@)/. cp $< $@ -rts/dist/build/sm/Scav_thr.c : rts/sm/Scav.c - "$(MKDIRHIER)" $(dir $@) +rts/dist/build/sm/Scav_thr.c : rts/sm/Scav.c | $$(dir $$@)/. cp $< $@ rts_H_FILES = $(wildcard includes/*.h) $(wildcard rts/*.h) diff --git a/rules/build-dependencies.mk b/rules/build-dependencies.mk index 2ab503f1b6..68d45c82b6 100644 --- a/rules/build-dependencies.mk +++ b/rules/build-dependencies.mk @@ -21,8 +21,7 @@ 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 +$$($1_$2_depfile) : $$(MKDEPENDC) $$($1_$2_HS_SRCS) $$($1_$2_HS_BOOT_SRCS) $$($1_$2_HC_MK_DEPEND_DEP) $$($1_$2_C_FILES) $$($1_$2_S_FILES) | $$$$(dir $$$$@)/. "$$(RM)" $$(RM_OPTS) $$@.tmp touch $$@.tmp ifneq "$$($1_$2_C_SRCS)$$($1_$2_S_SRCS)" "" diff --git a/rules/build-perl.mk b/rules/build-perl.mk index 86f729fbb1..669f3d7be4 100644 --- a/rules/build-perl.mk +++ b/rules/build-perl.mk @@ -37,8 +37,7 @@ clean_$1 : clean_$1_$2 # INPLACE_BIN etc. might be empty if we're cleaning ifeq "$(findstring clean,$(MAKECMDGOALS))" "" ifneq "$$(BINDIST)" "YES" -$1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$(UNLIT) - "$$(MKDIRHIER)" $1/$2 +$1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$(UNLIT) | $$$$(dir $$$$@)/. "$$(UNLIT)" $$(UNLIT_OPTS) $$< $$@ $1/$2/$$($1_$2_PROG): $1/$2/$$($1_$2_PROG).prl @@ -48,8 +47,7 @@ $1/$2/$$($1_$2_PROG): $1/$2/$$($1_$2_PROG).prl cat $$< >> $$@ $$(EXECUTABLE_FILE) $$@ -$$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) - "$$(MKDIRHIER)" $$(dir $$@) +$$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) | $$$$(dir $$$$@)/. "$$(CP)" $$< $$@ $$(EXECUTABLE_FILE) $$@ endif diff --git a/rules/build-prog.mk b/rules/build-prog.mk index b975f4956f..0a801afabf 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -96,12 +96,10 @@ $(call c-objs,$1,$2,v) $(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/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(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 $$@) +$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) | $$$$(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 @@ -136,8 +134,7 @@ $(call clean-target,$1,$2_inplace,$$($1_$2_INPLACE)) # INPLACE_BIN might be empty if we're distcleaning ifeq "$(findstring clean,$(MAKECMDGOALS))" "" -$$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG) $$(MKDIRHIER) - "$$(MKDIRHIER)" $$(dir $$@) +$$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG) | $$$$(dir $$$$@)/. "$$(CP)" -p $$< $$@ touch $$@ endif diff --git a/rules/c-suffix-rules.mk b/rules/c-suffix-rules.mk index 5b4cc6e914..cc7c219bb4 100644 --- a/rules/c-suffix-rules.mk +++ b/rules/c-suffix-rules.mk @@ -20,8 +20,7 @@ define c-suffix-rules # UseGhcForCc is only relevant when not booting from HC files. ifeq "$4 $$(BootingFromHc)" "YES NO" -$1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER) $$($1_$2_HC_DEP) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_osuf) : $1/%.c $$($1_$2_HC_DEP) | $$$$(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) @@ -30,8 +29,7 @@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c $$($1_$2_HC_DEP) $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s $$($1_$2_HC_DEP) "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ -$1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER) $$($1_$2_HC_DEP) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_osuf) : $1/%.S $$($1_$2_HC_DEP) | $$$$(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) @@ -42,8 +40,7 @@ $1/$2/build/%.$$($3_way_)s : $1/%.c $$($1_$2_HC_DEP) else -$1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_osuf) : $1/%.c | $$$$(dir $$$$@)/. "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c @@ -52,8 +49,7 @@ $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s "$$(AS)" $$($1_$2_$3_ALL_AS_OPTS) -o $$@ $$< -$1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_osuf) : $1/%.S | $$$$(dir $$$$@)/. "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c diff --git a/rules/cmm-suffix-rules.mk b/rules/cmm-suffix-rules.mk index 0cb1c453c1..b806414a43 100644 --- a/rules/cmm-suffix-rules.mk +++ b/rules/cmm-suffix-rules.mk @@ -22,28 +22,22 @@ ifneq "$$(CLEANING)" "YES" ifneq "$$(BootingFromHc)" "YES" -$1/$2/build/%.$$($3_way_)o : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_way_)o : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/. "$$($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_DEP) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_way_)o : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/. "$$($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_DEP) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_way_)hc : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/. "$$($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_DEP) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_way_)hc : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/. "$$($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_DEP) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_way_)s : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/. "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@ -$1/$2/build/%.$$($3_way_)s : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.$$($3_way_)s : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/. "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@ endif diff --git a/rules/haddock.mk b/rules/haddock.mk index a6ad82ef3d..5e5b2f25ac 100644 --- a/rules/haddock.mk +++ b/rules/haddock.mk @@ -37,8 +37,7 @@ ifeq "$$(HSCOLOUR_SRCS)" "YES" $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 $$@) +$$($$($1_PACKAGE)_HADDOCK_FILE) : $$(INPLACE_BIN)/haddock$$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$($$($1_PACKAGE)_HADDOCK_DEPS) | $$$$(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 diff --git a/rules/hs-suffix-rules-srcdir.mk b/rules/hs-suffix-rules-srcdir.mk index 1829057318..168a880521 100644 --- a/rules/hs-suffix-rules-srcdir.mk +++ b/rules/hs-suffix-rules-srcdir.mk @@ -18,20 +18,16 @@ define hs-suffix-rules-srcdir ifneq "$$(BootingFromHc)" "YES" -$1/$2/build/%.hs : $1/$4/%.ly $$(MKDIRHIER) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.hs : $1/$4/%.ly | $$$$(dir $$$$@)/. "$$(HAPPY)" $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ -$1/$2/build/%.hs : $1/$4/%.y $$(MKDIRHIER) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.hs : $1/$4/%.y | $$$$(dir $$$$@)/. "$$(HAPPY)" $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ -$1/$2/build/%.hs : $1/$4/%.x $$(MKDIRHIER) - "$$(MKDIRHIER)" $$(dir $$@) +$1/$2/build/%.hs : $1/$4/%.x | $$$$(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 $$@) +$1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs : $1/$4/%.hsc $$(HSC2HS_INPLACE) | $$$$(dir $$$$@)/. "$$(HSC2HS_INPLACE)" $$($1_$2_$3_ALL_HSC2HS_OPTS) $$< -o $$@ # Compiling Haskell source @@ -53,8 +49,7 @@ endif # XXX: for some reason these get used in preference to the direct # .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 $$@) +$1/$2/build/%.$$($3_osuf) : $1/$4/%.hc includes/ghcautoconf.h includes/ghcplatform.h | $$$$(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 diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk index c41cd01cd8..71232fb422 100644 --- a/utils/ghc-cabal/ghc.mk +++ b/utils/ghc-cabal/ghc.mk @@ -18,13 +18,10 @@ CABAL_DOTTED_VERSION := $(shell grep "^Version:" libraries/Cabal/Cabal.cabal | s 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 $@) +$(GHC_CABAL_INPLACE) : $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext) | $$(dir $$@)/. "$(CP)" $< $@ -$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/ghc-cabal.hs $(MKDIRHIER) - "$(MKDIRHIER)" bootstrapping - "$(MKDIRHIER)" $(dir $@) +$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/ghc-cabal.hs | $$(dir $$@)/. bootstrapping/. "$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \ -Wall $(WERROR) \ -DCABAL_VERSION=$(CABAL_VERSION) \ @@ -54,8 +51,7 @@ $(GHC_CABAL_DIR)_dist-dummy-ghc_MODULES = dummy-ghc $(GHC_CABAL_DIR)_dist-dummy-ghc_PROG = dummy-ghc$(exeext) # depend on project.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/project.mk - "$(MKDIRHIER)" $(dir $@) +$(GHC_CABAL_DIR)/dist-dummy-ghc/build/dummy-ghc.hs : $(GHC_CABAL_DIR)/ghc.mk mk/project.mk | $$(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 679570315f..d5ee062419 100644 --- a/utils/ghc-pkg/ghc.mk +++ b/utils/ghc-pkg/ghc.mk @@ -30,8 +30,7 @@ endif else -$(GHC_PKG_INPLACE) : utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext) $(MKDIRHIER) - "$(MKDIRHIER)" $(INPLACE_PACKAGE_CONF) +$(GHC_PKG_INPLACE) : utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext) | $$(dir $$@)/. $(INPLACE_PACKAGE_CONF)/. "$(RM)" $(RM_OPTS) $(INPLACE_PACKAGE_CONF)/* ifeq "$(Windows)" "YES" cp $< $@ @@ -47,9 +46,7 @@ endif # depend on ghc-cabal, otherwise we build Cabal twice when building in parallel # The binary package is not warning-clean, so we need a few -fno-warns here. -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 +utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext): utils/ghc-pkg/Main.hs utils/ghc-pkg/Version.hs $(GHC_CABAL_INPLACE) | bootstrapping/. $$(dir $$@)/. "$(GHC)" $(SRC_HC_OPTS) --make utils/ghc-pkg/Main.hs -o $@ \ -Wall -fno-warn-unused-imports \ -DCABAL_VERSION=$(CABAL_VERSION) \ diff --git a/utils/mkdependC/ghc.mk b/utils/mkdependC/ghc.mk index 1fa673a767..229e3ee40e 100644 --- a/utils/mkdependC/ghc.mk +++ b/utils/mkdependC/ghc.mk @@ -10,8 +10,7 @@ # # ----------------------------------------------------------------------------- -$(MKDEPENDC) : utils/mkdependC/mkdependC.prl $(MKDIRHIER) - "$(MKDIRHIER)" $(dir $@) +$(MKDEPENDC) : utils/mkdependC/mkdependC.prl | $$(dir $$@)/. "$(RM)" $(RM_OPTS) $@ echo '#!$(PERL)' >> $@ echo '$$DEFAULT_TMPDIR = "$(DEFAULT_TMPDIR)";' >> $@ diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk index b43634eaab..8892ce0c82 100644 --- a/utils/runghc/ghc.mk +++ b/utils/runghc/ghc.mk @@ -18,8 +18,7 @@ utils/runghc_dist_INSTALL_SHELL_WRAPPER = YES 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 $@) +utils/runghc/dist/build/Main.hs : utils/runghc/runghc.hs | $$(dir $$@)/. "$(CP)" $< $@ endif |