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 boot:: boot.stage.$(stage)
18 all:: build.stage.$(stage)
30 -$(CABAL) clean --distpref dist-stage1
31 -$(CABAL) clean --distpref dist-stage2
32 -$(CABAL) clean --distpref dist-stage3
33 $(RM) -rf stage1-inplace
34 $(RM) -rf stage2-inplace
35 $(RM) -rf stage3-inplace
37 # XXX This should be defined somewhere more central
38 INPLACE_DATA_DIR = $(FPTOOLS_TOP_ABS)/inplace-datadir
40 CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
42 ifeq "$(GhcWithInterpreter)" "YES"
43 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
45 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
48 ifeq "$(GhcProfiled)" "YES"
49 CONFIGURE_FLAGS_STAGE2 += --enable-executable-profiling
51 ifeq "$(GhcDebugged)" "YES"
52 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-debug
54 ifeq "$(GhcThreaded)" "YES"
55 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
56 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-threaded
59 CONFIGURE_FLAGS_STAGE3 = $(CONFIGURE_FLAGS_STAGE2)
61 CONFIGURE_FLAGS_STAGE1 += $(USE_BOOT_CONFIGURE_FLAGS)
62 CONFIGURE_FLAGS_STAGE2 += $(USE_STAGE1_CONFIGURE_FLAGS)
63 CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
65 # XXX In stage2+ we should really use the inplace ghc-pkg
66 # It works because installPackage doesn't actually use ghc-pkg, as there's
67 # no library to register
70 $(CABAL) configure --distpref dist-stage$* \
71 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
72 $(CONFIGURE_FLAGS_STAGE$*) \
73 $(COMMON_CONFIGURE_FLAGS) \
75 --datadir='$$libdir' \
79 $(CABAL) build --distpref dist-stage$* $(BUILD_FLAGS)
80 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
81 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
82 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
84 '$(INPLACE_DATA_DIR)' \
87 '$(INPLACE_DATA_DIR)' \
91 --distpref dist-stage$* \
94 # XXX For now we always install the stage 2 compiler
96 $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
97 '$(prefix)' '$(bindir)' '$(libdir)' \
98 '$(libexecdir)' '$(dynlibdir)' '$(libdir)' \
99 '$(docdir)' '$(htmldir)' '$(haddockdir)' \
100 --distpref dist-stage2 \
105 # $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hsc2hs
106 # $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/hsc2hs/
107 # $(INSTALL_DATA) hsc2hs.sh $(BIN_DIST_DIR)/utils/hsc2hs/
108 # $(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/utils/hsc2hs/
109 # $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/hsc2hs/