1 # Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
11 # An explanation of how the build is structured:
13 # There are multiple build stages (0-3) needed to verify that the
14 # compiler is properly self-hosting. Each stage is divided between
15 # 'host' artifacts and 'target' artifacts, where the stageN host
16 # compiler builds artifacts for 1 or more stageN target architectures.
17 # Once the stageN target compiler has been built for the host
18 # architecture it is promoted (copied) to a stageN+1 host artifact.
20 # The stage3 host compiler is a compiler that successfully builds
21 # itself and should (in theory) be bitwise identical to the stage2
22 # host compiler. The process is bootstrapped using a stage0 host
23 # compiler downloaded from a previous snapshot.
25 # At no time should stageN artifacts be interacting with artifacts
26 # from other stages. For consistency, we use the 'promotion' logic
27 # for all artifacts, even those that don't make sense on non-host
30 # The directory layout for a stage is intended to match the layout
31 # of the installed compiler, and looks like the following:
33 # stageN - this is the system root, corresponding to, e.g. /usr
34 # bin - binaries compiled for the host
35 # lib - libraries used by the host compiler
36 # rustc - rustc's own place to organize libraries
37 # $(target) - target-specific artifacts
38 # bin - binaries for target architectures
39 # lib - libraries for target architectures
41 # A note about host libraries:
43 # The only libraries that get promoted to stageN/lib are those needed
44 # by rustc. In general, rust programs, even those compiled for the
45 # host architecture will use libraries from the target
46 # directories. This gives rust some freedom to experiment with how
47 # libraries are managed and versioned without polluting the common
48 # areas of the filesystem.
50 # General rust binaries may stil live in the host bin directory; they
51 # will just link against the libraries in the target lib directory.
53 # Admittedly this is a little convoluted.
57 ######################################################################
58 # Residual auto-configuration
59 ######################################################################
61 # Recursive wildcard function
62 # http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
63 rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
64 $(filter $(subst *,%,$2),$d))
68 # We track all of the object files we might build so that we can find
69 # and include all of the .d files in one fell swoop.
72 MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*)
73 NON_HOST_TRIPLES = $(filter-out $(CFG_HOST_TRIPLE),$(CFG_TARGET_TRIPLES))
75 ifneq ($(MAKE_RESTARTS),)
76 CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))
79 CFG_INFO := $(info cfg: shell host triple $(CFG_HOST_TRIPLE))
81 ifneq ($(wildcard $(NON_HOST_TRIPLES)),)
82 CFG_INFO := $(info cfg: non host triples $(NON_HOST_TRIPLES))
85 CFG_RUSTC_FLAGS := $(RUSTFLAGS)
87 CFG_GCCISH_LINK_FLAGS :=
89 ifdef CFG_DISABLE_OPTIMIZE
90 $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
96 ifdef CFG_ENABLE_DEBUG
97 $(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
99 CFG_GCCISH_CFLAGS += -DRUST_DEBUG
101 CFG_GCCISH_CFLAGS += -DRUST_NDEBUG
105 CFG_RUSTC_FLAGS += --save-temps
108 CFG_RUSTC_FLAGS += -Z time-passes
110 ifdef TIME_LLVM_PASSES
111 CFG_RUSTC_FLAGS += -Z time-llvm-passes
114 CFG_RUSTC_FLAGS += -Z trace
117 # platform-specific auto-configuration
118 include $(CFG_SRC_DIR)mk/platform.mk
120 # Run the stage1/2 compilers under valgrind
121 ifdef VALGRIND_COMPILE
122 CFG_VALGRIND_COMPILE :=$(CFG_VALGRIND)
124 CFG_VALGRIND_COMPILE :=
127 CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
128 CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
129 CFG_CORELIB :=$(call CFG_LIB_NAME,core)
130 CFG_STDLIB :=$(call CFG_LIB_NAME,std)
131 CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc)
132 CFG_LIBSYNTAX :=$(call CFG_LIB_NAME,syntax)
133 CFG_LIBFUZZER :=$(call CFG_LIB_NAME,fuzzer)
134 CFG_LIBCARGO :=$(call CFG_LIB_NAME,cargo)
135 CFG_LIBRUSTDOC :=$(call CFG_LIB_NAME,rustdoc)
136 CFG_LIBRUSTI :=$(call CFG_LIB_NAME,rusti)
138 STDLIB_GLOB :=$(call CFG_LIB_GLOB,std)
139 CORELIB_GLOB :=$(call CFG_LIB_GLOB,core)
140 LIBRUSTC_GLOB :=$(call CFG_LIB_GLOB,rustc)
141 LIBSYNTAX_GLOB :=$(call CFG_LIB_GLOB,syntax)
142 LIBFUZZER_GLOB :=$(call CFG_LIB_GLOB,fuzzer)
143 LIBCARGO_GLOB :=$(call CFG_LIB_GLOB,cargo)
144 LIBRUSTDOC_GLOB :=$(call CFG_LIB_GLOB,rustdoc)
145 LIBRUSTI_GLOB :=$(call CFG_LIB_GLOB,rusti)
146 STDLIB_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,std)
147 CORELIB_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,core)
148 LIBRUSTC_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,rustc)
149 LIBSYNTAX_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,syntax)
150 LIBFUZZER_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,fuzzer)
151 LIBCARGO_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,cargo)
152 LIBRUSTDOC_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,rustdoc)
153 LIBRUSTI_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,rusti)
155 # version-string calculation
156 CFG_GIT_DIR := $(CFG_SRC_DIR).git
158 CFG_VERSION = $(CFG_RELEASE)
160 ifneq ($(wildcard $(CFG_GIT)),)
161 ifneq ($(wildcard $(CFG_GIT_DIR)),)
162 CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
163 --pretty=format:'(%h %ci)')
164 CFG_VER_HASH = $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
165 --pretty=format:'%H')
169 ifdef CFG_ENABLE_VALGRIND
170 $(info cfg: enabling valgrind (CFG_ENABLE_VALGRIND))
174 ifdef CFG_BAD_VALGRIND
175 $(info cfg: disabling valgrind due to its unreliability on this platform)
180 ######################################################################
181 # Target-and-rule "utility variables"
182 ######################################################################
193 X := $(CFG_EXE_SUFFIX)
195 # Look in doc and src dirs.
196 VPATH := $(S)doc $(S)src
198 # "Source" files we generate in builddir along the way.
201 # Delete the built-in rules.
209 ######################################################################
210 # Core library variables
211 ######################################################################
213 CORELIB_CRATE := $(S)src/libcore/core.rc
214 CORELIB_INPUTS := $(wildcard $(addprefix $(S)src/libcore/, \
215 core.rc *.rs */*.rs))
217 ######################################################################
218 # Standard library variables
219 ######################################################################
221 STDLIB_CRATE := $(S)src/libstd/std.rc
222 STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/libstd/, \
225 ######################################################################
226 # rustc crate variables
227 ######################################################################
229 COMPILER_CRATE := $(S)src/librustc/rustc.rc
230 COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/librustc/, \
231 rustc.rc *.rs */*.rs */*/*.rs */*/*/*.rs))
233 LIBSYNTAX_CRATE := $(S)src/libsyntax/syntax.rc
234 LIBSYNTAX_INPUTS := $(wildcard $(addprefix $(S)src/libsyntax/, \
235 syntax.rc *.rs */*.rs */*/*.rs))
237 DRIVER_CRATE := $(S)src/driver/driver.rs
239 ######################################################################
241 ######################################################################
244 LLVM_COMPONENTS=x86 arm ipo bitreader bitwriter linker asmparser jit mcjit \
248 # The configure script defines these variables with the target triples
249 # separated by Z. This defines new ones with the expected format.
250 CFG_LLVM_BUILD_DIR_$(1):=$$(CFG_LLVM_BUILD_DIR_$(subst -,_,$(1)))
251 CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_INST_DIR_$(subst -,_,$(1)))
253 # Any rules that depend on LLVM should depend on LLVM_CONFIG
254 LLVM_CONFIG_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-config$$(X)
255 LLVM_MC_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-mc$$(X)
256 LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
257 LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
258 LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
259 LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
260 LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
261 LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
262 # On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),
263 # so we replace -I with -iquote to ensure that it searches bundled LLVM first.
264 LLVM_CXXFLAGS_$(1)=$$(subst -I, -iquote , $$(shell "$$(LLVM_CONFIG_$(1))" --cxxflags))
265 LLVM_HOST_TRIPLE_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --host-target)
267 LLVM_AS_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-as$$(X)
268 LLC_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llc$$(X)
272 $(foreach target,$(CFG_TARGET_TRIPLES), \
273 $(eval $(call DEF_LLVM_VARS,$(target))))
275 ######################################################################
276 # Exports for sub-utilities
277 ######################################################################
279 # Note that any variable that re-configure should pick up needs to be
285 export CFG_HOST_TRIPLE
287 export CFG_ENABLE_MINGW_CROSS
291 ######################################################################
293 ######################################################################
295 ######################################################################
296 # Per-stage targets and runner
297 ######################################################################
300 # $(1) is the stage number
301 # $(2) is the target triple
302 # $(3) is the host triple
304 # Destinations of artifacts for the host compiler
305 HROOT$(1)_H_$(3) = $(3)/stage$(1)
306 HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
307 HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR)
309 # Destinations of artifacts for target architectures
310 TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustc/$(2)
311 TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
312 TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/$$(CFG_LIBDIR)
314 # The name of the core and standard libraries used by rustc
315 ifdef CFG_DISABLE_SHAREDSTD
316 HCORELIB_DEFAULT$(1)_H_$(3) = \
317 $$(HLIB$(1)_H_$(3))/libcore.rlib
318 TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
319 $$(TLIB$(1)_T_$(2)_H_$(3))/libcore.rlib
321 HSTDLIB_DEFAULT$(1)_H_$(3) = \
322 $$(HLIB$(1)_H_$(3))/libstd.rlib
323 TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
324 $$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib
326 HLIBRUSTC_DEFAULT$(1)_H_$(3) = \
327 $$(HLIB$(1)_H_$(3))/librustc.rlib
328 TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3) = \
329 $$(TLIB$(1)_T_$(2)_H_$(3))/librustc.rlib
331 HCORELIB_DEFAULT$(1)_H_$(3) = \
332 $$(HLIB$(1)_H_$(3))/$(CFG_CORELIB)
333 TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
334 $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_CORELIB)
336 HSTDLIB_DEFAULT$(1)_H_$(3) = \
337 $$(HLIB$(1)_H_$(3))/$(CFG_STDLIB)
338 TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
339 $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB)
341 HLIBRUSTC_DEFAULT$(1)_H_$(3) = \
342 $$(HLIB$(1)_H_$(3))/$(CFG_LIBRUSTC)
343 TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3) = \
344 $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC)
347 # Preqrequisites for using the stageN compiler
349 $$(HBIN$(1)_H_$(3))/rustc$$(X) \
350 $$(HLIB$(1)_H_$(3))/$$(CFG_RUNTIME) \
351 $$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLLVM) \
352 $$(HCORELIB_DEFAULT$(1)_H_$(3)) \
353 $$(HSTDLIB_DEFAULT$(1)_H_$(3)) \
354 $$(HLIBSYNTAX_DEFAULT$(1)_H_$(3)) \
355 $$(HLIBRUSTC_DEFAULT$(1)_H_$(3)) \
358 # Prerequisites for using the stageN compiler to build target artifacts
359 TSREQ$(1)_T_$(2)_H_$(3) = \
360 $$(HSREQ$(1)_H_$(3)) \
361 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUNTIME) \
362 $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
364 # Prerequisites for a working stageN compiler and libraries, for a specific target
365 SREQ$(1)_T_$(2)_H_$(3) = \
366 $$(TSREQ$(1)_T_$(2)_H_$(3)) \
367 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB) \
368 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB)
370 # Prerequisites for a working stageN compiler and libraries, for a specific target
371 CSREQ$(1)_T_$(2)_H_$(3) = \
372 $$(TSREQ$(1)_T_$(2)_H_$(3)) \
373 $$(HBIN$(1)_H_$(3))/fuzzer$$(X) \
374 $$(HBIN$(1)_H_$(3))/cargo$$(X) \
375 $$(HBIN$(1)_H_$(3))/rustdoc$$(X) \
376 $$(HBIN$(1)_H_$(3))/rusti$$(X) \
377 $$(HLIB$(1)_H_$(3))/$$(CFG_LIBFUZZER) \
378 $$(HLIB$(1)_H_$(3))/$$(CFG_LIBCARGO) \
379 $$(HLIB$(1)_H_$(3))/$$(CFG_LIBRUSTDOC) \
380 $$(HLIB$(1)_H_$(3))/$$(CFG_LIBRUSTI) \
381 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB) \
382 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB) \
383 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX) \
384 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC) \
385 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBFUZZER) \
386 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBCARGO) \
387 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTDOC) \
388 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTI)
391 # Don't run the the stage0 compiler under valgrind - that ship has sailed
392 CFG_VALGRIND_COMPILE$(1) =
394 CFG_VALGRIND_COMPILE$(1) = $$(CFG_VALGRIND_COMPILE)
397 # Add RUSTFLAGS_STAGEN values to the build command
398 EXTRAFLAGS_STAGE$(1) = $$(RUSTFLAGS_STAGE$(1))
400 CFGFLAG$(1)_T_$(2)_H_$(3) = stage$(1)
402 # Pass --cfg stage0 only for the build->host part of stage0;
403 # if you're building a cross config, the host->* parts are
404 # effectively stage1, since it uses the just-built stage0.
406 ifneq ($(strip $(CFG_HOST_TRIPLE)),$(strip $(3)))
407 CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
411 STAGE$(1)_T_$(2)_H_$(3) := \
412 $$(Q)$$(call CFG_RUN_TARG,$(1), \
413 $$(CFG_VALGRIND_COMPILE$(1)) \
414 $$(HBIN$(1)_H_$(3))/rustc$$(X) \
415 --cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
416 $$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2))
418 PERF_STAGE$(1)_T_$(2)_H_$(3) := \
419 $$(Q)$$(call CFG_RUN_TARG,$(1), \
421 $$(HBIN$(1)_H_$(3))/rustc$$(X) \
422 --cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
423 $$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2))
427 $(foreach build,$(CFG_TARGET_TRIPLES), \
428 $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
429 $(eval $(foreach stage,$(STAGES), \
430 $(eval $(call SREQ,$(stage),$(target),$(build))))))))
432 ######################################################################
435 # Builds a functional Rustc for the given host.
436 ######################################################################
438 define DEF_RUSTC_STAGE_TARGET
439 # $(1) == architecture
442 rustc-stage$(2)-H-$(1): \
443 $$(foreach target,$$(CFG_TARGET_TRIPLES), \
444 $$(SREQ$(2)_T_$$(target)_H_$(1)))
448 $(foreach host,$(CFG_TARGET_TRIPLES), \
449 $(eval $(foreach stage,1 2 3, \
450 $(eval $(call DEF_RUSTC_STAGE_TARGET,$(host),$(stage))))))
452 rustc-stage1: rustc-stage1-H-$(CFG_HOST_TRIPLE)
453 rustc-stage2: rustc-stage2-H-$(CFG_HOST_TRIPLE)
454 rustc-stage3: rustc-stage3-H-$(CFG_HOST_TRIPLE)
456 define DEF_RUSTC_TARGET
457 # $(1) == architecture
459 rustc-H-$(1): rustc-stage2-H-$(1)
462 $(foreach host,$(CFG_TARGET_TRIPLES), \
463 $(eval $(call DEF_RUSTC_TARGET,$(host))))
465 rustc-stage1: rustc-stage1-H-$(CFG_HOST_TRIPLE)
466 rustc-stage2: rustc-stage2-H-$(CFG_HOST_TRIPLE)
467 rustc-stage3: rustc-stage3-H-$(CFG_HOST_TRIPLE)
468 rustc: rustc-H-$(CFG_HOST_TRIPLE)
470 rustc-H-all: $(foreach host,$(CFG_TARGET_TRIPLES),rustc-H-$(host))
472 ######################################################################
474 ######################################################################
478 ifneq ($(CFG_IN_TRANSITION),)
480 CFG_INFO := $(info cfg:)
481 CFG_INFO := $(info cfg: *** compiler is in snapshot transition ***)
482 CFG_INFO := $(info cfg: *** stage2 and later will not be built ***)
483 CFG_INFO := $(info cfg:)
485 #XXX This is surely busted
486 all: $(SREQ1$(CFG_HOST_TRIPLE)) $(GENERATED) docs
491 all-target-$(1)-host-$(2): $$(CSREQ2_T_$(1)_H_$(2))
494 $(foreach target,$(CFG_TARGET_TRIPLES), \
495 $(eval $(call ALL_TARGET_N,$(target),$(CFG_HOST_TRIPLE))))
497 ALL_TARGET_RULES = $(foreach target,$(CFG_TARGET_TRIPLES), \
498 all-target-$(target)-host-$(CFG_HOST_TRIPLE))
500 all: $(ALL_TARGET_RULES) $(GENERATED) docs
505 ######################################################################
507 ######################################################################
509 ifndef CFG_DISABLE_MANAGE_SUBMODULES
510 # This is a pretty expensive operation but I don't see any way to avoid it
511 NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)')
516 ifeq ($(NEED_GIT_RECONFIG),0)
518 # If the submodules have changed then always execute config.mk
522 Makefile config.mk: config.stamp
524 config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
525 @$(call E, cfg: reconfiguring)
526 $(Q)$(S)configure $(CFG_CONFIGURE_ARGS)
529 ######################################################################
530 # Primary-target makefiles
531 ######################################################################
533 include $(CFG_SRC_DIR)mk/target.mk
534 include $(CFG_SRC_DIR)mk/host.mk
535 include $(CFG_SRC_DIR)mk/stage0.mk
536 include $(CFG_SRC_DIR)mk/rt.mk
537 include $(CFG_SRC_DIR)mk/rustllvm.mk
538 include $(CFG_SRC_DIR)mk/tools.mk
539 include $(CFG_SRC_DIR)mk/docs.mk
540 include $(CFG_SRC_DIR)mk/llvm.mk
542 ######################################################################
543 # Secondary makefiles, conditionalized for speed
544 ######################################################################
546 ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \
547 $(findstring check,$(MAKECMDGOALS)) \
548 $(findstring test,$(MAKECMDGOALS)) \
549 $(findstring tidy,$(MAKECMDGOALS)) \
550 $(findstring clean,$(MAKECMDGOALS))),)
551 CFG_INFO := $(info cfg: including dist rules)
552 include $(CFG_SRC_DIR)mk/dist.mk
555 ifneq ($(strip $(findstring snap,$(MAKECMDGOALS)) \
556 $(findstring clean,$(MAKECMDGOALS))),)
557 CFG_INFO := $(info cfg: including snap rules)
558 include $(CFG_SRC_DIR)mk/snap.mk
561 ifneq ($(findstring reformat,$(MAKECMDGOALS)),)
562 CFG_INFO := $(info cfg: including reformat rules)
563 include $(CFG_SRC_DIR)mk/pp.mk
566 ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
567 $(findstring test,$(MAKECMDGOALS)) \
568 $(findstring perf,$(MAKECMDGOALS)) \
569 $(findstring tidy,$(MAKECMDGOALS))),)
570 CFG_INFO := $(info cfg: including test rules)
571 include $(CFG_SRC_DIR)mk/tests.mk
574 ifneq ($(findstring perf,$(MAKECMDGOALS)),)
575 CFG_INFO := $(info cfg: including perf rules)
576 include $(CFG_SRC_DIR)mk/perf.mk
579 ifneq ($(findstring clean,$(MAKECMDGOALS)),)
580 CFG_INFO := $(info cfg: including clean rules)
581 include $(CFG_SRC_DIR)mk/clean.mk
584 ifneq ($(findstring install,$(MAKECMDGOALS)),)
586 CFG_INFO := $(info cfg: setting CFG_PREFIX via DESTDIR, $(DESTDIR)/$(CFG_PREFIX))
587 CFG_PREFIX:=$(DESTDIR)/$(CFG_PREFIX)
591 CFG_INFO := $(info cfg: including install rules)
592 include $(CFG_SRC_DIR)mk/install.mk
595 ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
596 $(findstring TAGS.vi,$(MAKECMDGOALS))),)
597 CFG_INFO := $(info cfg: including ctags rules)
598 include $(CFG_SRC_DIR)mk/ctags.mk
601 # Find all of the .d files and include them to add information about
602 # header file dependencies.
603 ALL_DEP_FILES := $(ALL_OBJ_FILES:%.o=%.d)
604 -include $(ALL_DEP_FILES)