summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2015-10-16 13:58:52 +0100
committerAdam Gundry <adam@well-typed.com>2015-10-16 13:58:52 +0100
commit5a1b4f814f74ec1c48152d97523744518e212777 (patch)
tree7c2207ecacbd37f12c78dbcf9d4334827164e0fb /rules
parent6757950cdd8bb0af0355539987ee78401a6a8f6b (diff)
parent808bbdf08058785ae5bc59b5b4f2b04951d4cbbf (diff)
downloadhaskell-wip/orf-reboot.tar.gz
Merge remote-tracking branch 'origin/master' into wip/orf-rebootwip/orf-reboot
Conflicts: compiler/rename/RnNames.hs compiler/typecheck/TcRnMonad.hs utils/haddock
Diffstat (limited to 'rules')
-rw-r--r--rules/build-package-way.mk14
-rw-r--r--rules/build-package.mk2
-rw-r--r--rules/build-prog.mk4
-rw-r--r--rules/distdir-way-opts.mk16
-rw-r--r--rules/docbook.mk86
-rw-r--r--rules/foreachLibrary.mk6
-rw-r--r--rules/sphinx.mk68
7 files changed, 89 insertions, 107 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index c179159914..225782162f 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -23,13 +23,13 @@ $(call hs-objs,$1,$2,$3)
# The .a/.so library file, indexed by two different sets of vars:
# the first is indexed by the dir, distdir and way
# the second is indexed by the package id, distdir and way
-$1_$2_$3_LIB_FILE = libHS$$($1_$2_LIB_NAME)$$($3_libsuf)
+$1_$2_$3_LIB_FILE = libHS$$($1_$2_COMPONENT_ID)$$($3_libsuf)
$1_$2_$3_LIB = $1/$2/build/$$($1_$2_$3_LIB_FILE)
-$$($1_$2_LIB_NAME)_$2_$3_LIB = $$($1_$2_$3_LIB)
+$$($1_$2_COMPONENT_ID)_$2_$3_LIB = $$($1_$2_$3_LIB)
ifeq "$$(HostOS_CPP)" "mingw32"
ifneq "$$($1_$2_dll0_HS_OBJS)" ""
-$1_$2_$3_LIB0_ROOT = HS$$($1_$2_LIB_NAME)-0$$($3_libsuf)
+$1_$2_$3_LIB0_ROOT = HS$$($1_$2_COMPONENT_ID)-0$$($3_libsuf)
$1_$2_$3_LIB0_NAME = lib$$($1_$2_$3_LIB0_ROOT)
$1_$2_$3_LIB0 = $1/$2/build/$$($1_$2_$3_LIB0_NAME)
endif
@@ -42,7 +42,7 @@ endif
# Really we should use a consistent scheme for distdirs, but in the
# meantime we work around it by defining ghc-<ver>_dist-install_way_LIB:
ifeq "$$($1_PACKAGE) $2" "ghc stage2"
-$$($1_$2_LIB_NAME)_dist-install_$3_LIB = $$($1_$2_$3_LIB)
+$$($1_$2_COMPONENT_ID)_dist-install_$3_LIB = $$($1_$2_$3_LIB)
endif
# All the .a/.so library file dependencies for this library.
@@ -50,8 +50,8 @@ endif
# The $(subst stage2,dist-install,..) is needed due to Note
# [inconsistent distdirs].
#
-# NB: Use DEP_LIB_NAMES for the /directory/ parameter.
-$1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEP_LIB_NAMES),$$($$(dep)_$(subst stage2,dist-install,$2)_$3_LIB))
+# NB: Use DEP_COMPONENT_IDS for the /directory/ parameter.
+$1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEP_COMPONENT_IDS),$$($$(dep)_$(subst stage2,dist-install,$2)_$3_LIB))
$1_$2_$3_NON_HS_OBJS = $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS)
$1_$2_$3_ALL_OBJS = $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_NON_HS_OBJS)
@@ -136,7 +136,7 @@ ifeq "$$(DYNAMIC_GHC_PROGRAMS)" "YES"
$1_$2_GHCI_LIB = $$($1_$2_dyn_LIB)
else
ifeq "$3" "v"
-$1_$2_GHCI_LIB = $1/$2/build/HS$$($1_$2_LIB_NAME).$$($3_osuf)
+$1_$2_GHCI_LIB = $1/$2/build/HS$$($1_$2_COMPONENT_ID).$$($3_osuf)
ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES"
# Don't put bootstrapping packages in the bindist
ifneq "$4" "0"
diff --git a/rules/build-package.mk b/rules/build-package.mk
index f05f230c10..b514102a21 100644
--- a/rules/build-package.mk
+++ b/rules/build-package.mk
@@ -133,7 +133,7 @@ $$(foreach way,$$($1_$2_WAYS),$$(eval \
# If dyn libs are not being built then $$($1_$2_dyn_LIB) will just
# expand to the empty string, and be ignored.
$1_$2_PROGRAM_DEP_LIB = $$($1_$2_v_LIB) $$($1_$2_dyn_LIB)
-$$($1_$2_LIB_NAME)_$2_PROGRAM_DEP_LIB = $$($1_$2_PROGRAM_DEP_LIB)
+$$($1_$2_COMPONENT_ID)_$2_PROGRAM_DEP_LIB = $$($1_$2_PROGRAM_DEP_LIB)
# C and S files are possibly built the "dyn" way.
ifeq "$$(BuildSharedLibs)" "YES"
diff --git a/rules/build-prog.mk b/rules/build-prog.mk
index f09a8c1f6e..52036c6041 100644
--- a/rules/build-prog.mk
+++ b/rules/build-prog.mk
@@ -189,7 +189,7 @@ ifneq "$$(BINDIST)" "YES"
# The quadrupled $'s here are because the _<way>_LIB variables aren't
# necessarily set when this part of the makefile is read
$1/$2/build/tmp/$$($1_$2_PROG) $1/$2/build/tmp/$$($1_$2_PROG).dll : \
- $$(foreach dep,$$($1_$2_DEP_LIB_NAMES),\
+ $$(foreach dep,$$($1_$2_DEP_COMPONENT_IDS),\
$$(if $$(filter ghc%,$$(dep)),\
$(if $(filter 0,$3),$$(compiler_stage1_PROGRAM_DEP_LIB),\
$(if $(filter 1,$3),$$(compiler_stage2_PROGRAM_DEP_LIB),\
@@ -241,7 +241,7 @@ $1/$2/build/tmp/$$($1_$2_PROG)-wrapper.c: driver/utils/dynwrapper.c | $$$$(dir $
echo '#include <Windows.h>' >> $$@
echo '#include "Rts.h"' >> $$@
echo 'LPTSTR path_dirs[] = {' >> $$@
- $$(foreach p,$$($1_$2_TRANSITIVE_DEP_LIB_NAMES),$$(call make-command,echo ' TEXT("/../lib/$$p")$$(comma)' >> $$@))
+ $$(foreach p,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),$$(call make-command,echo ' TEXT("/../lib/$$p")$$(comma)' >> $$@))
echo ' TEXT("/../lib/"),' >> $$@
echo ' NULL};' >> $$@
echo 'LPTSTR progDll = TEXT("../lib/$$($1_$2_PROG).dll");' >> $$@
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index 7a4115cdd9..920ff07f20 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -81,19 +81,19 @@ define distdir-way-opts # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage
# $1_$2_$3_MOST_HC_OPTS is also passed to C compilations when we use
# GHC as the C compiler.
-ifeq "$(SUPPORTS_PACKAGE_KEY)" "NO"
+ifeq "$(SUPPORTS_COMPONENT_ID)" "NO"
ifeq "$4" "0"
-$4_USE_PACKAGE_KEY=NO
+$4_USE_COMPONENT_ID=NO
endif
endif
$1_$2_$4_DEP_OPTS = \
$$(foreach pkg,$$($1_$2_DEP_IPIDS),-package-id $$(pkg))
-ifeq "$($4_USE_PACKAGE_KEY)" "NO"
-$4_THIS_PACKAGE_KEY = -package-name
+ifeq "$($4_USE_COMPONENT_ID)" "NO"
+$4_THIS_COMPONENT_ID = -package-name
else
-$4_THIS_PACKAGE_KEY = -this-package-key
+$4_THIS_COMPONENT_ID = -this-package-key
endif
$1_$2_$3_MOST_HC_OPTS = \
@@ -103,7 +103,7 @@ $1_$2_$3_MOST_HC_OPTS = \
$$($1_HC_OPTS) \
$$($1_$2_HC_PKGCONF) \
$$(if $$($1_$2_PROG),, \
- $$(if $$($1_PACKAGE),$$($4_THIS_PACKAGE_KEY) $$($1_$2_PACKAGE_KEY))) \
+ $$(if $$($1_PACKAGE),$$($4_THIS_COMPONENT_ID) $$($1_$2_COMPONENT_ID))) \
$$(if $$($1_PACKAGE),-hide-all-packages) \
-i $$(if $$($1_$2_HS_SRC_DIRS),$$(foreach dir,$$($1_$2_HS_SRC_DIRS),-i$1/$$(dir)),-i$1) \
-i$1/$2/build -i$1/$2/build/autogen \
@@ -185,11 +185,11 @@ ifneq "$4" "0"
ifeq "$$(TargetElf)" "YES"
$1_$2_$3_GHC_LD_OPTS += \
-fno-use-rpaths \
- $$(foreach d,$$($1_$2_TRANSITIVE_DEP_LIB_NAMES),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-zorigin
+ $$(foreach d,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-zorigin
else ifeq "$$(TargetOS_CPP)" "darwin"
$1_$2_$3_GHC_LD_OPTS += \
-fno-use-rpaths \
- $$(foreach d,$$($1_$2_TRANSITIVE_DEP_LIB_NAMES),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
+ $$(foreach d,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
endif
endif
endif
diff --git a/rules/docbook.mk b/rules/docbook.mk
deleted file mode 100644
index c7c7991cb7..0000000000
--- a/rules/docbook.mk
+++ /dev/null
@@ -1,86 +0,0 @@
-# -----------------------------------------------------------------------------
-#
-# (c) 2009 The University of Glasgow
-#
-# This file is part of the GHC build system.
-#
-# To understand how the build system works and how to modify it, see
-# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
-# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
-#
-# -----------------------------------------------------------------------------
-
-
-# Build docbook docs
-
-define docbook
-$(call trace, docbook($1,$2))
-$(call profStart, docbook($1,$2))
-# $1 = dir
-# $2 = docname
-
-$(call clean-target,$1,docbook,$1/$2 $1/$2.pdf $1/$2.ps)
-
-# empty "all_$1" target just in case we're not building docs at all
-$(call all-target,$1,)
-
-.PHONY: html_$1
-
-ifeq "$$(phase)" "final"
-ifeq "$$(BUILD_DOCBOOK_HTML)" "YES"
-$(call all-target,$1,html_$1)
-INSTALL_HTML_DOC_DIRS += $1/$2
-endif
-endif
-
-html_$1 : $1/$2/index.html
-
-ifneq "$$(BINDIST)" "YES"
-$1/$2/index.html: $$($1_DOCBOOK_SOURCES)
- $$(call removeTrees,$$(dir $$@))
- "$$(XSLTPROC)" --stringparam base.dir $$(dir $$@) \
- --stringparam use.id.as.filename 1 \
- --stringparam html.stylesheet fptools.css \
- --nonet \
- $$(XSLTPROC_LABEL_OPTS) $$(XSLTPROC_OPTS) \
- $$(XSLTPROC_HTML_STYLESHEET) \
- $1/$2.xml
- cp mk/fptools.css $$(dir $$@)
-endif
-
-
-.PHONY: ps_$1
-ifeq "$$(phase)" "final"
-ifeq "$$(BUILD_DOCBOOK_PS)" "YES"
-$(call all-target,$1,ps_$1)
-INSTALL_DOCS += $1/$2.ps
-endif
-endif
-
-ps_$1 : $1/$2.ps
-
-ifneq "$$(BINDIST)" "YES"
-$1/$2.ps: $$($1_DOCBOOK_SOURCES)
- "$$(DBLATEX)" $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@
- [ -f $$@ ]
-endif
-
-ifeq "$$(phase)" "final"
-ifeq "$$(BUILD_DOCBOOK_PDF)" "YES"
-$(call all-target,$1,pdf_$1)
-INSTALL_DOCS += $1/$2.pdf
-endif
-endif
-
-.PHONY: pdf_$1
-pdf_$1 : $1/$2.pdf
-
-ifneq "$$(BINDIST)" "YES"
-$1/$2.pdf: $$($1_DOCBOOK_SOURCES)
- "$$(DBLATEX)" $$(DBLATEX_OPTS) $1/$2.xml --pdf -o $$@
- [ -f $$@ ]
-endif
-
-$(call profEnd, docbook($1,$2))
-endef
-
diff --git a/rules/foreachLibrary.mk b/rules/foreachLibrary.mk
index cdd54962db..1a91cd9d77 100644
--- a/rules/foreachLibrary.mk
+++ b/rules/foreachLibrary.mk
@@ -18,7 +18,7 @@
# Except! If there's a libraries/foo/ghc-packages then it calls
# $(call $1,foo/bar,tag)
# for each word 'bar' in libraries/foo/ghc-packages.
-#
+#
# We use an FEL_ prefix for the variable names, to avoid trampling on
# other variables, as make has no concept of local variables.
@@ -28,7 +28,7 @@
# repositories of their own:
#
# - base
-# - bin-package-db
+# - ghc-boot
# - ghc-prim
# - integer-gmp
# - integer-simple
@@ -37,7 +37,7 @@
define foreachLibrary
# $1 = function to call for each library
# We will give it the package path and the tag as arguments
-$$(foreach hashline,libraries/bin-package-db#-#no-remote-repo#no-vcs \
+$$(foreach hashline,libraries/ghc-boot#-#no-remote-repo#no-vcs \
libraries/base#-#no-remote-repo#no-vcs \
libraries/ghc-prim#-#no-remote-repo#no-vcs \
libraries/integer-gmp#-#no-remote-repo#no-vcs \
diff --git a/rules/sphinx.mk b/rules/sphinx.mk
new file mode 100644
index 0000000000..5a3c7ce747
--- /dev/null
+++ b/rules/sphinx.mk
@@ -0,0 +1,68 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2009 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
+# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
+
+# Build Sphinx documentation
+
+# We are careful not to use the same directory the doctree files for the
+# various Sphinx targets as make may run them in parallel (see #10950).
+
+define sphinx
+$(call trace, sphinx($1,$2))
+$(call profStart, sphinx($1,$2))
+# $1 = dir
+# $2 = docname
+
+$(call clean-target,$1,sphinx,$1/.doctrees-html/ $1/.doctrees-pdf/ $1/build-html/ $1/build-pdf/ $1/$2.pdf)
+
+# empty "all_$1" target just in case we're not building docs at all
+$(call all-target,$1,)
+
+.PHONY: html_$1
+ifeq "$$(phase)" "final"
+ifeq "$$(BUILD_SPHINX_HTML)" "YES"
+$(call all-target,$1,html_$1)
+INSTALL_HTML_DOC_DIRS += $1/build-html/$2 $1/build-html/$2/_static $1/build-html/$2/_sources
+endif
+endif
+
+html_$1 : $1/build-html/$2/index.html
+html : html_$1
+
+ifneq "$$(BINDIST)" "YES"
+$1/build-html/$2/index.html: $1/conf.py $$($1_RST_SOURCES)
+ $(SPHINXBUILD) -b html -d $1/.doctrees-html $(SPHINXOPTS) $1 $1/build-html/$2
+endif
+
+
+.PHONY: pdf_$1
+ifeq "$$(phase)" "final"
+ifeq "$$(BUILD_SPHINX_PDF)" "YES"
+$(call all-target,$1,pdf_$1)
+INSTALL_DOCS += $1/$2.pdf
+endif
+endif
+
+pdf_$1 : $1/$2.pdf
+pdf : pdf_$1
+
+ifneq "$$(BINDIST)" "YES"
+$1/$2.pdf: $$($1_RST_SOURCES)
+ $(SPHINXBUILD) -b latex -d $1/.doctrees-pdf $(SPHINXOPTS) $1 $1/build-pdf/$2
+ cd $1/build-pdf/$2 ; xelatex $2.tex
+ cd $1/build-pdf/$2 ; xelatex $2.tex
+ cp $1/build-pdf/$2/$2.pdf $1/$2.pdf
+endif
+
+
+$(call profEnd, sphinx($1,$2))
+endef