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 Eugh, can we do this better? The problem is making extra-gcc-opts
36 # infdable on both Linux and Windows. I guess this will go away when we
38 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
39 SET_DATA_SUBDIR = --datasubdir=.
40 INPLACE_DATA_DIR = '$$prefix'
43 INPLACE_DATA_DIR = '$$prefix/data'
46 CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
48 ifeq "$(GhcWithInterpreter)" "YES"
49 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
51 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
54 ifeq "$(GhcProfiled)" "YES"
55 CONFIGURE_FLAGS_STAGE2 += --enable-executable-profiling
57 ifeq "$(GhcDebugged)" "YES"
58 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-debug
60 ifeq "$(GhcThreaded)" "YES"
61 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
62 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-threaded
65 CONFIGURE_FLAGS_STAGE3 = $(CONFIGURE_FLAGS_STAGE2)
67 CONFIGURE_FLAGS_STAGE1 += $(USE_BOOT_CONFIGURE_FLAGS)
68 CONFIGURE_FLAGS_STAGE2 += $(USE_STAGE1_CONFIGURE_FLAGS)
69 CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
71 # XXX In stage2+ we should really use the inplace ghc-pkg
72 # It works because installPackage doesn't actually use ghc-pkg, as there's
73 # no library to register
76 $(CABAL) configure --distpref dist-stage$* \
78 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
79 $(CONFIGURE_FLAGS_STAGE$*) \
80 $(COMMON_CONFIGURE_FLAGS)
83 $(CABAL) build --distpref dist-stage$* $(BUILD_FLAGS)
84 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
85 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
86 $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
95 --distpref dist-stage$* \
98 # XXX For now we always install the stage 2 compiler
100 $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
101 '$(prefix)' '$(bindir)' '$(libdir)' \
102 '$(libexecdir)' '$(dynlibdir)' '$(datadir)' \
103 '$(docdir)' '$(htmldir)' '$(haddockdir)' \
104 --distpref dist-stage2 \
109 # $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/hsc2hs
110 # $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/hsc2hs/
111 # $(INSTALL_DATA) hsc2hs.sh $(BIN_DIST_DIR)/utils/hsc2hs/
112 # $(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/utils/hsc2hs/
113 # $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/hsc2hs/