Don't build the ghc DLL on Windows; works around trac #5987
[ghc.git] / rules / extra-packages.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2010 The University of Glasgow
4 #
5 # This file is part of the GHC build system.
6 #
7 # To understand how the build system works and how to modify it, see
8 # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13 # For each package P marked as "dph" or "extra" in $(TOP)/packages:
14 # if $(TOP)/libraries/P exists, then
15 # if $(TOP)/libraries/P/ghc-packages exists, then
16 # * add each package from $(TOP)/libraries/P/ghc-packages2 to the list of
17 # packages.
18 # Note: ghc-packages2 might have a different list from
19 # ghc-packages, this is to support dph which has some
20 # packages that are automatically derived from a single
21 # source by the build system).
22 # * add $(TOP)/libraries/P to $(BUILD_DIRS)
23 # This step is necessary in the case of dph, which has some
24 # build system code in libraries/dph/ghc.mk, but
25 # libraries/dph is not itself a package.
26 # else
27 # add P to the list of packages
28
29 define extra-packages
30
31 # Collects some dirs containing ghc.mk files that we need to include:
32 BUILD_DIRS_EXTRA=
33
34 $$(foreach p,$$(patsubst libraries/%,%,$$(wildcard $$(shell grep '^[^ #][^ ]* \+\(dph\|extra\) \+[^ ]\+ \+[^ ]\+$$$$' packages | sed 's/ .*//'))),\
35 $$(if $$(wildcard libraries/$$p/ghc-packages),\
36 $$(eval BUILD_DIRS_EXTRA += libraries/$$p) \
37 $$(foreach q,$$(shell cat libraries/$$p/ghc-packages2),$$(eval $$(call extra-package,$$p,$$p/$$q))),\
38 $$(eval $$(call extra-package,$$p,$$p)))\
39 )
40 endef
41
42 define extra-package # $1 = package root, $2 = package
43 $(call trace, extra-package($1,$2))
44
45 EXTRA_PACKAGES += $2
46 $$(eval $$(call addPackage,$2))
47
48 endef