Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 1 | # An explanation of how the build is structured: |
| 2 | # |
| 3 | # There are multiple build stages (0-3) needed to verify that the |
| 4 | # compiler is properly self-hosting. Each stage is divided between |
| 5 | # 'host' artifacts and 'target' artifacts, where the stageN host |
| 6 | # compiler builds artifacts for 1 or more stageN target architectures. |
| 7 | # Once the stageN target compiler has been built for the host |
| 8 | # architecture it is promoted (copied) to a stageN+1 host artifact. |
| 9 | # |
| 10 | # The stage3 host compiler is a compiler that successfully builds |
| 11 | # itself and should (in theory) be bitwise identical to the stage2 |
| 12 | # host compiler. The process is bootstrapped using a stage0 host |
| 13 | # compiler downloaded from a previous snapshot. |
| 14 | # |
| 15 | # At no time should stageN artifacts be interacting with artifacts |
| 16 | # from other stages. For consistency, we use the 'promotion' logic |
| 17 | # for all artifacts, even those that don't make sense on non-host |
| 18 | # architectures. |
| 19 | # |
| 20 | # The directory layout for a stage is intended to match the layout |
| 21 | # of the installed compiler, and looks like the following: |
| 22 | # |
| 23 | # stageN - this is the system root, corresponding to, e.g. /usr |
| 24 | # bin - binaries compiled for the host |
| 25 | # lib - libraries used by the host compiler |
| 26 | # rustc - rustc's own place to organize libraries |
| 27 | # $(target) - target-specific artifacts |
| 28 | # bin - binaries for target architectures |
| 29 | # lib - libraries for target architectures |
| 30 | # |
| 31 | # A note about host libraries: |
| 32 | # |
| 33 | # The only libraries that get promoted to stageN/lib are those needed |
Brian Anderson | 19797df | 2011-11-03 17:53:49 | [diff] [blame] | 34 | # by rustc. In general, rust programs, even those compiled for the |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 35 | # host architecture will use libraries from the target |
| 36 | # directories. This gives rust some freedom to experiment with how |
| 37 | # libraries are managed and versioned without polluting the common |
| 38 | # areas of the filesystem. |
| 39 | # |
| 40 | # General rust binaries may stil live in the host bin directory; they |
| 41 | # will just link against the libraries in the target lib directory. |
| 42 | # |
| 43 | # Admittedly this is a little convoluted. |
| 44 | |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 45 | STAGES = 0 1 2 3 |
| 46 | |
Graydon Hoare | 9c6e7e6 | 2011-03-16 16:17:32 | [diff] [blame] | 47 | ###################################################################### |
| 48 | # Residual auto-configuration |
| 49 | ###################################################################### |
| 50 | |
| 51 | include config.mk |
Graydon Hoare | 9c6e7e6 | 2011-03-16 16:17:32 | [diff] [blame] | 52 | |
Niko Matsakis | 9c00c62 | 2011-11-23 23:20:28 | [diff] [blame] | 53 | ifdef IGNORE_MKFILES |
| 54 | MKFILE_DEPS := |
| 55 | else |
Niko Matsakis | 5ce33ce | 2011-11-29 20:42:05 | [diff] [blame] | 56 | OUR_MKFILES := Makefile config.mk $(wildcard $(CFG_SRC_DIR)/mk/*.mk) |
| 57 | 3RDPARTY_MKFILES := $(CFG_SRC_DIR)/src/libuv/Makefile \ |
| 58 | $(wildcard $(CFG_SRC_DIR)/src/libuv/*.mk) |
| 59 | GEN_MKFILES := $(wildcard $(CFG_SRC_DIR)/mk/libuv/*/*/*) \ |
| 60 | $(wildcard $(CFG_SRC_DIR)/mk/libuv/mac/src/libuv/*) \ |
| 61 | $(wildcard $(CFG_SRC_DIR)/mk/libuv/mac/src/libuv/*) \ |
| 62 | $(wildcard $(CFG_SRC_DIR)/mk/libuv/mac/src/libuv/*) |
| 63 | MKFILE_DEPS := $(OUR_MKFILES) $(3RDPARTY_MKFILES) $(GEN_MKFILES) |
Niko Matsakis | 9c00c62 | 2011-11-23 23:20:28 | [diff] [blame] | 64 | endif |
| 65 | |
Niko Matsakis | 8371beb | 2011-11-22 21:04:52 | [diff] [blame] | 66 | NON_HOST_TRIPLES = $(filter-out $(CFG_HOST_TRIPLE),$(CFG_TARGET_TRIPLES)) |
| 67 | |
Graydon Hoare | 9c6e7e6 | 2011-03-16 16:17:32 | [diff] [blame] | 68 | ifneq ($(MAKE_RESTARTS),) |
| 69 | CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS)) |
| 70 | endif |
| 71 | |
Graydon Hoare | 1321580 | 2011-09-21 18:24:59 | [diff] [blame] | 72 | CFG_INFO := $(info cfg: shell host triple $(CFG_HOST_TRIPLE)) |
Niko Matsakis | 8371beb | 2011-11-22 21:04:52 | [diff] [blame] | 73 | CFG_INFO := $(info cfg: non host triples $(NON_HOST_TRIPLES)) |
Graydon Hoare | 9c6e7e6 | 2011-03-16 16:17:32 | [diff] [blame] | 74 | |
Graydon Hoare | cae703c | 2011-04-08 22:44:41 | [diff] [blame] | 75 | ifdef CFG_DISABLE_OPTIMIZE |
Graydon Hoare | 19ebc0f | 2011-04-08 23:29:19 | [diff] [blame] | 76 | $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE)) |
Patrick Walton | c52fb52 | 2011-04-29 17:23:07 | [diff] [blame] | 77 | CFG_RUSTC_FLAGS := |
Graydon Hoare | cae703c | 2011-04-08 22:44:41 | [diff] [blame] | 78 | else |
Patrick Walton | c52fb52 | 2011-04-29 17:23:07 | [diff] [blame] | 79 | CFG_RUSTC_FLAGS := -O |
Graydon Hoare | cae703c | 2011-04-08 22:44:41 | [diff] [blame] | 80 | endif |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 81 | |
Patrick Walton | 3f77e7d | 2011-04-25 21:20:28 | [diff] [blame] | 82 | ifdef SAVE_TEMPS |
Marijn Haverbeke | 6b11f6c | 2011-04-26 18:32:08 | [diff] [blame] | 83 | CFG_RUSTC_FLAGS += --save-temps |
Patrick Walton | 3f77e7d | 2011-04-25 21:20:28 | [diff] [blame] | 84 | endif |
Patrick Walton | 648c4ae | 2011-04-29 18:55:32 | [diff] [blame] | 85 | ifdef TIME_PASSES |
| 86 | CFG_RUSTC_FLAGS += --time-passes |
| 87 | endif |
Brian Anderson | 2752284 | 2011-06-19 00:26:41 | [diff] [blame] | 88 | ifdef TIME_LLVM_PASSES |
| 89 | CFG_RUSTC_FLAGS += --time-llvm-passes |
| 90 | endif |
Patrick Walton | 404db4d | 2011-05-11 00:48:49 | [diff] [blame] | 91 | ifdef DEBUG |
| 92 | CFG_RUSTC_FLAGS += -g |
| 93 | endif |
Patrick Walton | 3f77e7d | 2011-04-25 21:20:28 | [diff] [blame] | 94 | |
Graydon Hoare | 40624e3 | 2011-05-01 20:18:52 | [diff] [blame] | 95 | # platform-specific auto-configuration |
| 96 | include $(CFG_SRC_DIR)/mk/platform.mk |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 97 | |
Brian Anderson | cad8c73 | 2011-05-14 03:20:34 | [diff] [blame] | 98 | # Run the stage1/2 compilers under valgrind |
| 99 | ifdef VALGRIND_COMPILE |
| 100 | CFG_VALGRIND_COMPILE :=$(CFG_VALGRIND) |
| 101 | else |
| 102 | CFG_VALGRIND_COMPILE := |
| 103 | endif |
| 104 | |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 105 | CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt) |
Graydon Hoare | 7ac885e | 2011-03-22 06:06:42 | [diff] [blame] | 106 | CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm) |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 107 | CFG_CORELIB :=$(call CFG_LIB_NAME,core) |
Haitao Li | b4f450a | 2011-11-18 08:00:28 | [diff] [blame] | 108 | CFG_STDLIB :=$(call CFG_LIB_NAME,std) |
Brian Anderson | 5fb9cad | 2011-07-01 06:16:01 | [diff] [blame] | 109 | CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc) |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 110 | |
Haitao Li | 6dbd4c2 | 2011-12-02 16:51:59 | [diff] [blame] | 111 | STDLIB_GLOB :=$(call CFG_LIB_GLOB,std) |
| 112 | CORELIB_GLOB :=$(call CFG_LIB_GLOB,core) |
| 113 | LIBRUSTC_GLOB :=$(call CFG_LIB_GLOB,rustc) |
| 114 | |
Graydon Hoare | 1e03f00 | 2011-05-06 18:21:51 | [diff] [blame] | 115 | # version-string calculation |
| 116 | CFG_GIT_DIR := $(CFG_SRC_DIR).git |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 117 | CFG_VERSION = prerelease |
Graydon Hoare | 0a8f9a3 | 2011-06-13 21:45:26 | [diff] [blame] | 118 | ifneq ($(wildcard $(CFG_GIT)),) |
Graydon Hoare | 1e03f00 | 2011-05-06 18:21:51 | [diff] [blame] | 119 | ifneq ($(wildcard $(CFG_GIT_DIR)),) |
| 120 | CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \ |
| 121 | --pretty=format:'(%h %ci)') |
| 122 | endif |
Graydon Hoare | 0a8f9a3 | 2011-06-13 21:45:26 | [diff] [blame] | 123 | endif |
Graydon Hoare | 1e03f00 | 2011-05-06 18:21:51 | [diff] [blame] | 124 | |
Graydon Hoare | 94731fa | 2011-03-30 04:45:09 | [diff] [blame] | 125 | ifdef CFG_DISABLE_VALGRIND |
| 126 | $(info cfg: disabling valgrind (CFG_DISABLE_VALGRIND)) |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 127 | CFG_VALGRIND := |
Graydon Hoare | 9c6e7e6 | 2011-03-16 16:17:32 | [diff] [blame] | 128 | endif |
Patrick Walton | 518e2d2 | 2011-05-06 01:11:40 | [diff] [blame] | 129 | ifdef CFG_BAD_VALGRIND |
| 130 | $(info cfg: disabling valgrind due to its unreliability on this platform) |
| 131 | CFG_VALGRIND := |
| 132 | endif |
Graydon Hoare | 9c6e7e6 | 2011-03-16 16:17:32 | [diff] [blame] | 133 | |
Graydon Hoare | 28a4e77 | 2011-03-23 17:37:35 | [diff] [blame] | 134 | DOCS := |
Graydon Hoare | fefdb63 | 2012-01-13 03:10:30 | [diff] [blame] | 135 | ifeq ($(CFG_PANDOC),) |
| 136 | $(info cfg: no pandoc found, omitting doc/rust.html) |
Graydon Hoare | 28a4e77 | 2011-03-23 17:37:35 | [diff] [blame] | 137 | else |
| 138 | DOCS += doc/rust.html |
| 139 | endif |
| 140 | |
Graydon Hoare | fefdb63 | 2012-01-13 03:10:30 | [diff] [blame] | 141 | ifeq ($(CFG_PANDOC),) |
| 142 | $(info cfg: no pandoc found, omitting doc/rust.pdf) |
Graydon Hoare | 28a4e77 | 2011-03-23 17:37:35 | [diff] [blame] | 143 | else |
Graydon Hoare | fefdb63 | 2012-01-13 03:10:30 | [diff] [blame] | 144 | ifeq ($(CFG_PDFLATEX),) |
| 145 | $(info cfg: no pdflatex found, omitting doc/rust.pdf) |
Graydon Hoare | f740747 | 2011-03-23 20:31:51 | [diff] [blame] | 146 | else |
| 147 | DOCS += doc/rust.pdf |
| 148 | endif |
Graydon Hoare | 28a4e77 | 2011-03-23 17:37:35 | [diff] [blame] | 149 | endif |
| 150 | |
Brian Anderson | 0c62007 | 2011-10-27 21:59:22 | [diff] [blame] | 151 | ifeq ($(CFG_NATURALDOCS),) |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 152 | $(info cfg: no naturaldocs found, omitting library doc build) |
Brian Anderson | 0c62007 | 2011-10-27 21:59:22 | [diff] [blame] | 153 | else |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 154 | DOCS += doc/core/index.html doc/std/index.html |
Brian Anderson | 0c62007 | 2011-10-27 21:59:22 | [diff] [blame] | 155 | endif |
| 156 | |
Graydon Hoare | 94731fa | 2011-03-30 04:45:09 | [diff] [blame] | 157 | ifdef CFG_DISABLE_DOCS |
| 158 | $(info cfg: disabling doc build (CFG_DISABLE_DOCS)) |
| 159 | DOCS := |
| 160 | endif |
Graydon Hoare | 28a4e77 | 2011-03-23 17:37:35 | [diff] [blame] | 161 | |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 162 | ###################################################################### |
| 163 | # Target-and-rule "utility variables" |
| 164 | ###################################################################### |
| 165 | |
| 166 | ifdef VERBOSE |
| 167 | Q := |
| 168 | E = |
| 169 | else |
| 170 | Q := @ |
| 171 | E = echo $(1) |
| 172 | endif |
| 173 | |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 174 | S := $(CFG_SRC_DIR) |
| 175 | X := $(CFG_EXE_SUFFIX) |
| 176 | |
| 177 | # Look in doc and src dirs. |
| 178 | VPATH := $(S)doc $(S)src |
| 179 | |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 180 | # "Source" files we generate in builddir along the way. |
Graydon Hoare | 40624e3 | 2011-05-01 20:18:52 | [diff] [blame] | 181 | GENERATED := |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 182 | |
| 183 | # Delete the built-in rules. |
| 184 | .SUFFIXES: |
| 185 | %:: %,v |
| 186 | %:: RCS/%,v |
| 187 | %:: RCS/% |
| 188 | %:: s.% |
| 189 | %:: SCCS/s.% |
Graydon Hoare | 9c6e7e6 | 2011-03-16 16:17:32 | [diff] [blame] | 190 | |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 191 | ###################################################################### |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 192 | # Core library variables |
| 193 | ###################################################################### |
| 194 | |
| 195 | CORELIB_CRATE := $(S)src/libcore/core.rc |
| 196 | CORELIB_INPUTS := $(wildcard $(addprefix $(S)src/libcore/, \ |
| 197 | core.rc *.rs */*.rs)) |
| 198 | |
| 199 | ###################################################################### |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 200 | # Standard library variables |
| 201 | ###################################################################### |
| 202 | |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 203 | STDLIB_CRATE := $(S)src/libstd/std.rc |
| 204 | STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/libstd/, \ |
| 205 | std.rc *.rs */*.rs)) |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 206 | |
| 207 | ###################################################################### |
| 208 | # rustc crate variables |
| 209 | ###################################################################### |
| 210 | |
Graydon Hoare | 6597439 | 2011-03-21 20:42:29 | [diff] [blame] | 211 | COMPILER_CRATE := $(S)src/comp/rustc.rc |
Graydon Hoare | 0fba2d0 | 2012-01-10 22:34:53 | [diff] [blame] | 212 | COMPILER_INPUTS := $(filter-out $(S)src/comp/driver/rustc.rs, \ |
| 213 | $(wildcard $(addprefix $(S)src/comp/, \ |
| 214 | rustc.rc *.rs */*.rs */*/*.rs))) |
Haitao Li | bc95ccb | 2011-12-20 10:17:13 | [diff] [blame] | 215 | |
| 216 | RUSTC_INPUTS := $(S)src/comp/driver/rustc.rs |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 217 | |
| 218 | ###################################################################### |
Brian Anderson | a0ff3db | 2011-11-02 00:09:44 | [diff] [blame] | 219 | # LLVM macros |
| 220 | ###################################################################### |
| 221 | |
Brian Anderson | a92218e | 2011-11-27 06:38:36 | [diff] [blame] | 222 | # FIXME: x86-ism |
| 223 | LLVM_COMPONENTS=x86 ipo bitreader bitwriter linker asmparser |
| 224 | |
Brian Anderson | 4b6585c | 2011-11-02 23:21:17 | [diff] [blame] | 225 | define DEF_LLVM_VARS |
| 226 | # The configure script defines these variables with the target triples |
| 227 | # separated by Z. This defines new ones with the expected format. |
| 228 | CFG_LLVM_BUILD_DIR_$(1):=$$(CFG_LLVM_BUILD_DIR_$(subst -,_,$(1))) |
| 229 | CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_INST_DIR_$(subst -,_,$(1))) |
Brian Anderson | a0ff3db | 2011-11-02 00:09:44 | [diff] [blame] | 230 | |
Brian Anderson | 4b6585c | 2011-11-02 23:21:17 | [diff] [blame] | 231 | # Any rules that depend on LLVM should depend on LLVM_CONFIG |
Brian Anderson | 283cf35 | 2011-12-14 06:43:32 | [diff] [blame] | 232 | LLVM_CONFIG_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-config$$(X) |
| 233 | LLVM_MC_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-mc$$(X) |
Brian Anderson | 4b6585c | 2011-11-02 23:21:17 | [diff] [blame] | 234 | LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version) |
| 235 | LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir) |
| 236 | LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir) |
| 237 | LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir) |
Brian Anderson | a92218e | 2011-11-27 06:38:36 | [diff] [blame] | 238 | LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS)) |
Brian Anderson | 4b6585c | 2011-11-02 23:21:17 | [diff] [blame] | 239 | LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags) |
| 240 | LLVM_CXXFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --cxxflags) |
| 241 | LLVM_HOST_TRIPLE_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --host-target) |
| 242 | |
Brian Anderson | ecdeffb | 2011-12-14 03:03:43 | [diff] [blame] | 243 | LLVM_AS_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-as$$(X) |
| 244 | LLC_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llc$$(X) |
Brian Anderson | 4b6585c | 2011-11-02 23:21:17 | [diff] [blame] | 245 | |
| 246 | endef |
| 247 | |
| 248 | $(foreach target,$(CFG_TARGET_TRIPLES), \ |
| 249 | $(eval $(call DEF_LLVM_VARS,$(target)))) |
| 250 | |
Brian Anderson | a0ff3db | 2011-11-02 00:09:44 | [diff] [blame] | 251 | ###################################################################### |
Graydon Hoare | d987b49 | 2011-05-03 06:37:52 | [diff] [blame] | 252 | # Exports for sub-utilities |
| 253 | ###################################################################### |
| 254 | |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 255 | # Note that any variable that re-configure should pick up needs to be |
| 256 | # exported |
| 257 | |
Graydon Hoare | d987b49 | 2011-05-03 06:37:52 | [diff] [blame] | 258 | export CFG_SRC_DIR |
Graydon Hoare | ad954fc | 2011-07-23 19:26:47 | [diff] [blame] | 259 | export CFG_BUILD_DIR |
Graydon Hoare | 1e03f00 | 2011-05-06 18:21:51 | [diff] [blame] | 260 | export CFG_VERSION |
Brian Anderson | 6306c81 | 2011-09-29 19:21:58 | [diff] [blame] | 261 | export CFG_HOST_TRIPLE |
Graydon Hoare | 6a4a85f | 2011-05-18 19:00:26 | [diff] [blame] | 262 | export CFG_LLVM_ROOT |
Graydon Hoare | 0dc2aa3 | 2011-06-28 18:18:25 | [diff] [blame] | 263 | export CFG_ENABLE_MINGW_CROSS |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 264 | export CFG_PREFIX |
Brian Anderson | 9e40e43 | 2012-01-11 01:45:03 | [diff] [blame] | 265 | export CFG_LIBDIR |
Graydon Hoare | d987b49 | 2011-05-03 06:37:52 | [diff] [blame] | 266 | |
Patrick Walton | 04f966f | 2011-05-05 01:28:30 | [diff] [blame] | 267 | ###################################################################### |
| 268 | # Subprograms |
| 269 | ###################################################################### |
| 270 | |
Graydon Hoare | d987b49 | 2011-05-03 06:37:52 | [diff] [blame] | 271 | ###################################################################### |
Graydon Hoare | fafb42e | 2011-07-15 23:12:41 | [diff] [blame] | 272 | # Per-stage targets and runner |
| 273 | ###################################################################### |
| 274 | |
| 275 | define SREQ |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 276 | # $(1) is the stage number |
| 277 | # $(2) is the target triple |
Graydon Hoare | 766e29c | 2011-11-30 03:28:15 | [diff] [blame] | 278 | # $(3) is the host triple |
Brian Anderson | ed106dd | 2011-09-30 19:08:51 | [diff] [blame] | 279 | |
Brian Anderson | 38c67a4 | 2011-09-30 19:24:28 | [diff] [blame] | 280 | # Destinations of artifacts for the host compiler |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 281 | HROOT$(1)_H_$(3) = $(3)/stage$(1) |
| 282 | HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin |
Brian Anderson | 9e40e43 | 2012-01-11 01:45:03 | [diff] [blame] | 283 | HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR) |
Brian Anderson | 38c67a4 | 2011-09-30 19:24:28 | [diff] [blame] | 284 | |
Brian Anderson | 9563c17 | 2011-10-01 02:00:19 | [diff] [blame] | 285 | # Destinations of artifacts for target architectures |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 286 | TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustc/$(2) |
| 287 | TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin |
Brian Anderson | 9e40e43 | 2012-01-11 01:45:03 | [diff] [blame] | 288 | TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/$$(CFG_LIBDIR) |
Brian Anderson | ed106dd | 2011-09-30 19:08:51 | [diff] [blame] | 289 | |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 290 | # The name of the core and standard libraries used by rustc |
Rafael Ávila de Espíndola | 88894b6 | 2011-07-20 20:02:36 | [diff] [blame] | 291 | ifdef CFG_DISABLE_SHAREDSTD |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 292 | HCORELIB_DEFAULT$(1)_H_$(3) = \ |
| 293 | $$(HLIB$(1)_H_$(3))/libcore.rlib |
| 294 | TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3) = \ |
| 295 | $$(TLIB$(1)_T_$(2)_H_$(3))/libcore.rlib |
Graydon Hoare | 4f826b3 | 2011-12-17 01:21:18 | [diff] [blame] | 296 | |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 297 | HSTDLIB_DEFAULT$(1)_H_$(3) = \ |
| 298 | $$(HLIB$(1)_H_$(3))/libstd.rlib |
| 299 | TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \ |
| 300 | $$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib |
Graydon Hoare | 4f826b3 | 2011-12-17 01:21:18 | [diff] [blame] | 301 | |
| 302 | HLIBRUSTC_DEFAULT$(1)_H_$(3) = \ |
| 303 | $$(HLIB$(1)_H_$(3))/librustc.rlib |
| 304 | TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3) = \ |
| 305 | $$(TLIB$(1)_T_$(2)_H_$(3))/librustc.rlib |
Brian Anderson | f634eb2 | 2011-09-30 23:11:47 | [diff] [blame] | 306 | else |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 307 | HCORELIB_DEFAULT$(1)_H_$(3) = \ |
| 308 | $$(HLIB$(1)_H_$(3))/$(CFG_CORELIB) |
| 309 | TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3) = \ |
| 310 | $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_CORELIB) |
Graydon Hoare | 4f826b3 | 2011-12-17 01:21:18 | [diff] [blame] | 311 | |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 312 | HSTDLIB_DEFAULT$(1)_H_$(3) = \ |
| 313 | $$(HLIB$(1)_H_$(3))/$(CFG_STDLIB) |
| 314 | TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \ |
| 315 | $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB) |
Graydon Hoare | 4f826b3 | 2011-12-17 01:21:18 | [diff] [blame] | 316 | |
| 317 | HLIBRUSTC_DEFAULT$(1)_H_$(3) = \ |
| 318 | $$(HLIB$(1)_H_$(3))/$(CFG_LIBRUSTC) |
| 319 | TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3) = \ |
| 320 | $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC) |
Brian Anderson | f634eb2 | 2011-09-30 23:11:47 | [diff] [blame] | 321 | endif |
| 322 | |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 323 | # Preqrequisites for using the stageN compiler |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 324 | HSREQ$(1)_H_$(3) = \ |
| 325 | $$(HBIN$(1)_H_$(3))/rustc$$(X) \ |
| 326 | $$(HLIB$(1)_H_$(3))/$$(CFG_RUNTIME) \ |
| 327 | $$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLLVM) \ |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 328 | $$(HCORELIB_DEFAULT$(1)_H_$(3)) \ |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 329 | $$(HSTDLIB_DEFAULT$(1)_H_$(3)) \ |
Graydon Hoare | 4f826b3 | 2011-12-17 01:21:18 | [diff] [blame] | 330 | $$(HLIBRUSTC_DEFAULT$(1)_H_$(3)) \ |
Niko Matsakis | 5ce33ce | 2011-11-29 20:42:05 | [diff] [blame] | 331 | $$(MKFILE_DEPS) |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 332 | |
| 333 | # Prerequisites for using the stageN compiler to build target artifacts |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 334 | TSREQ$(1)_T_$(2)_H_$(3) = \ |
| 335 | $$(HSREQ$(1)_H_$(3)) \ |
| 336 | $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUNTIME) \ |
| 337 | $$(TLIB$(1)_T_$(2)_H_$(3))/intrinsics.bc \ |
| 338 | $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 339 | |
| 340 | # Prerequisites for complete stageN targets |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 341 | SREQ$(1)_T_$(2)_H_$(3) = \ |
| 342 | $$(TSREQ$(1)_T_$(2)_H_$(3)) \ |
Graydon Hoare | 447414f | 2011-12-06 00:46:37 | [diff] [blame] | 343 | $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB) \ |
Graydon Hoare | 4f826b3 | 2011-12-17 01:21:18 | [diff] [blame] | 344 | $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB) \ |
| 345 | $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC) |
Graydon Hoare | fafb42e | 2011-07-15 23:12:41 | [diff] [blame] | 346 | |
Brian Anderson | e3d3aaa | 2011-08-26 18:11:49 | [diff] [blame] | 347 | ifeq ($(1),0) |
| 348 | # Don't run the the stage0 compiler under valgrind - that ship has sailed |
| 349 | CFG_VALGRIND_COMPILE$(1) = |
| 350 | else |
| 351 | CFG_VALGRIND_COMPILE$(1) = $$(CFG_VALGRIND_COMPILE) |
| 352 | endif |
| 353 | |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 354 | STAGE$(1)_T_$(2)_H_$(3) := \ |
| 355 | $$(Q)$$(call CFG_RUN_TARG,$(1), \ |
| 356 | $$(CFG_VALGRIND_COMPILE$(1)) \ |
| 357 | $$(HBIN$(1)_H_$(3))/rustc$$(X) \ |
| 358 | $$(CFG_RUSTC_FLAGS) --target=$(2)) |
Brian Anderson | 7dbce10 | 2011-09-29 19:06:37 | [diff] [blame] | 359 | |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 360 | PERF_STAGE$(1)_T_$(2)_H_$(3) := \ |
| 361 | $$(Q)$$(call CFG_RUN_TARG,$(1), \ |
| 362 | $$(CFG_PERF_TOOL) \ |
| 363 | $$(HBIN$(1)_H_$(3))/rustc$$(X) \ |
| 364 | $$(CFG_RUSTC_FLAGS) --target=$(2)) |
Brian Anderson | 7dbce10 | 2011-09-29 19:06:37 | [diff] [blame] | 365 | |
Graydon Hoare | fafb42e | 2011-07-15 23:12:41 | [diff] [blame] | 366 | endef |
| 367 | |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 368 | $(foreach build,$(CFG_TARGET_TRIPLES), \ |
| 369 | $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \ |
| 370 | $(eval $(foreach stage,$(STAGES), \ |
| 371 | $(eval $(call SREQ,$(stage),$(target),$(build)))))))) |
Graydon Hoare | fafb42e | 2011-07-15 23:12:41 | [diff] [blame] | 372 | |
| 373 | ###################################################################### |
Niko Matsakis | 3bbfe51 | 2011-12-03 00:04:27 | [diff] [blame] | 374 | # rustc-H-targets |
| 375 | # |
| 376 | # Builds a functional Rustc for the given host. |
| 377 | ###################################################################### |
| 378 | |
Niko Matsakis | 15d6032 | 2011-12-06 22:02:03 | [diff] [blame] | 379 | define DEF_RUSTC_STAGE_TARGET |
| 380 | # $(1) == architecture |
| 381 | # $(2) == stage |
| 382 | |
| 383 | rustc-stage$(2)-H-$(1): \ |
| 384 | $$(foreach target,$$(CFG_TARGET_TRIPLES), \ |
| 385 | $$(SREQ$(2)_T_$$(target)_H_$(1))) |
| 386 | |
| 387 | endef |
| 388 | |
| 389 | $(foreach host,$(CFG_TARGET_TRIPLES), \ |
| 390 | $(eval $(foreach stage,1 2 3, \ |
| 391 | $(eval $(call DEF_RUSTC_STAGE_TARGET,$(host),$(stage)))))) |
| 392 | |
Niko Matsakis | c28ada0 | 2011-12-09 16:16:04 | [diff] [blame] | 393 | rustc-stage1: rustc-stage1-H-$(CFG_HOST_TRIPLE) |
| 394 | rustc-stage2: rustc-stage2-H-$(CFG_HOST_TRIPLE) |
| 395 | rustc-stage3: rustc-stage3-H-$(CFG_HOST_TRIPLE) |
| 396 | |
Niko Matsakis | 3bbfe51 | 2011-12-03 00:04:27 | [diff] [blame] | 397 | define DEF_RUSTC_TARGET |
| 398 | # $(1) == architecture |
| 399 | |
Haitao Li | 394a80c | 2012-01-16 05:42:03 | [diff] [blame^] | 400 | rustc-H-$(1): rustc-stage2-H-$(1) |
Niko Matsakis | 3bbfe51 | 2011-12-03 00:04:27 | [diff] [blame] | 401 | endef |
| 402 | |
| 403 | $(foreach host,$(CFG_TARGET_TRIPLES), \ |
| 404 | $(eval $(call DEF_RUSTC_TARGET,$(host)))) |
| 405 | |
Niko Matsakis | 68c6272 | 2011-12-13 04:28:35 | [diff] [blame] | 406 | rustc-stage1: rustc-stage1-H-$(CFG_HOST_TRIPLE) |
| 407 | rustc-stage2: rustc-stage2-H-$(CFG_HOST_TRIPLE) |
| 408 | rustc-stage3: rustc-stage3-H-$(CFG_HOST_TRIPLE) |
| 409 | rustc: rustc-H-$(CFG_HOST_TRIPLE) |
| 410 | |
Niko Matsakis | 4934929 | 2011-12-03 00:11:35 | [diff] [blame] | 411 | rustc-H-all: $(foreach host,$(CFG_TARGET_TRIPLES),rustc-H-$(host)) |
Niko Matsakis | 3bbfe51 | 2011-12-03 00:04:27 | [diff] [blame] | 412 | |
| 413 | ###################################################################### |
Graydon Hoare | fafb42e | 2011-07-15 23:12:41 | [diff] [blame] | 414 | # Entrypoint rule |
Graydon Hoare | 4c2245d | 2011-03-18 06:51:45 | [diff] [blame] | 415 | ###################################################################### |
| 416 | |
Brian Anderson | c9b14cc | 2011-12-13 20:02:17 | [diff] [blame] | 417 | .DEFAULT_GOAL := all |
| 418 | |
Graydon Hoare | ae784df | 2011-05-14 00:00:43 | [diff] [blame] | 419 | ifneq ($(CFG_IN_TRANSITION),) |
| 420 | |
Graydon Hoare | 9ac2948 | 2011-05-16 22:14:58 | [diff] [blame] | 421 | CFG_INFO := $(info cfg:) |
Graydon Hoare | ae784df | 2011-05-14 00:00:43 | [diff] [blame] | 422 | CFG_INFO := $(info cfg: *** compiler is in snapshot transition ***) |
| 423 | CFG_INFO := $(info cfg: *** stage2 and later will not be built ***) |
Graydon Hoare | 9ac2948 | 2011-05-16 22:14:58 | [diff] [blame] | 424 | CFG_INFO := $(info cfg:) |
Graydon Hoare | ae784df | 2011-05-14 00:00:43 | [diff] [blame] | 425 | |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 426 | all: $(SREQ1$(CFG_HOST_TRIPLE)) $(GENERATED) $(DOCS) |
Brian Anderson | b056096 | 2011-09-30 23:15:02 | [diff] [blame] | 427 | |
Graydon Hoare | ae784df | 2011-05-14 00:00:43 | [diff] [blame] | 428 | else |
Brian Anderson | 86ed905 | 2011-09-30 03:27:28 | [diff] [blame] | 429 | |
Niko Matsakis | 9c12c7c | 2011-11-21 21:11:40 | [diff] [blame] | 430 | TSREQS := \ |
| 431 | $(foreach target,$(CFG_TARGET_TRIPLES), \ |
| 432 | $(SREQ3_T_$(target)_H_$(CFG_HOST_TRIPLE))) |
| 433 | FUZZ := $(HBIN3_H_$(CFG_HOST_TRIPLE))/fuzzer$(X) |
Graydon Hoare | d1fd7d4 | 2011-12-01 19:31:29 | [diff] [blame] | 434 | CARGO := $(HBIN3_H_$(CFG_HOST_TRIPLE))/cargo$(X) |
Graydon Hoare | 51a9274 | 2011-12-21 02:27:27 | [diff] [blame] | 435 | RUSTDOC := $(HBIN3_H_$(CFG_HOST_TRIPLE))/rustdoc$(X) |
Brian Anderson | 86ed905 | 2011-09-30 03:27:28 | [diff] [blame] | 436 | |
Graydon Hoare | 51a9274 | 2011-12-21 02:27:27 | [diff] [blame] | 437 | all: rustc $(GENERATED) $(DOCS) $(FUZZ) $(CARGO) $(RUSTDOC) |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 438 | |
Graydon Hoare | ae784df | 2011-05-14 00:00:43 | [diff] [blame] | 439 | endif |
| 440 | |
Graydon Hoare | 10f3360 | 2011-03-25 17:29:45 | [diff] [blame] | 441 | |
| 442 | ###################################################################### |
| 443 | # Re-configuration |
| 444 | ###################################################################### |
| 445 | |
Brian Anderson | 8d7863f | 2011-11-29 01:50:23 | [diff] [blame] | 446 | ifndef CFG_DISABLE_MANAGE_SUBMODULES |
Brian Anderson | 0e15011 | 2011-11-01 01:19:40 | [diff] [blame] | 447 | # This is a pretty expensive operation but I don't see any way to avoid it |
Brian Anderson | 143f878 | 2011-11-26 04:00:48 | [diff] [blame] | 448 | NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)') |
Brian Anderson | 8d7863f | 2011-11-29 01:50:23 | [diff] [blame] | 449 | else |
| 450 | NEED_GIT_RECONFIG=0 |
| 451 | endif |
Brian Anderson | 0e15011 | 2011-11-01 01:19:40 | [diff] [blame] | 452 | |
| 453 | ifeq ($(NEED_GIT_RECONFIG),0) |
| 454 | else |
| 455 | # If the submodules have changed then always execute config.mk |
| 456 | .PHONY: config.mk |
| 457 | endif |
| 458 | |
Graydon Hoare | ae784df | 2011-05-14 00:00:43 | [diff] [blame] | 459 | config.mk: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt |
Graydon Hoare | 10f3360 | 2011-03-25 17:29:45 | [diff] [blame] | 460 | @$(call E, cfg: reconfiguring) |
Graydon Hoare | df8161d | 2011-06-30 20:41:20 | [diff] [blame] | 461 | $(Q)$(S)configure $(CFG_CONFIGURE_ARGS) |
Graydon Hoare | 10f3360 | 2011-03-25 17:29:45 | [diff] [blame] | 462 | |
| 463 | |
Graydon Hoare | e961f53 | 2011-03-21 18:23:19 | [diff] [blame] | 464 | ###################################################################### |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 465 | # Primary-target makefiles |
Graydon Hoare | e961f53 | 2011-03-21 18:23:19 | [diff] [blame] | 466 | ###################################################################### |
| 467 | |
Brian Anderson | 6e65456 | 2011-10-02 03:12:08 | [diff] [blame] | 468 | include $(CFG_SRC_DIR)/mk/target.mk |
| 469 | include $(CFG_SRC_DIR)/mk/host.mk |
Michael Sullivan | b01ecb1 | 2011-07-21 18:58:01 | [diff] [blame] | 470 | include $(CFG_SRC_DIR)/mk/stage0.mk |
Graydon Hoare | 40624e3 | 2011-05-01 20:18:52 | [diff] [blame] | 471 | include $(CFG_SRC_DIR)/mk/rt.mk |
| 472 | include $(CFG_SRC_DIR)/mk/rustllvm.mk |
Graydon Hoare | 40624e3 | 2011-05-01 20:18:52 | [diff] [blame] | 473 | include $(CFG_SRC_DIR)/mk/autodep.mk |
Brian Anderson | 3a6f3cf | 2011-10-03 00:28:59 | [diff] [blame] | 474 | include $(CFG_SRC_DIR)/mk/tools.mk |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 475 | include $(CFG_SRC_DIR)/mk/docs.mk |
Brian Anderson | f96f169 | 2011-11-01 00:34:31 | [diff] [blame] | 476 | include $(CFG_SRC_DIR)/mk/llvm.mk |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 477 | |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 478 | ###################################################################### |
| 479 | # Secondary makefiles, conditionalized for speed |
| 480 | ###################################################################### |
| 481 | |
Graydon Hoare | df8161d | 2011-06-30 20:41:20 | [diff] [blame] | 482 | ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \ |
| 483 | $(findstring check,$(MAKECMDGOALS)) \ |
| 484 | $(findstring test,$(MAKECMDGOALS)) \ |
Graydon Hoare | 39151f2 | 2011-07-13 22:44:09 | [diff] [blame] | 485 | $(findstring tidy,$(MAKECMDGOALS)) \ |
Graydon Hoare | df8161d | 2011-06-30 20:41:20 | [diff] [blame] | 486 | $(findstring clean,$(MAKECMDGOALS))),) |
| 487 | CFG_INFO := $(info cfg: including dist rules) |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 488 | include $(CFG_SRC_DIR)/mk/dist.mk |
| 489 | endif |
| 490 | |
Graydon Hoare | df8161d | 2011-06-30 20:41:20 | [diff] [blame] | 491 | ifneq ($(strip $(findstring snap,$(MAKECMDGOALS)) \ |
| 492 | $(findstring clean,$(MAKECMDGOALS))),) |
| 493 | CFG_INFO := $(info cfg: including snap rules) |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 494 | include $(CFG_SRC_DIR)/mk/snap.mk |
| 495 | endif |
| 496 | |
| 497 | ifneq ($(findstring reformat,$(MAKECMDGOALS)),) |
Graydon Hoare | df8161d | 2011-06-30 20:41:20 | [diff] [blame] | 498 | CFG_INFO := $(info cfg: including reformat rules) |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 499 | include $(CFG_SRC_DIR)/mk/pp.mk |
| 500 | endif |
| 501 | |
Graydon Hoare | df8161d | 2011-06-30 20:41:20 | [diff] [blame] | 502 | ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \ |
| 503 | $(findstring test,$(MAKECMDGOALS)) \ |
Graydon Hoare | d5b2d62 | 2011-09-13 22:06:21 | [diff] [blame] | 504 | $(findstring perf,$(MAKECMDGOALS)) \ |
Graydon Hoare | df8161d | 2011-06-30 20:41:20 | [diff] [blame] | 505 | $(findstring tidy,$(MAKECMDGOALS))),) |
| 506 | CFG_INFO := $(info cfg: including test rules) |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 507 | include $(CFG_SRC_DIR)/mk/tests.mk |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 508 | endif |
| 509 | |
Graydon Hoare | d5b2d62 | 2011-09-13 22:06:21 | [diff] [blame] | 510 | ifneq ($(findstring perf,$(MAKECMDGOALS)),) |
| 511 | CFG_INFO := $(info cfg: including perf rules) |
| 512 | include $(CFG_SRC_DIR)/mk/perf.mk |
| 513 | endif |
| 514 | |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 515 | ifneq ($(findstring clean,$(MAKECMDGOALS)),) |
Graydon Hoare | df8161d | 2011-06-30 20:41:20 | [diff] [blame] | 516 | CFG_INFO := $(info cfg: including clean rules) |
Graydon Hoare | 79ba315 | 2011-06-25 19:23:27 | [diff] [blame] | 517 | include $(CFG_SRC_DIR)/mk/clean.mk |
Michael Sullivan | b01ecb1 | 2011-07-21 18:58:01 | [diff] [blame] | 518 | endif |
Brian Anderson | 9563c17 | 2011-10-01 02:00:19 | [diff] [blame] | 519 | |
| 520 | ifneq ($(findstring install,$(MAKECMDGOALS)),) |
| 521 | CFG_INFO := $(info cfg: including install rules) |
| 522 | include $(CFG_SRC_DIR)/mk/install.mk |
Niko Matsakis | e1c470c | 2011-10-12 19:10:21 | [diff] [blame] | 523 | endif |
| 524 | |
| 525 | ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \ |
| 526 | $(findstring TAGS.vi,$(MAKECMDGOALS))),) |
| 527 | CFG_INFO := $(info cfg: including ctags rules) |
| 528 | include $(CFG_SRC_DIR)/mk/ctags.mk |
| 529 | endif |