micro-opt: replace stmGetEnclosingTRec() with a field access
[ghc-hetmet.git] / rules / bindist.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009 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
14 # Add files to the bindist. Invoke like this:
15 #
16 # $(eval $(call bindist,utils/genapply,ghc.mk))
17
18 define bindist
19 # $1 = name
20 # $2 = files
21
22 .PHONY: bindist_$1
23 bindist: bindist_$1
24
25 bindist_$1:
26 $(foreach i,$2,$(call bindist_item,$i))
27 endef
28
29 define bindist_item
30
31 # $1 = the line
32 # The formatting of this definition (e.g. the blank line above) is
33 # important, in order to get make to generate the right makefile code.
34         for f in $1; do echo $(BIN_DIST_NAME)/$$$$f >> $(BIN_DIST_LIST); done
35 endef
36