Some "install" and "clean" fixes
authorIan Lynagh <igloo@earth.li>
Fri, 18 Jul 2008 22:36:56 +0000 (22:36 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 18 Jul 2008 22:36:56 +0000 (22:36 +0000)
compiler/Makefile
driver/Makefile
ghc/Makefile
utils/Makefile

index 00ae2c2..129adfc 100644 (file)
@@ -175,6 +175,10 @@ build.stage.%:
        $(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)
 
index cf842e4..e81b1ea 100644 (file)
@@ -17,9 +17,9 @@ INPLACE_FILE     = $(INPLACE_DATA_DIR)/inplace
 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 
index 43e40a4..4ee970c 100644 (file)
@@ -65,33 +65,35 @@ CONFIGURE_FLAGS_STAGE3 += $(USE_STAGE2_CONFIGURE_FLAGS)
 # 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)
index 73685d8..82eec81 100644 (file)
@@ -65,6 +65,8 @@ endif
 # 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)
 
@@ -72,6 +74,10 @@ with-stage-1: $(foreach P,$(WITH_STAGE1),with-stage-1.$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