Don't break when asked to install-docs
[ghc-hetmet.git] / libraries / Makefile
index 594de16..82cf02e 100644 (file)
@@ -3,8 +3,14 @@
 
 default_target: build
 
+ifeq "$(IN_BIN_DIST)" "1"
+include ../Makefile-vars
+else
+# Ideally we'd just include something to give us variables
+# for paths and arguments to tools etc, and those set in mk/build.mk.
 TOP=.
 include $(TOP)/mk/boilerplate.mk
+endif
 
 SUBDIRS = base filepath haskell98 template-haskell readline \
          regex-base regex-posix regex-compat parsec Cabal
@@ -60,6 +66,11 @@ endif
 
 BOOTSTRAPPING_CABAL = bootstrapping.cabal
 
+.PHONY: subdirs
+
+subdirs:
+       @echo $(SUBDIRS)
+
 .PHONY: boot
 
 boot: $(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/setup/Setup)
@@ -135,7 +146,7 @@ doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
                %/setup/Setup
        cd $* && setup/Setup haddock
 
-.PHONY: install.library.%
+.PHONY: install install-docs install.library.%
 
 INSTALL_DIR=$(prefix)/share/ghc/doc/html/
 
@@ -147,6 +158,10 @@ install: $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR))
        $(INSTALL_DATA)   $(prefix)/share/ghc/doc/html/base/*.js  $(INSTALL_DIR)
        $(INSTALL_DATA)   $(prefix)/share/ghc/doc/html/base/*.gif $(INSTALL_DIR)
 
+# Cabal doesn't let us ask to install docs only, so do nothing here
+install-docs:
+       @:
+
 # Ideally this would depend on a stamp/build.library.%, but if it does
 # then we can't change the libraries and then just rerun make.
 # Thus if you install without building then it will just break.