Implement PowerPC 64-bit native code backend for Linux
[ghc.git] / mk / tree.mk
1
2 ################################################################################
3 #
4 # Layout of the source tree
5 #
6 ################################################################################
7
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.
11
12 GHC_UTILS_DIR = utils
13 GHC_INCLUDE_DIRS = includes includes/dist includes/dist-derivedconstants/header includes/dist-ghcconstants/header
14 GHC_RTS_DIR = rts
15 GHC_DRIVER_DIR = driver
16
17 INPLACE = inplace
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
23
24 ################################################################################
25 #
26 # Bindist testing directory
27 #
28 ################################################################################
29
30 BIN_DIST_INST_SUBDIR = "install dir"
31 BIN_DIST_INST_DIR = bindisttest/$(BIN_DIST_INST_SUBDIR)
32
33 ################################################################################
34 #
35 # rm
36 #
37 ################################################################################
38
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
44 RM_OPTS = CLEAN_FILES
45 RM_OPTS_REC = CLEAN_REC
46 else
47 RM = rm
48 RM_OPTS = -f
49 RM_OPTS_REC = -rf
50 endif
51
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 "/".
58
59 removeFiles = $(call removeHelper,removeFiles,"$(RM)",$(RM_OPTS),$1)
60 removeTrees = $(call removeHelper,removeTrees,"$(RM)",$(RM_OPTS_REC),$1)
61
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),\
69 $2 $3 $4\
70 )))\
71 )
72