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'
48 $(CABAL) configure --distpref dist-stage1 \
51 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
52 $(USE_BOOT_CONFIGURE_FLAGS) \
53 $(COMMON_CONFIGURE_FLAGS)
54 $(CABAL) build --distpref dist-stage1 $(BUILD_FLAGS)
55 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
56 $(FPTOOLS_TOP_ABS)/ghc/stage1-inplace \
57 $(FPTOOLS_TOP_ABS)/ghc/stage1-inplace \
66 --distpref dist-stage1 \
69 ifeq "$(GhcWithInterpreter)" "YES"
70 CONFIGURE_FLAGS_STAGE2 += --flags=ghci
72 CONFIGURE_FLAGS_STAGE2 += --flags=-ghci
75 ifeq "$(GhcProfiled)" "YES"
76 CONFIGURE_FLAGS_STAGE2 += --enable-executable-profiling
78 ifeq "$(GhcDebugged)" "YES"
79 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-debug
81 ifeq "$(GhcThreaded)" "YES"
82 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
83 CONFIGURE_FLAGS_STAGE2 += --ghc-option=-threaded
86 # XXX In stage2 we should really use the inplace ghc-pkg
87 # It works because installPackage doesn't actually use ghc-pkg, as there's
88 # no library to register
91 $(CABAL) configure --distpref dist-stage2 \
93 $(CONFIGURE_FLAGS_STAGE2) \
94 $(INSTALL_DIRS_CONFIGURE_FLAGS) \
95 $(USE_STAGE1_CONFIGURE_FLAGS) \
96 $(COMMON_CONFIGURE_FLAGS)
97 $(CABAL) build --distpref dist-stage2 $(BUILD_FLAGS)
98 $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
99 $(FPTOOLS_TOP_ABS)/ghc/stage2-inplace \
100 $(FPTOOLS_TOP_ABS)/ghc/stage2-inplace \
105 $(INPLACE_DATA_DIR) \
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/