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 $(RM) -rf stage1-inplace
33 $(RM) -rf stage2-inplace
35 # XXX This should be defined somewhere more central
36 INPLACE_DATA_DIR = $(FPTOOLS_TOP_ABS)/inplace-datadir
38 CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
40 ifeq "$(GhcWithInterpreter)" "YES"
41 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
43 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
46 ifeq "$(GhcProfiled)" "YES"
47 CONFIGURE_FLAGS_STAGE2 += --enable-executable-profiling
49 ifeq "$(GhcDebugged)" "YES"
50 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-debug
52 ifeq "$(GhcThreaded)" "YES"
53 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
54 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-threaded
57 CONFIGURE_FLAGS_STAGE3 = $(CONFIGURE_FLAGS_STAGE2)
59 CONFIGURE_FLAGS_STAGE1 += $(USE_BOOT_CONFIGURE_FLAGS)
60 CONFIGURE_FLAGS_STAGE2 += $(USE_STAGE1_CONFIGURE_FLAGS)
61 CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
63 # XXX In stage2+ we should really use the inplace ghc-pkg
64 # It works because installPackage doesn't actually use ghc-pkg, as there's
65 # no library to register
68 $(CABAL) configure --distpref dist-stage$* \
69 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
70 $(CONFIGURE_FLAGS_STAGE$*) \
71 $(COMMON_CONFIGURE_FLAGS) \
73 --datadir='$$libdir' \
77 $(CABAL) build --distpref dist-stage$* $(BUILD_FLAGS)
78 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
79 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
80 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
82 '$(INPLACE_DATA_DIR)' \
85 '$(INPLACE_DATA_DIR)' \
89 --distpref dist-stage$* \
92 # XXX For now we always install the stage 2 compiler
94 $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
95 '$(prefix)' '$(bindir)' '$(libdir)' \
96 '$(libexecdir)' '$(dynlibdir)' '$(libdir)' \
97 '$(docdir)' '$(htmldir)' '$(haddockdir)' \
98 --distpref dist-stage2 \
103 # $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hsc2hs
104 # $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/hsc2hs/
105 # $(INSTALL_DATA) hsc2hs.sh $(BIN_DIST_DIR)/utils/hsc2hs/
106 # $(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/utils/hsc2hs/
107 # $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/hsc2hs/