Commit 883d9808 authored by Ian Lynagh's avatar Ian Lynagh

Use "order only constraints" for directories

There are now 104 calls to mkdirhier, down from 1201, when validating.
parent 6a2a2197
...@@ -141,8 +141,7 @@ $(eval $(call clean-target,compiler,config_hs,$(compiler_CONFIG_HS))) ...@@ -141,8 +141,7 @@ $(eval $(call clean-target,compiler,config_hs,$(compiler_CONFIG_HS)))
PLATFORM_H = ghc_boot_platform.h PLATFORM_H = ghc_boot_platform.h
compiler/stage1/$(PLATFORM_H) : mk/config.mk mk/project.mk compiler/stage1/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
"$(RM)" $(RM_OPTS) $@ "$(RM)" $(RM_OPTS) $@
@echo "Creating $@..." @echo "Creating $@..."
@echo "#ifndef __PLATFORM_H__" >$@ @echo "#ifndef __PLATFORM_H__" >$@
...@@ -188,8 +187,7 @@ endif ...@@ -188,8 +187,7 @@ endif
# For stage2 and above, the BUILD platform is the HOST of stage1, and # 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 # the HOST platform is the TARGET of stage1. The TARGET remains the same
# (stage1 is the cross-compiler, not stage2). # (stage1 is the cross-compiler, not stage2).
compiler/stage2/$(PLATFORM_H) : mk/config.mk mk/project.mk compiler/stage2/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
"$(RM)" $(RM_OPTS) $@ "$(RM)" $(RM_OPTS) $@
@echo "Creating $@..." @echo "Creating $@..."
@echo "#ifndef __PLATFORM_H__" >$@ @echo "#ifndef __PLATFORM_H__" >$@
......
...@@ -83,6 +83,11 @@ ...@@ -83,6 +83,11 @@
.PHONY: default all haddock .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 default : all
# Catch make if it runs away into an infinite loop # Catch make if it runs away into an infinite loop
...@@ -397,6 +402,12 @@ libraries/ghc-prim/dist-install/package-data.mk : rts/package.conf.inplace ...@@ -397,6 +402,12 @@ libraries/ghc-prim/dist-install/package-data.mk : rts/package.conf.inplace
rts/package.conf.inplace : libffi/package.conf.inplace rts/package.conf.inplace : libffi/package.conf.inplace
endif endif
# -----------------------------------------------------------------------------
# Directories
%/. : $(MKDIRHIER)
"$(MKDIRHIER)" $@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Special magic for the ghc-prim package # Special magic for the ghc-prim package
...@@ -417,8 +428,7 @@ endef ...@@ -417,8 +428,7 @@ endef
PRIMOPS_TXT = $(GHC_COMPILER_DIR)/prelude/primops.txt PRIMOPS_TXT = $(GHC_COMPILER_DIR)/prelude/primops.txt
libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs : $(GENPRIMOP_INPLACE) $(PRIMOPS_TXT) libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs : $(GENPRIMOP_INPLACE) $(PRIMOPS_TXT) | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
"$(GENPRIMOP_INPLACE)" --make-haskell-wrappers <$(PRIMOPS_TXT) >$@ "$(GENPRIMOP_INPLACE)" --make-haskell-wrappers <$(PRIMOPS_TXT) >$@
libraries/ghc-prim/GHC/Prim.hs : $(GENPRIMOP_INPLACE) $(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: \ ...@@ -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/PrimopWrappers.hs
libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs: \ libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs: \
$(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) $(MKDIRHIER) $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) \
"$(MKDIRHIER)" $(dir $@) | $$(dir $$@)/.
"$(GENPRIMOP_INPLACE)" --make-haskell-source < $< > $@ "$(GENPRIMOP_INPLACE)" --make-haskell-source < $< > $@
libraries/ghc-prim/dist-install/build/autogen/GHC/PrimopWrappers.hs: \ libraries/ghc-prim/dist-install/build/autogen/GHC/PrimopWrappers.hs: \
$(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) $(MKDIRHIER) $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) \
"$(MKDIRHIER)" $(dir $@) | $$(dir $$@)/.
"$(GENPRIMOP_INPLACE)" --make-haskell-wrappers < $< > $@ "$(GENPRIMOP_INPLACE)" --make-haskell-wrappers < $< > $@
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
......
...@@ -62,11 +62,9 @@ rts_AUTO_APPLY_CMM = rts/dist/build/AutoApply.cmm ...@@ -62,11 +62,9 @@ rts_AUTO_APPLY_CMM = rts/dist/build/AutoApply.cmm
$(rts_AUTO_APPLY_CMM): $(GENAPPLY_INPLACE) $(rts_AUTO_APPLY_CMM): $(GENAPPLY_INPLACE)
"$(GENAPPLY_INPLACE)" >$@ "$(GENAPPLY_INPLACE)" >$@
rts/dist/build/sm/Evac_thr.c : rts/sm/Evac.c rts/dist/build/sm/Evac_thr.c : rts/sm/Evac.c | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
cp $< $@ cp $< $@
rts/dist/build/sm/Scav_thr.c : rts/sm/Scav.c rts/dist/build/sm/Scav_thr.c : rts/sm/Scav.c | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
cp $< $@ cp $< $@
rts_H_FILES = $(wildcard includes/*.h) $(wildcard rts/*.h) rts_H_FILES = $(wildcard includes/*.h) $(wildcard rts/*.h)
......
...@@ -21,8 +21,7 @@ endif ...@@ -21,8 +21,7 @@ endif
ifneq "$$($1_$2_NO_BUILD_DEPS)" "YES" 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) $$($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 $$$$@)/.
"$$(MKDIRHIER)" $1/$2/build
"$$(RM)" $$(RM_OPTS) $$@.tmp "$$(RM)" $$(RM_OPTS) $$@.tmp
touch $$@.tmp touch $$@.tmp
ifneq "$$($1_$2_C_SRCS)$$($1_$2_S_SRCS)" "" ifneq "$$($1_$2_C_SRCS)$$($1_$2_S_SRCS)" ""
......
...@@ -37,8 +37,7 @@ clean_$1 : clean_$1_$2 ...@@ -37,8 +37,7 @@ clean_$1 : clean_$1_$2
# INPLACE_BIN etc. might be empty if we're cleaning # INPLACE_BIN etc. might be empty if we're cleaning
ifeq "$(findstring clean,$(MAKECMDGOALS))" "" ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifneq "$$(BINDIST)" "YES" ifneq "$$(BINDIST)" "YES"
$1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$(UNLIT) $1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$(UNLIT) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $1/$2
"$$(UNLIT)" $$(UNLIT_OPTS) $$< $$@ "$$(UNLIT)" $$(UNLIT_OPTS) $$< $$@
$1/$2/$$($1_$2_PROG): $1/$2/$$($1_$2_PROG).prl $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 ...@@ -48,8 +47,7 @@ $1/$2/$$($1_$2_PROG): $1/$2/$$($1_$2_PROG).prl
cat $$< >> $$@ cat $$< >> $$@
$$(EXECUTABLE_FILE) $$@ $$(EXECUTABLE_FILE) $$@
$$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) $$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(CP)" $$< $$@ "$$(CP)" $$< $$@
$$(EXECUTABLE_FILE) $$@ $$(EXECUTABLE_FILE) $$@
endif endif
......
...@@ -96,12 +96,10 @@ $(call c-objs,$1,$2,v) ...@@ -96,12 +96,10 @@ $(call c-objs,$1,$2,v)
$(call hs-objs,$1,$2,v) $(call hs-objs,$1,$2,v)
ifeq "$$(BootingFromHc)" "NO" 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) $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 $$$$@)/.
"$$(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) "$$($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 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) $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 $$$$@)/.
"$$(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) "$$(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 endif
...@@ -136,8 +134,7 @@ $(call clean-target,$1,$2_inplace,$$($1_$2_INPLACE)) ...@@ -136,8 +134,7 @@ $(call clean-target,$1,$2_inplace,$$($1_$2_INPLACE))
# INPLACE_BIN might be empty if we're distcleaning # INPLACE_BIN might be empty if we're distcleaning
ifeq "$(findstring clean,$(MAKECMDGOALS))" "" ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
$$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG) $$(MKDIRHIER) $$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(CP)" -p $$< $$@ "$$(CP)" -p $$< $$@
touch $$@ touch $$@
endif endif
......
...@@ -20,8 +20,7 @@ define c-suffix-rules ...@@ -20,8 +20,7 @@ define c-suffix-rules
# UseGhcForCc is only relevant when not booting from HC files. # UseGhcForCc is only relevant when not booting from HC files.
ifeq "$4 $$(BootingFromHc)" "YES NO" ifeq "$4 $$(BootingFromHc)" "YES NO"
$1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER) $$($1_$2_HC_DEP) $1/$2/build/%.$$($3_osuf) : $1/%.c $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ "$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
$1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c $$($1_$2_HC_DEP) $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) ...@@ -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/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_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@
$1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER) $$($1_$2_HC_DEP) $1/$2/build/%.$$($3_osuf) : $1/%.S $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$($1_$2_HC)" $$($1_$2_$3_GHC_CC_OPTS) -c $$< -o $$@ "$$($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) $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) ...@@ -42,8 +40,7 @@ $1/$2/build/%.$$($3_way_)s : $1/%.c $$($1_$2_HC_DEP)
else else
$1/$2/build/%.$$($3_osuf) : $1/%.c $$(MKDIRHIER) $1/$2/build/%.$$($3_osuf) : $1/%.c | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
$1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.c
...@@ -52,8 +49,7 @@ $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 $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)s
"$$(AS)" $$($1_$2_$3_ALL_AS_OPTS) -o $$@ $$< "$$(AS)" $$($1_$2_$3_ALL_AS_OPTS) -o $$@ $$<
$1/$2/build/%.$$($3_osuf) : $1/%.S $$(MKDIRHIER) $1/$2/build/%.$$($3_osuf) : $1/%.S | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@ "$$(CC)" $$($1_$2_$3_ALL_CC_OPTS) -c $$< -o $$@
$1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.c
......
...@@ -22,28 +22,22 @@ ifneq "$$(CLEANING)" "YES" ...@@ -22,28 +22,22 @@ ifneq "$$(CLEANING)" "YES"
ifneq "$$(BootingFromHc)" "YES" ifneq "$$(BootingFromHc)" "YES"
$1/$2/build/%.$$($3_way_)o : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) $1/$2/build/%.$$($3_way_)o : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$($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_DEP) $1/$2/build/%.$$($3_way_)o : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$($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_DEP) $1/$2/build/%.$$($3_way_)hc : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$($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_DEP) $1/$2/build/%.$$($3_way_)hc : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$($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_DEP) $1/$2/build/%.$$($3_way_)s : $1/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@ "$$($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) $1/$2/build/%.$$($3_way_)s : $1/$2/build/%.cmm $$(rts_H_FILES) $$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@ "$$($1_$2_HC)" $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@
endif endif
......
...@@ -37,8 +37,7 @@ ifeq "$$(HSCOLOUR_SRCS)" "YES" ...@@ -37,8 +37,7 @@ ifeq "$$(HSCOLOUR_SRCS)" "YES"
$1_$2_HADDOCK_FLAGS += --hyperlink-source $1_$2_HADDOCK_FLAGS += --hyperlink-source
endif endif
$$($$($1_PACKAGE)_HADDOCK_FILE) : $$(MKDIRHIER) $$(INPLACE_BIN)/haddock$$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$($$($1_PACKAGE)_HADDOCK_DEPS) $$($$($1_PACKAGE)_HADDOCK_FILE) : $$(INPLACE_BIN)/haddock$$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$($$($1_PACKAGE)_HADDOCK_DEPS) | $$$$(dir $$$$@)/.
"$$(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) "$$(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 # Make the haddocking depend on the library .a file, to ensure
......
...@@ -18,20 +18,16 @@ define hs-suffix-rules-srcdir ...@@ -18,20 +18,16 @@ define hs-suffix-rules-srcdir
ifneq "$$(BootingFromHc)" "YES" ifneq "$$(BootingFromHc)" "YES"
$1/$2/build/%.hs : $1/$4/%.ly $$(MKDIRHIER) $1/$2/build/%.hs : $1/$4/%.ly | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(HAPPY)" $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ "$$(HAPPY)" $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@
$1/$2/build/%.hs : $1/$4/%.y $$(MKDIRHIER) $1/$2/build/%.hs : $1/$4/%.y | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(HAPPY)" $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@ "$$(HAPPY)" $$($1_$2_$3_ALL_HAPPY_OPTS) $$< -o $$@
$1/$2/build/%.hs : $1/$4/%.x $$(MKDIRHIER) $1/$2/build/%.hs : $1/$4/%.x | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(ALEX)" $$($1_$2_$3_ALL_ALEX_OPTS) $$< -o $$@ "$$(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) $1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs : $1/$4/%.hsc $$(HSC2HS_INPLACE) | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(HSC2HS_INPLACE)" $$($1_$2_$3_ALL_HSC2HS_OPTS) $$< -o $$@ "$$(HSC2HS_INPLACE)" $$($1_$2_$3_ALL_HSC2HS_OPTS) $$< -o $$@
# Compiling Haskell source # Compiling Haskell source
...@@ -53,8 +49,7 @@ endif ...@@ -53,8 +49,7 @@ endif
# XXX: for some reason these get used in preference to the direct # XXX: for some reason these get used in preference to the direct
# .hs->.o rule, I don't know why --SDM # .hs->.o rule, I don't know why --SDM
$1/$2/build/%.$$($3_osuf) : $1/$4/%.hc includes/ghcautoconf.h includes/ghcplatform.h $$(MKDIRHIER) $1/$2/build/%.$$($3_osuf) : $1/$4/%.hc includes/ghcautoconf.h includes/ghcplatform.h | $$$$(dir $$$$@)/.
"$$(MKDIRHIER)" $$(dir $$@)
"$$(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/%.hc includes/ghcautoconf.h includes/ghcplatform.h $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hc includes/ghcautoconf.h includes/ghcplatform.h
......
...@@ -18,13 +18,10 @@ CABAL_DOTTED_VERSION := $(shell grep "^Version:" libraries/Cabal/Cabal.cabal | s ...@@ -18,13 +18,10 @@ CABAL_DOTTED_VERSION := $(shell grep "^Version:" libraries/Cabal/Cabal.cabal | s
CABAL_VERSION := $(subst .,$(comma),$(CABAL_DOTTED_VERSION)) CABAL_VERSION := $(subst .,$(comma),$(CABAL_DOTTED_VERSION))
CABAL_CONSTRAINT := --constraint="Cabal == $(CABAL_DOTTED_VERSION)" CABAL_CONSTRAINT := --constraint="Cabal == $(CABAL_DOTTED_VERSION)"
$(GHC_CABAL_INPLACE) : $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext) $(GHC_CABAL_INPLACE) : $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext) | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
"$(CP)" $< $@ "$(CP)" $< $@
$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/ghc-cabal.hs $(MKDIRHIER) $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/ghc-cabal.hs | $$(dir $$@)/. bootstrapping/.
"$(MKDIRHIER)" bootstrapping
"$(MKDIRHIER)" $(dir $@)
"$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \ "$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \
-Wall $(WERROR) \ -Wall $(WERROR) \
-DCABAL_VERSION=$(CABAL_VERSION) \ -DCABAL_VERSION=$(CABAL_VERSION) \
...@@ -54,8 +51,7 @@ $(GHC_CABAL_DIR)_dist-dummy-ghc_MODULES = dummy-ghc ...@@ -54,8 +51,7 @@ $(GHC_CABAL_DIR)_dist-dummy-ghc_MODULES = dummy-ghc
$(GHC_CABAL_DIR)_dist-dummy-ghc_PROG = dummy-ghc$(exeext) $(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. # 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 $(GHC_CABAL_DIR)/dist-dummy-ghc/build/dummy-ghc.hs : $(GHC_CABAL_DIR)/ghc.mk mk/project.mk | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
echo "import System.Environment; import System.Cmd; import System.Exit" >$@ echo "import System.Environment; import System.Cmd; import System.Exit" >$@
echo "main :: IO ()" >>$@ echo "main :: IO ()" >>$@
echo "main = do args <- getArgs; if args == [\"--numeric-version\"] then putStrLn \"$(ProjectVersion)\" else do e <- rawSystem \"$(GHC_STAGE0)\" args; exitWith e" >>$@ echo "main = do args <- getArgs; if args == [\"--numeric-version\"] then putStrLn \"$(ProjectVersion)\" else do e <- rawSystem \"$(GHC_STAGE0)\" args; exitWith e" >>$@
......
...@@ -30,8 +30,7 @@ endif ...@@ -30,8 +30,7 @@ endif
else else
$(GHC_PKG_INPLACE) : utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext) $(MKDIRHIER) $(GHC_PKG_INPLACE) : utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext) | $$(dir $$@)/. $(INPLACE_PACKAGE_CONF)/.
"$(MKDIRHIER)" $(INPLACE_PACKAGE_CONF)
"$(RM)" $(RM_OPTS) $(INPLACE_PACKAGE_CONF)/* "$(RM)" $(RM_OPTS) $(INPLACE_PACKAGE_CONF)/*
ifeq "$(Windows)" "YES" ifeq "$(Windows)" "YES"
cp $< $@ cp $< $@
...@@ -47,9 +46,7 @@ endif ...@@ -47,9 +46,7 @@ endif
# depend on ghc-cabal, otherwise we build Cabal twice when building in parallel # 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. # 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) 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 $$@)/.
"$(MKDIRHIER)" bootstrapping
"$(MKDIRHIER)" utils/ghc-pkg/dist/build
"$(GHC)" $(SRC_HC_OPTS) --make utils/ghc-pkg/Main.hs -o $@ \ "$(GHC)" $(SRC_HC_OPTS) --make utils/ghc-pkg/Main.hs -o $@ \
-Wall -fno-warn-unused-imports \ -Wall -fno-warn-unused-imports \
-DCABAL_VERSION=$(CABAL_VERSION) \ -DCABAL_VERSION=$(CABAL_VERSION) \
......
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
# #
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
$(MKDEPENDC) : utils/mkdependC/mkdependC.prl $(MKDIRHIER) $(MKDEPENDC) : utils/mkdependC/mkdependC.prl | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
"$(RM)" $(RM_OPTS) $@ "$(RM)" $(RM_OPTS) $@
echo '#!$(PERL)' >> $@ echo '#!$(PERL)' >> $@
echo '$$DEFAULT_TMPDIR = "$(DEFAULT_TMPDIR)";' >> $@ echo '$$DEFAULT_TMPDIR = "$(DEFAULT_TMPDIR)";' >> $@
......
...@@ -18,8 +18,7 @@ utils/runghc_dist_INSTALL_SHELL_WRAPPER = YES ...@@ -18,8 +18,7 @@ utils/runghc_dist_INSTALL_SHELL_WRAPPER = YES
ifneq "$(BINDIST)" "YES" ifneq "$(BINDIST)" "YES"
# hack: the build system has trouble with Main modules not called Main.hs # hack: the build system has trouble with Main modules not called Main.hs
utils/runghc/dist/build/Main.hs : utils/runghc/runghc.hs $(MKDIRHIER) utils/runghc/dist/build/Main.hs : utils/runghc/runghc.hs | $$(dir $$@)/.
"$(MKDIRHIER)" $(dir $@)
"$(CP)" $< $@ "$(CP)" $< $@
endif endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment