Remove the Windows installer
[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_RTS_DIR = rts
21 GHC_DRIVER_DIR = driver
22
23 INPLACE = inplace
24 INPLACE_BIN = $(INPLACE)/bin
25 INPLACE_LIB = $(INPLACE)/lib
26 INPLACE_TOPDIR = $(INPLACE)/lib
27 INPLACE_MINGW = $(INPLACE)/mingw
28 INPLACE_PERL = $(INPLACE)/perl
29
30 ################################################################################
31 #
32 # Bindist testing directory
33 #
34 ################################################################################
35
36 BIN_DIST_INST_SUBDIR = "install dir"
37 BIN_DIST_INST_DIR = bindisttest/$(BIN_DIST_INST_SUBDIR)
38
39 ################################################################################
40 #
41 # rm
42 #
43 ################################################################################
44
45 # These are here, rather than in config.mk, as they need to exist in an
46 # unconfigured tree so that the various clean targets can be used
47 # without configuring:
48 ifeq "$(ONLY_SHOW_CLEANS)" "YES"
49 RM = utils/testremove/wouldrm
50 RM_OPTS = CLEAN_FILES
51 RM_OPTS_REC = CLEAN_REC
52 else
53 RM = rm
54 RM_OPTS = -f
55 RM_OPTS_REC = -rf
56 endif
57
58 # If $1 is empty then we don't do anything (as "rm -rf" fails on
59 # Solaris; trac #4916).
60 # If $1 contains a * then we fail; globbing needs to be done at the call
61 # site using $(wildcard ...). This makes it a little safer, as it's
62 # harder to accidentally delete something you didn't mean to.
63 # Similarly, we fail if any argument contains ".." or starts with a "/".
64
65 removeFiles = $(call removeHelper,removeFiles,"$(RM)",$(RM_OPTS),$1)
66 removeTrees = $(call removeHelper,removeTrees,"$(RM)",$(RM_OPTS_REC),$1)
67
68 removeHelper = $(if $(strip $4),\
69 $(if $(findstring *,$4),\
70 $(error $1: Got a star: $4),\
71 $(if $(findstring ..,$4),\
72 $(error $1: Got dot-dot: $4),\
73 $(if $(filter /%,$4),\
74 $(error $1: Got leading slash: $4),\
75 $2 $3 $4\
76 )))\
77 )
78