HsStringPrim now contains FastBytes, not FastString
[ghc.git] / mk / tree.mk
1
2 ifneq "$(findstring 3.7, $(MAKE_VERSION))" ""
3 ifeq "$(findstring 3.79.1, $(MAKE_VERSION))" ""
4 $(error GNU make version 3.79.1 or later is required.)
5 endif
6 endif
7
8 ################################################################################
9 #
10 # Layout of the source tree
11 #
12 ################################################################################
13
14 # Here we provide defines for the various directories in the source tree,
15 # so we can move things around more easily. A define $(GHC_FOO_DIR)
16 # indicates a directory relative to the top of the source tree.
17
18 GHC_UTILS_DIR = utils
19 GHC_INCLUDE_DIRS = includes includes/dist includes/dist-derivedconstants/header includes/dist-ghcconstants/header
20 GHC_COMPILER_DIR = compiler
21 GHC_PROG_DIR = ghc
22 GHC_RTS_DIR = rts
23 GHC_DRIVER_DIR = driver
24 GHC_COMPAT_DIR = compat
25
26 GHC_LTX_DIR = $(GHC_UTILS_DIR)/ltx
27 GHC_LNDIR_DIR = $(GHC_UTILS_DIR)/lndir
28 GHC_MKDIRHIER_DIR = $(GHC_UTILS_DIR)/mkdirhier
29 GHC_DOCBOOK_DIR = $(GHC_UTILS_DIR)/docbook
30 GHC_UNLIT_DIR = $(GHC_UTILS_DIR)/unlit
31 GHC_HP2PS_DIR = $(GHC_UTILS_DIR)/hp2ps
32 GHC_GHCTAGS_DIR = $(GHC_UTILS_DIR)/ghctags
33 GHC_HSC2HS_DIR = $(GHC_UTILS_DIR)/hsc2hs
34 GHC_TOUCHY_DIR = $(GHC_UTILS_DIR)/touchy
35 GHC_PKG_DIR = $(GHC_UTILS_DIR)/ghc-pkg
36 GHC_GENPRIMOP_DIR = $(GHC_UTILS_DIR)/genprimopcode
37 GHC_GENAPPLY_DIR = $(GHC_UTILS_DIR)/genapply
38 GHC_CABAL_DIR = $(GHC_UTILS_DIR)/ghc-cabal
39 GHC_SPLIT_DIR = $(GHC_DRIVER_DIR)/split
40 GHC_SYSMAN_DIR = $(GHC_RTS_DIR)/parallel
41
42 INPLACE = inplace
43 INPLACE_BIN = $(INPLACE)/bin
44 INPLACE_LIB = $(INPLACE)/lib
45 INPLACE_TOPDIR = $(INPLACE)/lib
46 INPLACE_MINGW = $(INPLACE)/mingw
47 INPLACE_PERL = $(INPLACE)/perl
48
49 ################################################################################
50 #
51 # Bindist testing directory
52 #
53 ################################################################################
54
55 BIN_DIST_INST_SUBDIR = "install dir"
56 BIN_DIST_INST_DIR = bindisttest/$(BIN_DIST_INST_SUBDIR)
57
58 ################################################################################
59 #
60 # rm
61 #
62 ################################################################################
63
64 # These are here, rather than in config.mk, as they need to exist in an
65 # unconfigured tree so that the various clean targets can be used
66 # without configuring:
67 ifeq "$(ONLY_SHOW_CLEANS)" "YES"
68 RM = utils/testremove/wouldrm
69 RM_OPTS = CLEAN_FILES
70 RM_OPTS_REC = CLEAN_REC
71 else
72 RM = rm
73 RM_OPTS = -f
74 RM_OPTS_REC = -rf
75 endif
76
77 # If $1 is empty then we don't do anything (as "rm -rf" fails on
78 # Solaris; trac #4916).
79 # If $1 contains a * then we fail; globbing needs to be done at the call
80 # site using $(wildcard ...). This makes it a little safer, as it's
81 # harder to accidentally delete something you didn't mean to.
82 # Similarly, we fail if any argument contains ".." or starts with a "/".
83
84 removeFiles = $(call removeHelper,removeFiles,"$(RM)",$(RM_OPTS),$1)
85 removeTrees = $(call removeHelper,removeTrees,"$(RM)",$(RM_OPTS_REC),$1)
86
87 removeHelper = $(if $(strip $4),\
88 $(if $(findstring *,$4),\
89 $(error $1: Got a star: $4),\
90 $(if $(findstring ..,$4),\
91 $(error $1: Got dot-dot: $4),\
92 $(if $(filter /%,$4),\
93 $(error $1: Got leading slash: $4),\
94 $2 $3 $4\
95 )))\
96 )
97