stage=1
endif
-boot ::
+.DUMMY: stage_dir
+stage_dirs :
$(MKDIRHIER) stage$(stage)
for i in $(ALL_DIRS); do \
$(MKDIRHIER) stage$(stage)/$$i; \
done
+
+boot :: stage_dirs
+
# On Windows, we can't use symbolic links for the -hi-boot files
# because GHC itself is a Mingw program and does not understand
# symbolic links. So we have to copy the files instead of link them.
PLATFORM_H = ghc_boot_platform.h
-stage1/$(PLATFORM_H) : $(FPTOOLS_TOP)/mk/config.mk Makefile
+stage1/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile
@echo "Creating $@..."
@$(RM) $@
@echo "#ifndef __PLATFORM_H__" >$@
# 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).
-stage2/$(PLATFORM_H) : $(FPTOOLS_TOP)/mk/config.mk Makefile
+stage2/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile
@echo "Creating $@..."
@$(RM) $@
@echo "#ifndef __PLATFORM_H__" >$@
@echo "#endif /* __PLATFORM_H__ */" >> $@
@echo "Done."
-stage3/$(PLATFORM_H) : stage2/$(PLATFORM_H)
+stage3/$(PLATFORM_H) : stage_dirs stage2/$(PLATFORM_H)
$(CP) stage2/$(PLATFORM_H) stage3/$(PLATFORM_H)
-boot :: stage$(stage)/$(PLATFORM_H)
+STAGE_PLATFORM_H = stage$(stage)/$(PLATFORM_H)
+
+boot :: $(STAGE_PLATFORM_H)
SRC_HC_OPTS += -Istage$(stage)
utils/FastMutInt_HC_OPTS += -O
+# ---- Profiling ----
+#simplCore/Simplify_HC_OPTS = -auto-all
+#simplCore/SimplEnv_HC_OPTS = -auto-all
+#simplCore/SimplUtils_HC_OPTS = -auto-all
+
# CSE interacts badly with top-level IORefs (reportedly in DriverState and
# DriverMkDepend), causing some of them to be commoned up. We have a fix for
# this in 5.00+, but earlier versions of the compiler will need CSE turned off.
MKDEPENDHS=$(HC)
# Must do this *after* including target.mk, because $(HS_SRCS) isn't set yet.
-depend :: $(HS_SRCS) $(C_SRCS)
+depend :: $(STAGE_PLATFORM_H) $(HS_SRCS) $(C_SRCS)
touch .depend-BASE
ifneq "$(BootingFromHc)" "YES"
$(MKDEPENDHS) -M -optdep-f -optdep.depend-BASE $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(MKDEPENDHS_OPTS) $(filter-out -split-objs, $(MKDEPENDHS_HC_OPTS)) $(HS_SRCS)