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
38 -$(CABAL) clean --distpref dist-stage1
39 -$(CABAL) clean --distpref dist-stage2
40 -$(CABAL) clean --distpref dist-stage3
41 $(RM) -rf stage1-inplace
42 $(RM) -rf stage2-inplace
43 $(RM) -rf stage3-inplace
45 # XXX This should be defined somewhere more central
46 INPLACE_DATA_DIR = $(FPTOOLS_TOP_ABS)/inplace-datadir
48 CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
50 ifeq "$(GhcWithInterpreter)" "YES"
51 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
53 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
56 ifeq "$(GhcProfiled)" "YES"
57 CONFIGURE_FLAGS_STAGE2 += --enable-executable-profiling
59 ifeq "$(GhcDebugged)" "YES"
60 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-debug
62 ifeq "$(GhcThreaded)" "YES"
63 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
64 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-threaded
67 ifeq "$(BuildSharedLibs)" "YES"
68 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-dynamic
71 CONFIGURE_FLAGS_STAGE3 = $(CONFIGURE_FLAGS_STAGE2)
73 CONFIGURE_FLAGS_STAGE1 += $(USE_BOOT_CONFIGURE_FLAGS)
74 CONFIGURE_FLAGS_STAGE2 += $(USE_STAGE1_CONFIGURE_FLAGS)
75 CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
77 # Allow EXTRA_HC_OPTS to be used from the command line to add options
78 # when building (e.g. -v)
79 BUILD_FLAGS=$(patsubst %, --ghc-option=%, $(EXTRA_HC_OPTS))
81 # XXX In stage2+ we should really use the inplace ghc-pkg
82 # It works because installPackage doesn't actually use ghc-pkg, as there's
83 # no library to register
86 # GHC 6.9+ can handle cross-package recompilation checking, but
87 # we don't rely on the bootstrapping compiler being able to do this.
88 TOUCH_MAIN = $(RM) dist-stage1/build/ghc/ghc-tmp/Main.o
92 $(CABAL) configure --distpref dist-stage$* \
93 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
94 $(CONFIGURE_FLAGS_STAGE$*) \
95 $(COMMON_CONFIGURE_FLAGS) \
97 --datadir='$$libdir' \
102 $(CABAL) build --distpref dist-stage$* $(BUILD_FLAGS)
103 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
104 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
105 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
107 '$(INPLACE_DATA_DIR)' \
110 '$(INPLACE_DATA_DIR)' \
114 --distpref dist-stage$* \
115 $(INPLACE_INSTALL_FLAGS) \
118 # XXX For now we always install the stage 2 compiler
120 $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
121 '$(prefix)' '$(bindir)' '$(libdir)' \
122 '$(libexecdir)' '$(dynlibdir)' '$(libdir)' \
123 '$(docdir)' '$(htmldir)' '$(haddockdir)' \
124 --distpref dist-stage2 \
129 # $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hsc2hs
130 # $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/hsc2hs/
131 # $(INSTALL_DATA) hsc2hs.sh $(BIN_DIST_DIR)/utils/hsc2hs/
132 # $(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/utils/hsc2hs/
133 # $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/hsc2hs/