Fix build on cygwin: Normalise slashes in .depend files to be /
[ghc-hetmet.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 define extra-packages
14 $$(foreach p,$$(patsubst libraries/%,%,$$(wildcard $$(shell grep '^[^ ]\+ \+\(dph\|extra\) \+[^ ]\+ \+[^ ]\+ \+[^ ]\+' packages | sed 's/ .*//'))),\
15     $$(eval BUILD_DIRS += libraries/$$p)\
16     $$(if $$(wildcard libraries/$$p/ghc-packages),\
17         $$(foreach q,$$(shell cat libraries/$$p/ghc-packages2),$$(eval $$(call extra-package,$$p,$$p/$$q))),\
18         $$(eval $$(call extra-package,$$p,$$p)))\
19 )
20 endef
21
22 define extra-package # $1 = package root, $2 = package
23 ifeq "$(wildcard libraries/$1/ghc-stage2-package)" ""
24 $$(eval $$(call addPackage,$2))
25 else
26 $$(eval $$(call addPackage2,$2))
27 endif
28 endef
29