summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-09-17 22:44:09 +0000
committerIan Lynagh <igloo@earth.li>2010-09-17 22:44:09 +0000
commit6e9db31207f1bdc5fe2310d2e91664640a21c679 (patch)
treea6d4c3491aec4b0d1e4da516c7185d0a968be526 /rules
parent44af05750763722c9189c7e80890b101644b467f (diff)
downloadhaskell-6e9db31207f1bdc5fe2310d2e91664640a21c679.tar.gz
extra packages info is now read from packages file
rather than being repeated in the build system
Diffstat (limited to 'rules')
-rw-r--r--rules/extra-packages.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/rules/extra-packages.mk b/rules/extra-packages.mk
new file mode 100644
index 0000000000..134fa42e16
--- /dev/null
+++ b/rules/extra-packages.mk
@@ -0,0 +1,29 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2010 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://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
+# http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
+define extra-packages
+$$(foreach p,$$(patsubst libraries/%,%,$$(wildcard $$(shell grep '^[^ ]\+ \+\(dph\|extra\) \+[^ ]\+ \+[^ ]\+ \+[^ ]\+' packages | sed 's/ .*//'))),\
+ $$(eval BUILD_DIRS += libraries/$$p)\
+ $$(if $$(wildcard libraries/$$p/ghc-packages),\
+ $$(foreach q,$$(shell cat libraries/$$p/ghc-packages2),$$(eval $$(call extra-package,$$p,$$p/$$q))),\
+ $$(eval $$(call extra-package,$$p,$$p)))\
+)
+endef
+
+define extra-package # $1 = package root, $2 = package
+ifeq "$(wildcard libraries/$1/ghc-stage2-package)" ""
+$$(eval $$(call addPackage,$2))
+else
+$$(eval $$(call addPackage2,$2))
+endif
+endef
+