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)
21 -$(CABAL) clean --distpref dist-stage$(stage)
22 $(RM) -rf stage$(stage)-inplace
35 -$(CABAL) clean --distpref dist-stage1
36 -$(CABAL) clean --distpref dist-stage2
37 -$(CABAL) clean --distpref dist-stage3
38 $(RM) -rf stage1-inplace
39 $(RM) -rf stage2-inplace
40 $(RM) -rf stage3-inplace
42 # XXX This should be defined somewhere more central
43 INPLACE_DATA_DIR = $(FPTOOLS_TOP_ABS)/inplace-datadir
45 CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
47 ifeq "$(GhcWithInterpreter)" "YES"
48 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
50 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
53 ifeq "$(GhcProfiled)" "YES"
54 CONFIGURE_FLAGS_STAGE2 += --enable-executable-profiling
56 ifeq "$(GhcDebugged)" "YES"
57 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-debug
59 ifeq "$(GhcThreaded)" "YES"
60 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
61 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-threaded
64 CONFIGURE_FLAGS_STAGE3 = $(CONFIGURE_FLAGS_STAGE2)
66 CONFIGURE_FLAGS_STAGE1 += $(USE_BOOT_CONFIGURE_FLAGS)
67 CONFIGURE_FLAGS_STAGE2 += $(USE_STAGE1_CONFIGURE_FLAGS)
68 CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
70 # Allow EXTRA_HC_OPTS to be used from the command line to add options
71 # when building (e.g. -v)
72 BUILD_FLAGS=$(patsubst %, --ghc-option=%, $(EXTRA_HC_OPTS))
74 # XXX In stage2+ we should really use the inplace ghc-pkg
75 # It works because installPackage doesn't actually use ghc-pkg, as there's
76 # no library to register
79 $(CABAL) configure --distpref dist-stage$* \
80 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
81 $(CONFIGURE_FLAGS_STAGE$*) \
82 $(COMMON_CONFIGURE_FLAGS) \
84 --datadir='$$libdir' \
88 $(CABAL) build --distpref dist-stage$* $(BUILD_FLAGS)
89 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
90 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
91 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
93 '$(INPLACE_DATA_DIR)' \
96 '$(INPLACE_DATA_DIR)' \
100 --distpref dist-stage$* \
103 # XXX For now we always install the stage 2 compiler
105 $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
106 '$(prefix)' '$(bindir)' '$(libdir)' \
107 '$(libexecdir)' '$(dynlibdir)' '$(libdir)' \
108 '$(docdir)' '$(htmldir)' '$(haddockdir)' \
109 --distpref dist-stage2 \
114 # $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hsc2hs
115 # $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/hsc2hs/
116 # $(INSTALL_DATA) hsc2hs.sh $(BIN_DIST_DIR)/utils/hsc2hs/
117 # $(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/utils/hsc2hs/
118 # $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/hsc2hs/