blob: 0e5670db7fa9c5bb0c7f38811c5cdd22d504ddf9 [file] [log] [blame]
Brian Anderson6e654562011-10-02 03:12:081# 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 Anderson19797df2011-11-03 17:53:4934# by rustc. In general, rust programs, even those compiled for the
Brian Anderson6e654562011-10-02 03:12:0835# 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 Matsakis9c12c7c2011-11-21 21:11:4045STAGES = 0 1 2 3
46
Graydon Hoare9c6e7e62011-03-16 16:17:3247######################################################################
48# Residual auto-configuration
49######################################################################
50
51include config.mk
Brian Anderson47090382011-10-06 00:41:0152OUR_MKFILES := Makefile config.mk $(wildcard $(CFG_SRC_DIR)/mk/*.mk)
Erick Tryzelaarab265582011-11-08 22:36:19533RDPARTY_MKFILES := $(CFG_SRC_DIR)/src/libuv/Makefile \
54 $(wildcard $(CFG_SRC_DIR)/src/libuv/*.mk)
Niko Matsakis20946e62011-10-14 00:11:2855GEN_MKFILES := $(wildcard $(CFG_SRC_DIR)/mk/libuv/*/*/*) \
Erick Tryzelaarab265582011-11-08 22:36:1956 $(wildcard $(CFG_SRC_DIR)/mk/libuv/mac/src/libuv/*) \
57 $(wildcard $(CFG_SRC_DIR)/mk/libuv/mac/src/libuv/*) \
58 $(wildcard $(CFG_SRC_DIR)/mk/libuv/mac/src/libuv/*)
Brian Anderson47090382011-10-06 00:41:0159
60MKFILES := $(OUR_MKFILES) $(3RDPARTY_MKFILES) $(GEN_MKFILES)
Graydon Hoare9c6e7e62011-03-16 16:17:3261
Niko Matsakis8371beb2011-11-22 21:04:5262NON_HOST_TRIPLES = $(filter-out $(CFG_HOST_TRIPLE),$(CFG_TARGET_TRIPLES))
63
Graydon Hoare9c6e7e62011-03-16 16:17:3264ifneq ($(MAKE_RESTARTS),)
65CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))
66endif
67
Graydon Hoare13215802011-09-21 18:24:5968CFG_INFO := $(info cfg: shell host triple $(CFG_HOST_TRIPLE))
Niko Matsakis8371beb2011-11-22 21:04:5269CFG_INFO := $(info cfg: non host triples $(NON_HOST_TRIPLES))
Graydon Hoare9c6e7e62011-03-16 16:17:3270
Graydon Hoarecae703c2011-04-08 22:44:4171ifdef CFG_DISABLE_OPTIMIZE
Graydon Hoare19ebc0f2011-04-08 23:29:1972 $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
Patrick Waltonc52fb522011-04-29 17:23:0773 CFG_RUSTC_FLAGS :=
Graydon Hoarecae703c2011-04-08 22:44:4174else
Patrick Waltonc52fb522011-04-29 17:23:0775 CFG_RUSTC_FLAGS := -O
Graydon Hoarecae703c2011-04-08 22:44:4176endif
Graydon Hoare4c2245d2011-03-18 06:51:4577
Patrick Walton3f77e7d2011-04-25 21:20:2878ifdef SAVE_TEMPS
Marijn Haverbeke6b11f6c2011-04-26 18:32:0879 CFG_RUSTC_FLAGS += --save-temps
Patrick Walton3f77e7d2011-04-25 21:20:2880endif
Patrick Walton648c4ae2011-04-29 18:55:3281ifdef TIME_PASSES
82 CFG_RUSTC_FLAGS += --time-passes
83endif
Brian Anderson27522842011-06-19 00:26:4184ifdef TIME_LLVM_PASSES
85 CFG_RUSTC_FLAGS += --time-llvm-passes
86endif
Patrick Walton404db4d2011-05-11 00:48:4987ifdef DEBUG
88 CFG_RUSTC_FLAGS += -g
89endif
Patrick Walton3f77e7d2011-04-25 21:20:2890
Graydon Hoare40624e32011-05-01 20:18:5291# platform-specific auto-configuration
92include $(CFG_SRC_DIR)/mk/platform.mk
Graydon Hoare4c2245d2011-03-18 06:51:4593
Brian Andersoncad8c732011-05-14 03:20:3494# Run the stage1/2 compilers under valgrind
95ifdef VALGRIND_COMPILE
96 CFG_VALGRIND_COMPILE :=$(CFG_VALGRIND)
97else
98 CFG_VALGRIND_COMPILE :=
99endif
100
Graydon Hoare4c2245d2011-03-18 06:51:45101CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
Graydon Hoare7ac885e2011-03-22 06:06:42102CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
Haitao Lid1cc00f2011-10-30 14:04:32103CFG_STDLIB :=$(call CFG_LIB_NAME,ruststd)
Brian Anderson5fb9cad2011-07-01 06:16:01104CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc)
Graydon Hoare4c2245d2011-03-18 06:51:45105
Graydon Hoare1e03f002011-05-06 18:21:51106# version-string calculation
107CFG_GIT_DIR := $(CFG_SRC_DIR).git
Graydon Hoare79ba3152011-06-25 19:23:27108CFG_VERSION = prerelease
Graydon Hoare0a8f9a32011-06-13 21:45:26109ifneq ($(wildcard $(CFG_GIT)),)
Graydon Hoare1e03f002011-05-06 18:21:51110ifneq ($(wildcard $(CFG_GIT_DIR)),)
111 CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
112 --pretty=format:'(%h %ci)')
113endif
Graydon Hoare0a8f9a32011-06-13 21:45:26114endif
Graydon Hoare1e03f002011-05-06 18:21:51115
Graydon Hoare94731fa2011-03-30 04:45:09116ifdef CFG_DISABLE_VALGRIND
117 $(info cfg: disabling valgrind (CFG_DISABLE_VALGRIND))
Graydon Hoare4c2245d2011-03-18 06:51:45118 CFG_VALGRIND :=
Graydon Hoare9c6e7e62011-03-16 16:17:32119endif
Patrick Walton518e2d22011-05-06 01:11:40120ifdef CFG_BAD_VALGRIND
121 $(info cfg: disabling valgrind due to its unreliability on this platform)
122 CFG_VALGRIND :=
123endif
Graydon Hoare9c6e7e62011-03-16 16:17:32124
Graydon Hoare28a4e772011-03-23 17:37:35125DOCS :=
126ifeq ($(CFG_MAKEINFO),)
127 $(info cfg: no makeinfo found, omitting doc/rust.html)
128else
129 DOCS += doc/rust.html
130endif
131
132ifeq ($(CFG_TEXI2PDF),)
133 $(info cfg: no texi2pdf found, omitting doc/rust.pdf)
134else
Graydon Hoaref7407472011-03-23 20:31:51135 ifeq ($(CFG_TEX),)
136 $(info cfg: no tex found, omitting doc/rust.pdf)
137 else
138 DOCS += doc/rust.pdf
139 endif
Graydon Hoare28a4e772011-03-23 17:37:35140endif
141
Brian Anderson0c620072011-10-27 21:59:22142ifeq ($(CFG_NATURALDOCS),)
Brian Anderson33f2f222011-10-27 22:04:29143 $(info cfg: no naturaldocs found, omitting doc/std/index.html)
Brian Anderson0c620072011-10-27 21:59:22144else
145 DOCS += doc/std/index.html
146endif
147
Graydon Hoare94731fa2011-03-30 04:45:09148ifdef CFG_DISABLE_DOCS
149 $(info cfg: disabling doc build (CFG_DISABLE_DOCS))
150 DOCS :=
151endif
Graydon Hoare28a4e772011-03-23 17:37:35152
Graydon Hoare4c2245d2011-03-18 06:51:45153######################################################################
154# Target-and-rule "utility variables"
155######################################################################
156
157ifdef VERBOSE
158 Q :=
159 E =
160else
161 Q := @
162 E = echo $(1)
163endif
164
Graydon Hoare4c2245d2011-03-18 06:51:45165S := $(CFG_SRC_DIR)
166X := $(CFG_EXE_SUFFIX)
167
168# Look in doc and src dirs.
169VPATH := $(S)doc $(S)src
170
Graydon Hoare4c2245d2011-03-18 06:51:45171# "Source" files we generate in builddir along the way.
Graydon Hoare40624e32011-05-01 20:18:52172GENERATED :=
Graydon Hoare4c2245d2011-03-18 06:51:45173
174# Delete the built-in rules.
175.SUFFIXES:
176%:: %,v
177%:: RCS/%,v
178%:: RCS/%
179%:: s.%
180%:: SCCS/s.%
Graydon Hoare9c6e7e62011-03-16 16:17:32181
Graydon Hoare4c2245d2011-03-18 06:51:45182######################################################################
183# Standard library variables
184######################################################################
185
Graydon Hoare65974392011-03-21 20:42:29186STDLIB_CRATE := $(S)src/lib/std.rc
Graydon Hoare4c2245d2011-03-18 06:51:45187STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/lib/,*.rc *.rs */*.rs))
188
189######################################################################
190# rustc crate variables
191######################################################################
192
Graydon Hoare65974392011-03-21 20:42:29193COMPILER_CRATE := $(S)src/comp/rustc.rc
Graydon Hoare874a7bf2011-03-19 00:30:06194COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/comp/, \
Tim Chevalier60399ed2011-05-18 22:34:52195 rustc.rc *.rs */*.rs */*/*.rs))
Graydon Hoare4c2245d2011-03-18 06:51:45196
197######################################################################
Brian Andersona0ff3db2011-11-02 00:09:44198# LLVM macros
199######################################################################
200
Brian Anderson4b6585c2011-11-02 23:21:17201define DEF_LLVM_VARS
202# The configure script defines these variables with the target triples
203# separated by Z. This defines new ones with the expected format.
204CFG_LLVM_BUILD_DIR_$(1):=$$(CFG_LLVM_BUILD_DIR_$(subst -,_,$(1)))
205CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_INST_DIR_$(subst -,_,$(1)))
Brian Andersona0ff3db2011-11-02 00:09:44206
Brian Anderson4b6585c2011-11-02 23:21:17207# Any rules that depend on LLVM should depend on LLVM_CONFIG
208LLVM_CONFIG_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-config
209LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
210LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
211LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
212LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
213LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs)
214LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
215LLVM_CXXFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --cxxflags)
216LLVM_HOST_TRIPLE_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --host-target)
217
218LLVM_AS_$(1)=$$(LLVM_BINDIR_$(1))/llvm-as$$(X)
219LLC_$(1)=$$(LLVM_BINDIR_$(1))/llc$$(X)
220
221endef
222
223$(foreach target,$(CFG_TARGET_TRIPLES), \
224 $(eval $(call DEF_LLVM_VARS,$(target))))
225
Brian Andersona0ff3db2011-11-02 00:09:44226######################################################################
Graydon Hoared987b492011-05-03 06:37:52227# Exports for sub-utilities
228######################################################################
229
Brian Anderson6e654562011-10-02 03:12:08230# Note that any variable that re-configure should pick up needs to be
231# exported
232
Graydon Hoared987b492011-05-03 06:37:52233export CFG_SRC_DIR
Graydon Hoaread954fc2011-07-23 19:26:47234export CFG_BUILD_DIR
Graydon Hoare1e03f002011-05-06 18:21:51235export CFG_VERSION
Brian Anderson6306c812011-09-29 19:21:58236export CFG_HOST_TRIPLE
Graydon Hoare6a4a85f2011-05-18 19:00:26237export CFG_LLVM_ROOT
Graydon Hoare0dc2aa32011-06-28 18:18:25238export CFG_ENABLE_MINGW_CROSS
Brian Anderson6e654562011-10-02 03:12:08239export CFG_PREFIX
Graydon Hoared987b492011-05-03 06:37:52240
Patrick Walton04f966f2011-05-05 01:28:30241######################################################################
242# Subprograms
243######################################################################
244
Graydon Hoared987b492011-05-03 06:37:52245######################################################################
Graydon Hoarefafb42e2011-07-15 23:12:41246# Per-stage targets and runner
247######################################################################
248
249define SREQ
Niko Matsakis9c12c7c2011-11-21 21:11:40250# $(1) is the stage number
251# $(2) is the target triple
252# $(3) is the build triple
Brian Andersoned106dd2011-09-30 19:08:51253
Brian Anderson38c67a42011-09-30 19:24:28254# Destinations of artifacts for the host compiler
Niko Matsakis9c12c7c2011-11-21 21:11:40255HROOT$(1)_H_$(3) = $(3)/stage$(1)
256HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
257HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
Brian Anderson38c67a42011-09-30 19:24:28258
Brian Anderson9563c172011-10-01 02:00:19259# Destinations of artifacts for target architectures
Niko Matsakis9c12c7c2011-11-21 21:11:40260TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustc/$(2)
261TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
262TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib
Brian Andersoned106dd2011-09-30 19:08:51263
Brian Anderson6e654562011-10-02 03:12:08264# The name of the standard library used by rustc
Rafael Ávila de Espíndola88894b62011-07-20 20:02:36265ifdef CFG_DISABLE_SHAREDSTD
Niko Matsakis9c12c7c2011-11-21 21:11:40266 HSTDLIB_DEFAULT$(1)_H_$(3) = \
267 $$(HLIB$(1)_H_$(3))/libstd.rlib
268 TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
269 $$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib
Brian Andersonf634eb22011-09-30 23:11:47270else
Niko Matsakis9c12c7c2011-11-21 21:11:40271 HSTDLIB_DEFAULT$(1)_H_$(3) = \
272 $$(HLIB$(1)_H_$(3))/$(CFG_STDLIB)
273 TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
274 $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB)
Brian Andersonf634eb22011-09-30 23:11:47275endif
276
Brian Anderson6e654562011-10-02 03:12:08277# Preqrequisites for using the stageN compiler
Niko Matsakis9c12c7c2011-11-21 21:11:40278HSREQ$(1)_H_$(3) = \
279 $$(HBIN$(1)_H_$(3))/rustc$$(X) \
280 $$(HLIB$(1)_H_$(3))/$$(CFG_RUNTIME) \
281 $$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLLVM) \
282 $$(HSTDLIB_DEFAULT$(1)_H_$(3)) \
Brian Anderson6e654562011-10-02 03:12:08283 $$(MKFILES)
284
285# Prerequisites for using the stageN compiler to build target artifacts
Niko Matsakis9c12c7c2011-11-21 21:11:40286TSREQ$(1)_T_$(2)_H_$(3) = \
287 $$(HSREQ$(1)_H_$(3)) \
288 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUNTIME) \
289 $$(TLIB$(1)_T_$(2)_H_$(3))/intrinsics.bc \
290 $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
Brian Anderson6e654562011-10-02 03:12:08291
292# Prerequisites for complete stageN targets
Niko Matsakis9c12c7c2011-11-21 21:11:40293SREQ$(1)_T_$(2)_H_$(3) = \
294 $$(TSREQ$(1)_T_$(2)_H_$(3)) \
295 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB)
Graydon Hoarefafb42e2011-07-15 23:12:41296
Brian Andersone3d3aaa2011-08-26 18:11:49297ifeq ($(1),0)
298# Don't run the the stage0 compiler under valgrind - that ship has sailed
299CFG_VALGRIND_COMPILE$(1) =
300else
301CFG_VALGRIND_COMPILE$(1) = $$(CFG_VALGRIND_COMPILE)
302endif
303
Niko Matsakis9c12c7c2011-11-21 21:11:40304STAGE$(1)_T_$(2)_H_$(3) := \
305 $$(Q)$$(call CFG_RUN_TARG,$(1), \
306 $$(CFG_VALGRIND_COMPILE$(1)) \
307 $$(HBIN$(1)_H_$(3))/rustc$$(X) \
308 $$(CFG_RUSTC_FLAGS) --target=$(2))
Brian Anderson7dbce102011-09-29 19:06:37309
Niko Matsakis9c12c7c2011-11-21 21:11:40310PERF_STAGE$(1)_T_$(2)_H_$(3) := \
311 $$(Q)$$(call CFG_RUN_TARG,$(1), \
312 $$(CFG_PERF_TOOL) \
313 $$(HBIN$(1)_H_$(3))/rustc$$(X) \
314 $$(CFG_RUSTC_FLAGS) --target=$(2))
Brian Anderson7dbce102011-09-29 19:06:37315
Graydon Hoarefafb42e2011-07-15 23:12:41316endef
317
Niko Matsakis9c12c7c2011-11-21 21:11:40318$(foreach build,$(CFG_TARGET_TRIPLES), \
319 $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
320 $(eval $(foreach stage,$(STAGES), \
321 $(eval $(call SREQ,$(stage),$(target),$(build))))))))
Graydon Hoarefafb42e2011-07-15 23:12:41322
323######################################################################
324# Entrypoint rule
Graydon Hoare4c2245d2011-03-18 06:51:45325######################################################################
326
Graydon Hoareae784df2011-05-14 00:00:43327ifneq ($(CFG_IN_TRANSITION),)
328
Graydon Hoare9ac29482011-05-16 22:14:58329CFG_INFO := $(info cfg:)
Graydon Hoareae784df2011-05-14 00:00:43330CFG_INFO := $(info cfg: *** compiler is in snapshot transition ***)
331CFG_INFO := $(info cfg: *** stage2 and later will not be built ***)
Graydon Hoare9ac29482011-05-16 22:14:58332CFG_INFO := $(info cfg:)
Graydon Hoareae784df2011-05-14 00:00:43333
Brian Anderson6e654562011-10-02 03:12:08334all: $(SREQ1$(CFG_HOST_TRIPLE)) $(GENERATED) $(DOCS)
Brian Andersonb0560962011-09-30 23:15:02335
Graydon Hoareae784df2011-05-14 00:00:43336else
Brian Anderson86ed9052011-09-30 03:27:28337
Niko Matsakis9c12c7c2011-11-21 21:11:40338TSREQS := \
339 $(foreach target,$(CFG_TARGET_TRIPLES), \
340 $(SREQ3_T_$(target)_H_$(CFG_HOST_TRIPLE)))
341FUZZ := $(HBIN3_H_$(CFG_HOST_TRIPLE))/fuzzer$(X)
Brian Anderson86ed9052011-09-30 03:27:28342
Niko Matsakisd0887992011-10-14 21:08:04343#all: $(SREQ3$(CFG_HOST_TRIPLE)) $(GENERATED) $(DOCS) $(FUZZ)
Niko Matsakis9c12c7c2011-11-21 21:11:40344all: $(TSREQS) $(GENERATED) $(DOCS) $(FUZZ)
Brian Anderson6e654562011-10-02 03:12:08345
Graydon Hoareae784df2011-05-14 00:00:43346endif
347
Graydon Hoare10f33602011-03-25 17:29:45348
349######################################################################
350# Re-configuration
351######################################################################
352
Brian Anderson8d7863f2011-11-29 01:50:23353ifndef CFG_DISABLE_MANAGE_SUBMODULES
Brian Anderson0e150112011-11-01 01:19:40354# This is a pretty expensive operation but I don't see any way to avoid it
Brian Anderson143f8782011-11-26 04:00:48355NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)')
Brian Anderson8d7863f2011-11-29 01:50:23356else
357NEED_GIT_RECONFIG=0
358endif
Brian Anderson0e150112011-11-01 01:19:40359
360ifeq ($(NEED_GIT_RECONFIG),0)
361else
362# If the submodules have changed then always execute config.mk
363.PHONY: config.mk
364endif
365
Graydon Hoareae784df2011-05-14 00:00:43366config.mk: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
Graydon Hoare10f33602011-03-25 17:29:45367 @$(call E, cfg: reconfiguring)
Graydon Hoaredf8161d2011-06-30 20:41:20368 $(Q)$(S)configure $(CFG_CONFIGURE_ARGS)
Graydon Hoare10f33602011-03-25 17:29:45369
370
Graydon Hoaree961f532011-03-21 18:23:19371######################################################################
Graydon Hoare79ba3152011-06-25 19:23:27372# Primary-target makefiles
Graydon Hoaree961f532011-03-21 18:23:19373######################################################################
374
Brian Anderson6e654562011-10-02 03:12:08375include $(CFG_SRC_DIR)/mk/target.mk
376include $(CFG_SRC_DIR)/mk/host.mk
Michael Sullivanb01ecb12011-07-21 18:58:01377include $(CFG_SRC_DIR)/mk/stage0.mk
Graydon Hoare40624e32011-05-01 20:18:52378include $(CFG_SRC_DIR)/mk/rt.mk
379include $(CFG_SRC_DIR)/mk/rustllvm.mk
Graydon Hoare40624e32011-05-01 20:18:52380include $(CFG_SRC_DIR)/mk/autodep.mk
Brian Anderson3a6f3cf2011-10-03 00:28:59381include $(CFG_SRC_DIR)/mk/tools.mk
Graydon Hoare79ba3152011-06-25 19:23:27382include $(CFG_SRC_DIR)/mk/docs.mk
Brian Andersonf96f1692011-11-01 00:34:31383include $(CFG_SRC_DIR)/mk/llvm.mk
Graydon Hoare79ba3152011-06-25 19:23:27384
Graydon Hoare79ba3152011-06-25 19:23:27385######################################################################
386# Secondary makefiles, conditionalized for speed
387######################################################################
388
Graydon Hoaredf8161d2011-06-30 20:41:20389ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \
390 $(findstring check,$(MAKECMDGOALS)) \
391 $(findstring test,$(MAKECMDGOALS)) \
Graydon Hoare39151f22011-07-13 22:44:09392 $(findstring tidy,$(MAKECMDGOALS)) \
Graydon Hoaredf8161d2011-06-30 20:41:20393 $(findstring clean,$(MAKECMDGOALS))),)
394 CFG_INFO := $(info cfg: including dist rules)
Graydon Hoare79ba3152011-06-25 19:23:27395 include $(CFG_SRC_DIR)/mk/dist.mk
396endif
397
Graydon Hoaredf8161d2011-06-30 20:41:20398ifneq ($(strip $(findstring snap,$(MAKECMDGOALS)) \
399 $(findstring clean,$(MAKECMDGOALS))),)
400 CFG_INFO := $(info cfg: including snap rules)
Graydon Hoare79ba3152011-06-25 19:23:27401 include $(CFG_SRC_DIR)/mk/snap.mk
402endif
403
404ifneq ($(findstring reformat,$(MAKECMDGOALS)),)
Graydon Hoaredf8161d2011-06-30 20:41:20405 CFG_INFO := $(info cfg: including reformat rules)
Graydon Hoare79ba3152011-06-25 19:23:27406 include $(CFG_SRC_DIR)/mk/pp.mk
407endif
408
Graydon Hoaredf8161d2011-06-30 20:41:20409ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
410 $(findstring test,$(MAKECMDGOALS)) \
Graydon Hoared5b2d622011-09-13 22:06:21411 $(findstring perf,$(MAKECMDGOALS)) \
Graydon Hoaredf8161d2011-06-30 20:41:20412 $(findstring tidy,$(MAKECMDGOALS))),)
413 CFG_INFO := $(info cfg: including test rules)
Graydon Hoare79ba3152011-06-25 19:23:27414 include $(CFG_SRC_DIR)/mk/tests.mk
Graydon Hoare79ba3152011-06-25 19:23:27415endif
416
Graydon Hoared5b2d622011-09-13 22:06:21417ifneq ($(findstring perf,$(MAKECMDGOALS)),)
418 CFG_INFO := $(info cfg: including perf rules)
419 include $(CFG_SRC_DIR)/mk/perf.mk
420endif
421
Graydon Hoare79ba3152011-06-25 19:23:27422ifneq ($(findstring clean,$(MAKECMDGOALS)),)
Graydon Hoaredf8161d2011-06-30 20:41:20423 CFG_INFO := $(info cfg: including clean rules)
Graydon Hoare79ba3152011-06-25 19:23:27424 include $(CFG_SRC_DIR)/mk/clean.mk
Michael Sullivanb01ecb12011-07-21 18:58:01425endif
Brian Anderson9563c172011-10-01 02:00:19426
427ifneq ($(findstring install,$(MAKECMDGOALS)),)
428 CFG_INFO := $(info cfg: including install rules)
429 include $(CFG_SRC_DIR)/mk/install.mk
Niko Matsakise1c470c2011-10-12 19:10:21430endif
431
432ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
433 $(findstring TAGS.vi,$(MAKECMDGOALS))),)
434 CFG_INFO := $(info cfg: including ctags rules)
435 include $(CFG_SRC_DIR)/mk/ctags.mk
436endif