-installPackage/installPackage: installPackage.hs
- -$(RM) -rf installPackage
- mkdir installPackage
- $(CP) installPackage.hs installPackage/
- cd installPackage && $(FPTOOLS_TOP_ABS)/compiler/stage1/ghc-inplace \
- --make installPackage -o installPackage \
- $(DEPLOYMENT_OPTS)
+boot: ifBuildable/ifBuildable cabal-bin bootstrapping.conf
+
+cabal-bin: cabal-bin.hs
+ mkdir bootstrapping
+ $(GHC) $(BOOTSTRAPPING_FLAGS) --make cabal-bin -o cabal-bin
+
+bootstrapping.conf: cabal-bin
+ echo "[]" > $@.tmp
+ -cd filepath && $(CABAL) clean --distpref=dist-bootstrapping
+ cd filepath && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp
+ cd filepath && $(CABAL) build --distpref=dist-bootstrapping
+ cd filepath && $(CABAL) install --distpref=dist-bootstrapping --inplace
+ -cd Cabal && $(CABAL) clean --distpref=dist-bootstrapping
+ cd Cabal && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp
+ cd Cabal && $(CABAL) build --distpref=dist-bootstrapping
+ cd Cabal && $(CABAL) install --distpref=dist-bootstrapping --inplace
+ -cd hpc && $(CABAL) clean --distpref=dist-bootstrapping
+ cd hpc && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp
+ cd hpc && $(CABAL) build --distpref=dist-bootstrapping
+ cd hpc && $(CABAL) install --distpref=dist-bootstrapping --inplace
+ mv $@.tmp $@