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
19 all:: build.stage.$(stage)
31 -$(CABAL) clean --distpref dist-stage1
32 -$(CABAL) clean --distpref dist-stage2
33 $(RM) -rf stage1-inplace
34 $(RM) -rf stage2-inplace
36 # XXX Eugh, can we do this better? The problem is making extra-gcc-opts
37 # infdable on both Linux and Windows. I guess this will go away when we
39 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
40 SET_DATA_SUBDIR = --datasubdir=.
41 INPLACE_DATA_DIR = '$$prefix'
44 INPLACE_DATA_DIR = '$$prefix/data'
47 CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
49 ifeq "$(GhcWithInterpreter)" "YES"
50 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
52 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
55 ifeq "$(GhcProfiled)" "YES"
56 CONFIGURE_FLAGS_STAGE2 += --enable-executable-profiling
58 ifeq "$(GhcDebugged)" "YES"
59 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-debug
61 ifeq "$(GhcThreaded)" "YES"
62 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
63 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-threaded
66 CONFIGURE_FLAGS_STAGE3 = $(CONFIGURE_FLAGS_STAGE2)
68 CONFIGURE_FLAGS_STAGE1 += $(USE_BOOT_CONFIGURE_FLAGS)
69 CONFIGURE_FLAGS_STAGE2 += $(USE_STAGE1_CONFIGURE_FLAGS)
70 CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
72 # XXX In stage2+ we should really use the inplace ghc-pkg
73 # It works because installPackage doesn't actually use ghc-pkg, as there's
74 # no library to register
77 $(CABAL) configure --distpref dist-stage$* \
79 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
80 $(CONFIGURE_FLAGS_STAGE$*) \
81 $(COMMON_CONFIGURE_FLAGS)
82 $(CABAL) build --distpref dist-stage$* $(BUILD_FLAGS)
83 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
84 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
85 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
94 --distpref dist-stage$* \
97 # XXX For now we always install the stage 2 compiler
99 $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
100 '$(prefix)' '$(bindir)' '$(libdir)' \
101 '$(libexecdir)' '$(dynlibdir)' '$(datadir)' \
102 '$(docdir)' '$(htmldir)' '$(haddockdir)' \
103 --distpref dist-stage2 \
108 # $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hsc2hs
109 # $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/hsc2hs/
110 # $(INSTALL_DATA) hsc2hs.sh $(BIN_DIST_DIR)/utils/hsc2hs/
111 # $(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/utils/hsc2hs/
112 # $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/hsc2hs/