2 ################################################################################
4 # Layout of the source tree
6 ################################################################################
8 # Here we provide defines for the various directories in the source tree,
9 # so we can move things around more easily. A define $(GHC_FOO_DIR)
10 # indicates a directory relative to the top of the source tree.
13 GHC_INCLUDE_DIRS
= includes includes
/dist includes
/dist-derivedconstants
/header includes
/dist-ghcconstants
/header
15 GHC_DRIVER_DIR
= driver
18 INPLACE_BIN
= $(INPLACE
)/bin
19 INPLACE_LIB
= $(INPLACE
)/lib
20 INPLACE_TOPDIR
= $(INPLACE
)/lib
21 INPLACE_MINGW
= $(INPLACE
)/mingw
22 INPLACE_PERL
= $(INPLACE
)/perl
24 ################################################################################
26 # Bindist testing directory
28 ################################################################################
30 BIN_DIST_INST_SUBDIR
= "install dir"
31 BIN_DIST_INST_DIR
= bindisttest
/$(BIN_DIST_INST_SUBDIR
)
33 ################################################################################
37 ################################################################################
39 # These are here, rather than in config.mk, as they need to exist in an
40 # unconfigured tree so that the various clean targets can be used
41 # without configuring:
42 ifeq "$(ONLY_SHOW_CLEANS)" "YES"
43 RM
= utils
/testremove
/wouldrm
45 RM_OPTS_REC
= CLEAN_REC
52 # If $1 is empty then we don't do anything (as "rm -rf" fails on
53 # Solaris; trac #4916).
54 # If $1 contains a * then we fail; globbing needs to be done at the call
55 # site using $(wildcard ...). This makes it a little safer, as it's
56 # harder to accidentally delete something you didn't mean to.
57 # Similarly, we fail if any argument contains ".." or starts with a "/".
59 removeFiles
= $(call removeHelper
,removeFiles
,"$(RM)",$(RM_OPTS
),$1)
60 removeTrees
= $(call removeHelper
,removeTrees
,"$(RM)",$(RM_OPTS_REC
),$1)
62 removeHelper
= $(if
$(strip $4),\
63 $(if
$(findstring *,$4),\
64 $(error
$1: Got a star
: $4),\
65 $(if
$(findstring ..
,$4),\
66 $(error
$1: Got dot-dot
: $4),\
67 $(if
$(filter /%,$4),\
68 $(error
$1: Got leading slash
: $4),\