X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Makefile;h=16a352d47cc560c35f7d837a356b75c75cfe8268;hb=364193a015565b043c5d0417750b023af6760c4f;hp=e00a8445085c57d9a09e0ad8bf8a706f8c47ea21;hpb=610379bc0660cc9df6bb8cfaa98e566157236026;p=ghc-hetmet.git diff --git a/Makefile b/Makefile index e00a844..16a352d 100644 --- a/Makefile +++ b/Makefile @@ -223,10 +223,6 @@ BinDistLinks = ghc ghci ghc-pkg BinDistLibSplicedFiles = package.conf BinDistDirs = includes compiler docs driver rts utils -BIN_DIST_NAME=ghc-$(ProjectVersion) -BIN_DIST_TOPDIR=$(FPTOOLS_TOP_ABS) -BIN_DIST_DIR=$(BIN_DIST_TOPDIR)/$(BIN_DIST_NAME) - BIN_DIST_TARBALL=ghc-$(ProjectVersion)-$(TARGETPLATFORM).tar.bz2 BIN_DIST_TOP= distrib/Makefile \ @@ -299,26 +295,32 @@ binary-dist:: # binary dist'ing the documentation. # The default documentation to build/install is given below; overrideable # via build.mk or the 'make' command-line. +# +# If BINDIST_DOC_WAYS is set, use that +# If XMLDocWays is set, use that +# Otherwise, figure out what we can build based on configure results ifndef BINDIST_DOC_WAYS +ifneq "$(XMLDocWays)" "" BINDIST_DOC_WAYS = $(XMLDocWays) - -# ifneq "$(XSLTPROC)" "" -# BINDIST_DOC_WAYS = html -# ifneq "$(FOP)" "" -# BINDIST_DOC_WAYS += ps pdf -# else -# ifneq "$(PDFXMLTEX)" "" -# BINDIST_DOC_WAYS += pdf -# endif -# ifneq "$(XMLTEX)" "" -# ifneq "$(DVIPS)" "" -# BINDIST_DOC_WAYS += ps -# endif # DVIPS -# endif # XMLTEX -# endif # FOP -# endif # XSLTPROC +else +ifneq "$(XSLTPROC)" "" +BINDIST_DOC_WAYS = html +ifneq "$(FOP)" "" +BINDIST_DOC_WAYS += ps pdf +else +ifneq "$(PDFXMLTEX)" "" +BINDIST_DOC_WAYS += pdf +endif +ifneq "$(XMLTEX)" "" +ifneq "$(DVIPS)" "" +BINDIST_DOC_WAYS += ps +endif # DVIPS +endif # XMLTEX +endif # FOP +endif # XSLTPROC +endif # XMLDocWays endif # BINDIST_DOC_WAYS @@ -332,6 +334,7 @@ binary-dist :: $(BINARY_DIST_DOC_RULES) $(BINARY_DIST_DOC_RULES): binary-dist-doc-%: $(MAKE) -C $* $(MFLAGS) $(BINDIST_DOC_WAYS) $(MAKE) -C $* $(MFLAGS) install-docs \ + MAKING_BIN_DIST=1 \ XMLDocWays="$(BINDIST_DOC_WAYS)" \ prefix=$(BIN_DIST_DIR) \ exec_prefix=$(BIN_DIST_DIR) \ @@ -372,27 +375,8 @@ endif .PHONY: binary-dist-doc-% -BIN_DIST_LIBDIR=$(BIN_DIST_DIR)/libraries - -LIBRARY_SUBDIRS=$(shell $(MAKE) -s -C libraries subdirs) - -BINARY_DIST_LIBRARY_RULES=$(foreach d,$(LIBRARY_SUBDIRS),binary-dist-lib-$d) - -binary-dist:: $(BINARY_DIST_LIBRARY_RULES) - cp libraries/Makefile $(BIN_DIST_LIBDIR) - cp libraries/gen_contents_index $(BIN_DIST_LIBDIR) - cp libraries/index.html $(BIN_DIST_LIBDIR) - cp libraries/doc-index.html $(BIN_DIST_LIBDIR) - cp -a libraries/stamp $(BIN_DIST_LIBDIR) - -$(BINARY_DIST_LIBRARY_RULES): binary-dist-lib-%: - $(MKDIRHIER) $(BIN_DIST_LIBDIR)/$*/setup - cp libraries/$*/setup/Setup $(BIN_DIST_LIBDIR)/$*/setup - cp libraries/$*/*.cabal $(BIN_DIST_LIBDIR)/$* - cp -a libraries/$*/dist $(BIN_DIST_LIBDIR)/$* - find $(BIN_DIST_LIBDIR)/$*/dist \ - \( \( -name "*.o" -o -name "*.p_o" \) -a \! -name "HS*" \) \ - -exec rm {} \; +binary-dist:: + $(MAKE) -C libraries binary-dist # Jiggle the files around to make a valid Windows distribution if necessary ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" @@ -416,13 +400,22 @@ binary-dist :: publish-binary-dist endif .PHONY: publish-binary-dist -publish-binary-dist : +publish-binary-dist :: @for i in 0 1 2 3 4 5 6 7 8 9; do \ - echo "Try $$i: $(PublishCp) $(BIN_DIST_TARBALL) $(PublishLocation)"; \ - if $(PublishCp) $(BIN_DIST_TARBALL) $(PublishLocation); then break; fi\ + echo "Try $$i: $(PublishCp) $(BIN_DIST_TARBALL) $(PublishLocation)/dist"; \ + if $(PublishCp) $(BIN_DIST_TARBALL) $(PublishLocation)/dist; then break; fi; \ done - $(PublishCp) -r $(BIN_DIST_DIR)/share/html/* $(PublishLocation)/docs +ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" +# On Windows, we cannot use absoluate pathnames to rsync, because they look +# like remote pathnames ("c:/foo/bar"). Also, the docs reside in doc/ +# rather than share/, due to prep-bin-dist-mingw. +publish-binary-dist :: + $(PublishCp) -r $(FPTOOLS_TOP)/$(BIN_DIST_NAME)/doc/html/* $(PublishLocation)/docs +else +publish-binary-dist :: + $(PublishCp) -r $(BIN_DIST_DIR)/share/html/* $(PublishLocation)/docs +endif binary-dist:: @echo "Mechanical and super-natty! Inspect the result and *if* happy; freeze, sell and get some sleep!"