3 include $(TOP)/mk/boilerplate.mk
4 include $(TOP)/mk/cabal-flags.mk
10 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
13 INSTALL_FLAGS = --enable-shell-wrappers
16 # Don't strip the inplace versions, we might need to debug them
17 INPLACE_INSTALL_FLAGS += --disable-executable-stripping
19 boot:: boot.stage.$(stage)
21 all:: build.stage.$(stage)
24 -$(CABAL) clean --distpref dist-stage$(stage)
25 $(RM) -rf stage$(stage)-inplace
37 ifeq "$(CLEAN_ALL_STAGES)" "YES"
38 clean distclean:: clean.stage.1 clean.stage.2 clean.stage.3
40 clean distclean:: clean.stage.$(stage)
44 -$(CABAL) clean --distpref dist-stage$*
45 $(RM) -rf stage$*-inplace
47 # XXX This should be defined somewhere more central
48 INPLACE_DATA_DIR = $(FPTOOLS_TOP_ABS)/inplace-datadir
50 CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
52 ifeq "$(GhcWithInterpreter)" "YES"
53 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
55 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
58 ifeq "$(GhcProfiled)" "YES"
59 CONFIGURE_FLAGS_STAGE2 += --enable-executable-profiling
61 ifeq "$(GhcDebugged)" "YES"
62 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-debug
64 ifeq "$(GhcThreaded)" "YES"
65 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
66 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-threaded
69 ifeq "$(BuildSharedLibs)" "YES"
70 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-dynamic
73 CONFIGURE_FLAGS_STAGE3 = $(CONFIGURE_FLAGS_STAGE2)
75 CONFIGURE_FLAGS_STAGE1 += $(USE_BOOT_CONFIGURE_FLAGS)
76 CONFIGURE_FLAGS_STAGE2 += $(USE_STAGE1_CONFIGURE_FLAGS)
77 CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
79 # Allow EXTRA_HC_OPTS to be used from the command line to add options
80 # when building (e.g. -v)
81 BUILD_FLAGS=$(patsubst %, --ghc-option=%, $(EXTRA_HC_OPTS))
83 # XXX In stage2+ we should really use the inplace ghc-pkg
84 # It works because installPackage doesn't actually use ghc-pkg, as there's
85 # no library to register
88 # GHC 6.9+ can handle cross-package recompilation checking, but
89 # we don't rely on the bootstrapping compiler being able to do this.
90 TOUCH_MAIN = $(RM) dist-stage1/build/ghc/ghc-tmp/Main.o
94 $(CABAL) configure --distpref dist-stage$* \
95 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
96 $(CONFIGURE_FLAGS_STAGE$*) \
97 $(COMMON_CONFIGURE_FLAGS) \
99 --datadir='$$libdir' \
104 $(CABAL) build --distpref dist-stage$* $(BUILD_FLAGS)
105 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
106 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
107 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
109 '$(INPLACE_DATA_DIR)' \
112 '$(INPLACE_DATA_DIR)' \
116 --distpref dist-stage$* \
117 $(INPLACE_INSTALL_FLAGS) \
120 # XXX For now we always install the stage 2 compiler
122 $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
123 '$(prefix)' '$(bindir)' '$(libdir)' \
124 '$(libexecdir)' '$(dynlibdir)' '$(datadir)' \
125 '$(docdir)' '$(htmldir)' '$(haddockdir)' \
126 --distpref dist-stage2 \
129 include $(TOP)/mk/bindist.mk
130 EXE_DIST_DIR = dist-stage$(stage)