$(MAKE) -f Makefile-stage$* stage=$*
$(CABAL) register --distpref dist-stage$* --inplace
+# XXX We ought to actually install the (stage 2) library
+install:
+ @:
+
stage_dirs :
$(MKDIRHIER) stage$(stage)
boot all ::
$(MKDIRHIER) $(INPLACE_DATA_DIR)
test -e $(INPLACE_PKG_CONF) || echo "[]" > $(INPLACE_PKG_CONF)
+ echo "[]" > package.conf
touch $(INPLACE_FILE)
-override datadir = $(libdir)
INSTALL_DATAS += package.conf ghc-usage.txt ghci-usage.txt
# Since cleaning effectively uninstalls all the packages, we must
# no library to register
boot.stage.%:
- $(CABAL) configure --distpref dist-stage$* \
+ $(CABAL) configure --distpref dist-stage$* \
$(INSTALL_DIRS_CONFIGURE_FLAGS) \
- $(CONFIGURE_FLAGS_STAGE$*) \
- $(COMMON_CONFIGURE_FLAGS) \
- --datasubdir=. \
+ $(CONFIGURE_FLAGS_STAGE$*) \
+ $(COMMON_CONFIGURE_FLAGS) \
+ --libsubdir=. \
+ --datadir='$$libdir' \
+ --datasubdir=.
build.stage.%:
$(CABAL) build --distpref dist-stage$* $(BUILD_FLAGS)
$(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' 'XXX/package.conf' "" \
- $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
- $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
- '$$prefix/bin' \
- '$$prefix/lib' \
- '$$prefix/libexec' \
- '$$prefix/dynlib' \
- '$(INPLACE_DATA_DIR)' \
- '$$prefix/doc' \
- '$$prefix/html' \
- '$$prefix/haddock' \
- --distpref dist-stage$* \
+ $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
+ $(FPTOOLS_TOP_ABS)/ghc/stage$*-inplace \
+ '$$prefix/bin' \
+ '$(INPLACE_DATA_DIR)' \
+ '$$prefix/libexec' \
+ '$$prefix/dynlib' \
+ '$(INPLACE_DATA_DIR)' \
+ '$$prefix/doc' \
+ '$$prefix/html' \
+ '$$prefix/haddock' \
+ --distpref dist-stage$* \
$(INSTALL_FLAGS)
# XXX For now we always install the stage 2 compiler
install:
$(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
'$(prefix)' '$(bindir)' '$(libdir)' \
- '$(libexecdir)' '$(dynlibdir)' '$(datadir)' \
+ '$(libexecdir)' '$(dynlibdir)' '$(libdir)' \
'$(docdir)' '$(htmldir)' '$(haddockdir)' \
--distpref dist-stage2 \
$(INSTALL_FLAGS)
# sort removes duplicates - we don't actually care about the order
WITH_EITHER = $(sort $(WITH_BOOTSTRAPPING_COMPILER) $(WITH_STAGE1))
+clean:: $(foreach P,$(WITH_EITHER),clean.$P)
+
with-bootstrapping-compiler: \
$(foreach P,$(WITH_BOOTSTRAPPING_COMPILER),with-bootstrapping-compiler.$P)
install:: $(foreach P,$(WITH_STAGE1),install.$P)
+$(foreach P,$(WITH_EITHER),clean.$P): \
+clean.%:
+ $(MAKE) -C $* clean
+
$(foreach P,$(WITH_BOOTSTRAPPING_COMPILER),with-bootstrapping-compiler.$P): \
with-bootstrapping-compiler.%:
$(MAKE) -C $* with-bootstrapping-compiler