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.
13 # # The Rust Build System
15 # Start with these these build targets:
17 # * all - The default rule. Builds a complete stage2 compiler, std,
18 # and extra for all hosts and targets
19 # * docs - Generate HTML documentation for the std and extra libraries
20 # from source code comments
21 # * rustc - The stage 2 compiler for the build platform with standard
26 # * check-stage1-$(crate) - Run tests for a crate, e.g. `check-stage1-std`
27 # * check-stage1-rpass - Run the language tests
28 # * check-docs - Run the doc tests
30 # Then mix in some of these environment variables to harness the
31 # ultimate power of Rust Build System.
33 # * `VERBOSE=1` - Print all commands. Use this to see what's going on.
34 # * `RUSTFLAGS=...` - Add compiler flags to all `rustc` invocations
35 # * `CFG_ENABLE_VALGRIND=1` - Run tests under valgrind
36 # * `VALGRIND_COMPILE=1` - Run the compiler itself under valgrind
37 # (may require `CFG_ENABLE_VALGRIND`)
38 # * `NO_REBUILD=1` - Don't rebootstrap when testing std
39 # (and possibly other crates)
40 # * `SAVE_TEMPS=1` - Use `--save-temps` flag on all `rustc` invocations
41 # * `ASM_COMMENTS=1` - Use `-Z asm-comments`
42 # * `TIME_PASSES=1` - Use `-Z time-passes`
43 # * `TIME_LLVM_PASSES=1` - Use `-Z time-llvm-passes`
44 # * `TRACE=1` - Use `-Z trace`
46 # This is hardly all there is to know of The Rust Build System's
47 # mysteries. Your journey continues on the wiki[1][2].
49 # [1]: https://github.com/mozilla/rust/wiki/Note-build-system
50 # [2]: https://github.com/mozilla/rust/wiki/Note-testsuite
54 # # An (old) explanation of how the build is structured:
56 # *Note: Hey, like, this is probably inaccurate, and is definitely
57 # an outdated and insufficient explanation of the remarkable
58 # and discomfiting Rust Build System.*
60 # There are multiple build stages (0-3) needed to verify that the
61 # compiler is properly self-hosting. Each stage is divided between
62 # 'host' artifacts and 'target' artifacts, where the stageN host
63 # compiler builds artifacts for 1 or more stageN target architectures.
64 # Once the stageN target compiler has been built for the host
65 # architecture it is promoted (copied) to a stageN+1 host artifact.
67 # The stage3 host compiler is a compiler that successfully builds
68 # itself and should (in theory) be bitwise identical to the stage2
69 # host compiler. The process is bootstrapped using a stage0 host
70 # compiler downloaded from a previous snapshot.
72 # At no time should stageN artifacts be interacting with artifacts
73 # from other stages. For consistency, we use the 'promotion' logic
74 # for all artifacts, even those that don't make sense on non-host
77 # The directory layout for a stage is intended to match the layout
78 # of the installed compiler, and looks like the following:
80 # stageN - this is the system root, corresponding to, e.g. /usr
81 # bin - binaries compiled for the host
82 # lib - libraries used by the host compiler
83 # rustlib - rustc's own place to organize libraries
84 # $(target) - target-specific artifacts
85 # bin - binaries for target architectures
86 # lib - libraries for target architectures
88 # A note about host libraries:
90 # The only libraries that get promoted to stageN/lib are those needed
91 # by rustc. In general, rust programs, even those compiled for the
92 # host architecture will use libraries from the target
93 # directories. This gives rust some freedom to experiment with how
94 # libraries are managed and versioned without polluting the common
95 # areas of the filesystem.
97 # General rust binaries may stil live in the host bin directory; they
98 # will just link against the libraries in the target lib directory.
100 # Admittedly this is a little convoluted.
104 ######################################################################
105 # Residual auto-configuration
106 ######################################################################
108 # Recursive wildcard function
109 # http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
110 rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
111 $(filter $(subst *,%,$2),$d))
115 # We track all of the object files we might build so that we can find
116 # and include all of the .d files in one fell swoop.
119 MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*)
120 NON_BUILD_HOST = $(filter-out $(CFG_BUILD),$(CFG_HOST))
121 NON_BUILD_TARGET = $(filter-out $(CFG_BUILD),$(CFG_TARGET))
123 ifneq ($(MAKE_RESTARTS),)
124 CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))
127 CFG_INFO := $(info cfg: build triple $(CFG_BUILD))
128 CFG_INFO := $(info cfg: host triples $(CFG_HOST))
129 CFG_INFO := $(info cfg: target triples $(CFG_TARGET))
131 ifneq ($(wildcard $(NON_BUILD_HOST)),)
132 CFG_INFO := $(info cfg: non-build host triples $(NON_BUILD_HOST))
134 ifneq ($(wildcard $(NON_BUILD_TARGET)),)
135 CFG_INFO := $(info cfg: non-build target triples $(NON_BUILD_TARGET))
138 CFG_RUSTC_FLAGS := $(RUSTFLAGS)
140 CFG_GCCISH_LINK_FLAGS :=
142 ifdef CFG_DISABLE_OPTIMIZE
143 $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
146 # The rtopt cfg turns off runtime sanity checks
147 CFG_RUSTC_FLAGS += -O --cfg rtopt
150 ifdef CFG_DISABLE_DEBUG
151 CFG_RUSTC_FLAGS += --cfg ndebug
152 CFG_GCCISH_CFLAGS += -DRUST_NDEBUG
154 $(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
155 CFG_RUSTC_FLAGS += --cfg debug
156 CFG_GCCISH_CFLAGS += -DRUST_DEBUG
160 CFG_RUSTC_FLAGS += --save-temps
163 CFG_RUSTC_FLAGS += -Z asm-comments
166 CFG_RUSTC_FLAGS += -Z time-passes
168 ifdef TIME_LLVM_PASSES
169 CFG_RUSTC_FLAGS += -Z time-llvm-passes
172 CFG_RUSTC_FLAGS += -Z trace
174 ifdef CFG_DISABLE_RPATH
175 CFG_RUSTC_FLAGS += -C no-rpath
178 # The executables crated during this compilation process have no need to include
179 # static copies of libstd and libextra. We also generate dynamic versions of all
180 # libraries, so in the interest of space, prefer dynamic linking throughout the
181 # compilation process.
183 # Note though that these flags are omitted for stage2+. This means that the
184 # snapshot will be generated with a statically linked rustc so we only have to
185 # worry about the distribution of one file (with its native dynamic
187 RUSTFLAGS_STAGE0 += -C prefer-dynamic
188 RUSTFLAGS_STAGE1 += -C prefer-dynamic
190 # platform-specific auto-configuration
191 include $(CFG_SRC_DIR)mk/platform.mk
193 # Run the stage1/2 compilers under valgrind
194 ifdef VALGRIND_COMPILE
195 CFG_VALGRIND_COMPILE :=$(CFG_VALGRIND)
197 CFG_VALGRIND_COMPILE :=
200 # version-string calculation
201 CFG_GIT_DIR := $(CFG_SRC_DIR).git
202 CFG_RELEASE = 0.10-pre
203 CFG_VERSION = $(CFG_RELEASE)
204 # windows exe's need numeric versions - don't use anything but
205 # numbers and dots here
206 CFG_VERSION_WIN = 0.10
208 # since $(CFG_GIT) may contain spaces (especially on Windows),
209 # we need to escape them. (" " to r"\ ")
210 # Note that $(subst ...) ignores space after `subst`,
211 # so we use a hack: define $(SPACE) which contains space character.
214 ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT))),)
215 ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
216 CFG_VERSION += $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 \
217 --pretty=format:'(%h %ci)')
218 CFG_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse HEAD)
222 ifdef CFG_ENABLE_VALGRIND
223 $(info cfg: enabling valgrind (CFG_ENABLE_VALGRIND))
227 ifdef CFG_BAD_VALGRIND
228 $(info cfg: disabling valgrind due to its unreliability on this platform)
233 ######################################################################
234 # Target-and-rule "utility variables"
235 ######################################################################
248 X_$(1) := $(CFG_EXE_SUFFIX_$(1))
250 $(foreach target,$(CFG_TARGET),\
251 $(eval $(call DEF_X,$(target))))
253 # "Source" files we generate in builddir along the way.
256 # Delete the built-in rules.
265 ######################################################################
266 # Cleaning out old crates
267 ######################################################################
269 # $(1) is the path for directory to match against
270 # $(2) is the glob to use in the match
272 # Note that a common bug is to accidentally construct the glob denoted
273 # by $(2) with a space character prefix, which invalidates the
274 # construction $(1)$(2).
275 define CHECK_FOR_OLD_GLOB_MATCHES
276 $(Q)MATCHES="$(wildcard $(1))"; if [ -n "$$MATCHES" ] ; then echo "warning: there are previous" \'$(notdir $(2))\' "libraries:" $$MATCHES; fi
279 # Same interface as above, but deletes rather than just listing the files.
281 define REMOVE_ALL_OLD_GLOB_MATCHES
282 $(Q)MATCHES="$(wildcard $(1))"; if [ -n "$$MATCHES" ] ; then echo "warning: removing previous" \'$(notdir $(1))\' "libraries:" $$MATCHES; rm $$MATCHES ; fi
285 define REMOVE_ALL_OLD_GLOB_MATCHES
286 $(Q)MATCHES="$(wildcard $(1))"; if [ -n "$$MATCHES" ] ; then rm $$MATCHES ; fi
290 # We use a different strategy for LIST_ALL_OLD_GLOB_MATCHES_EXCEPT
291 # than in the macros above because it needs the result of running the
292 # `ls` command after other rules in the command list have run; the
293 # macro-expander for $(wildcard ...) would deliver its results too
294 # soon. (This is in contrast to the macros above, which are meant to
295 # be run at the outset of a command list in a rule.)
297 define LIST_ALL_OLD_GLOB_MATCHES
298 @echo "info: now are following matches for" '$(notdir $(1))' "libraries:"
299 @( ls $(1) 2>/dev/null || true )
302 define LIST_ALL_OLD_GLOB_MATCHES
306 ######################################################################
308 ######################################################################
311 LLVM_COMPONENTS=x86 arm mips ipo bitreader bitwriter linker asmparser jit mcjit \
312 interpreter instrumentation
314 # Only build these LLVM tools
315 LLVM_TOOLS=bugpoint llc llvm-ar llvm-as llvm-dis llvm-mc opt llvm-extract
318 # The configure script defines these variables with the target triples
319 # separated by Z. This defines new ones with the expected format.
320 CFG_LLVM_BUILD_DIR_$(1):=$$(CFG_LLVM_BUILD_DIR_$(subst -,_,$(1)))
321 CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_INST_DIR_$(subst -,_,$(1)))
323 # Any rules that depend on LLVM should depend on LLVM_CONFIG
324 LLVM_CONFIG_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-config$$(X_$(1))
325 LLVM_MC_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-mc$$(X_$(1))
326 LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
327 LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
328 LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
329 LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
330 LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
331 LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
332 # On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),
333 # so we replace -I with -iquote to ensure that it searches bundled LLVM first.
334 LLVM_CXXFLAGS_$(1)=$$(subst -I, -iquote , $$(shell "$$(LLVM_CONFIG_$(1))" --cxxflags))
335 LLVM_HOST_TRIPLE_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --host-target)
337 LLVM_AS_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-as$$(X_$(1))
338 LLC_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llc$$(X_$(1))
342 $(foreach host,$(CFG_HOST), \
343 $(eval $(call DEF_LLVM_VARS,$(host))))
345 ######################################################################
346 # Exports for sub-utilities
347 ######################################################################
349 # Note that any variable that re-configure should pick up needs to be
355 export CFG_VERSION_WIN
359 export CFG_ENABLE_MINGW_CROSS
362 export CFG_RUSTLIBDIR
363 export CFG_LIBDIR_RELATIVE
364 export CFG_DISABLE_INJECT_STD_VERSION
366 ######################################################################
367 # Per-stage targets and runner
368 ######################################################################
370 include $(CFG_SRC_DIR)mk/crates.mk
373 # $(1) is the stage number
374 # $(2) is the target triple
375 # $(3) is the host triple
377 # Destinations of artifacts for the host compiler
378 HROOT$(1)_H_$(3) = $(3)/stage$(1)
379 HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
380 HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
382 # Destinations of artifacts for target architectures
383 TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLIBDIR)/$(2)
384 TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
385 TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib
387 # Preqrequisites for using the stageN compiler
389 HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
392 $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
393 $$(HLIB$(1)_H_$(3))/stamp.rustc \
394 $$(foreach dep,$$(RUST_DEPS_rustc),$$(HLIB$(1)_H_$(3))/stamp.$$(dep)) \
398 # Prerequisites for using the stageN compiler to build target artifacts
399 TSREQ$(1)_T_$(2)_H_$(3) = \
400 $$(HSREQ$(1)_H_$(3)) \
401 $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a \
402 $$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a
404 # Prerequisites for a working stageN compiler and libraries, for a specific
406 SREQ$(1)_T_$(2)_H_$(3) = \
407 $$(TSREQ$(1)_T_$(2)_H_$(3)) \
408 $$(foreach dep,$$(TARGET_CRATES),\
409 $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep))
411 # Prerequisites for a working stageN compiler and complete set of target
413 CSREQ$(1)_T_$(2)_H_$(3) = \
414 $$(TSREQ$(1)_T_$(2)_H_$(3)) \
415 $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
416 $$(foreach dep,$$(CRATES),$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \
417 $$(foreach dep,$$(HOST_CRATES),$$(HLIB$(1)_H_$(3))/stamp.$$(dep))
420 # Don't run the the stage0 compiler under valgrind - that ship has sailed
421 CFG_VALGRIND_COMPILE$(1) =
423 CFG_VALGRIND_COMPILE$(1) = $$(CFG_VALGRIND_COMPILE)
426 # Add RUSTFLAGS_STAGEN values to the build command
427 EXTRAFLAGS_STAGE$(1) = $$(RUSTFLAGS_STAGE$(1))
429 CFGFLAG$(1)_T_$(2)_H_$(3) = stage$(1)
431 # Pass --cfg stage0 only for the build->host part of stage0;
432 # if you're building a cross config, the host->* parts are
433 # effectively stage1, since it uses the just-built stage0.
435 ifneq ($(strip $(CFG_BUILD)),$(strip $(3)))
436 CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
440 ifdef CFG_DISABLE_RPATH
441 ifeq ($$(OSTYPE_$(3)),apple-darwin)
442 RPATH_VAR$(1)_T_$(2)_H_$(3) := \
443 DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(HLIB$(1)_H_$(3))"
445 RPATH_VAR$(1)_T_$(2)_H_$(3) := \
446 LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(HLIB$(1)_H_$(3))"
449 RPATH_VAR$(1)_T_$(2)_H_$(3) :=
452 STAGE$(1)_T_$(2)_H_$(3) := \
453 $$(Q)$$(RPATH_VAR$(1)_T_$(2)_H_$(3)) \
454 $$(call CFG_RUN_TARG_$(3),$(1), \
455 $$(CFG_VALGRIND_COMPILE$(1)) \
456 $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
457 --cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
458 $$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
461 PERF_STAGE$(1)_T_$(2)_H_$(3) := \
462 $$(Q)$$(call CFG_RUN_TARG_$(3),$(1), \
464 $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
465 --cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
466 $$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
471 $(foreach build,$(CFG_HOST), \
472 $(eval $(foreach target,$(CFG_TARGET), \
473 $(eval $(foreach stage,$(STAGES), \
474 $(eval $(call SREQ,$(stage),$(target),$(build))))))))
476 ######################################################################
479 # Builds a functional Rustc for the given host.
480 ######################################################################
482 define DEF_RUSTC_STAGE_TARGET
483 # $(1) == architecture
486 rustc-stage$(2)-H-$(1): \
487 $$(foreach target,$$(CFG_TARGET),$$(SREQ$(2)_T_$$(target)_H_$(1)))
491 $(foreach host,$(CFG_HOST), \
492 $(eval $(foreach stage,1 2 3, \
493 $(eval $(call DEF_RUSTC_STAGE_TARGET,$(host),$(stage))))))
495 rustc-stage1: rustc-stage1-H-$(CFG_BUILD)
496 rustc-stage2: rustc-stage2-H-$(CFG_BUILD)
497 rustc-stage3: rustc-stage3-H-$(CFG_BUILD)
499 define DEF_RUSTC_TARGET
500 # $(1) == architecture
502 rustc-H-$(1): rustc-stage2-H-$(1)
505 $(foreach host,$(CFG_TARGET), \
506 $(eval $(call DEF_RUSTC_TARGET,$(host))))
508 rustc-stage1: rustc-stage1-H-$(CFG_BUILD)
509 rustc-stage2: rustc-stage2-H-$(CFG_BUILD)
510 rustc-stage3: rustc-stage3-H-$(CFG_BUILD)
511 rustc: rustc-H-$(CFG_BUILD)
513 rustc-H-all: $(foreach host,$(CFG_HOST),rustc-H-$(host))
515 ######################################################################
517 ######################################################################
522 ifneq ($$(findstring $(1),$$(CFG_HOST)),)
524 all-target-$(1)-host-$(2): $$(CSREQ2_T_$(1)_H_$(2))
526 # This is a target only
527 all-target-$(1)-host-$(2): $$(SREQ2_T_$(1)_H_$(2))
531 $(foreach target,$(CFG_TARGET), \
532 $(foreach host,$(CFG_HOST), \
533 $(eval $(call ALL_TARGET_N,$(target),$(host)))))
535 ALL_TARGET_RULES = $(foreach target,$(CFG_TARGET), \
536 $(foreach host,$(CFG_HOST), \
537 all-target-$(target)-host-$(host)))
539 all: $(ALL_TARGET_RULES) $(GENERATED) docs
542 ######################################################################
544 ######################################################################
546 ifndef CFG_DISABLE_MANAGE_SUBMODULES
547 # This is a pretty expensive operation but I don't see any way to avoid it
548 NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)')
553 ifeq ($(NEED_GIT_RECONFIG),0)
555 # If the submodules have changed then always execute config.mk
559 Makefile config.mk: config.stamp
561 config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
562 @$(call E, cfg: reconfiguring)
563 $(Q)$(S)configure $(CFG_CONFIGURE_ARGS)
566 ######################################################################
567 # Primary-target makefiles
568 ######################################################################
570 # Issue #9531: If you change the order of any of the following (or add
571 # new definitions), make sure definitions always precede their uses,
572 # especially for the dependency lists of recipes.
574 include $(CFG_SRC_DIR)mk/rt.mk
575 include $(CFG_SRC_DIR)mk/target.mk
576 include $(CFG_SRC_DIR)mk/host.mk
577 include $(CFG_SRC_DIR)mk/stage0.mk
578 include $(CFG_SRC_DIR)mk/rustllvm.mk
579 include $(CFG_SRC_DIR)mk/docs.mk
580 include $(CFG_SRC_DIR)mk/llvm.mk
582 ######################################################################
583 # Secondary makefiles, conditionalized for speed
584 ######################################################################
586 ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \
587 $(findstring check,$(MAKECMDGOALS)) \
588 $(findstring test,$(MAKECMDGOALS)) \
589 $(findstring tidy,$(MAKECMDGOALS)) \
590 $(findstring clean,$(MAKECMDGOALS))),)
591 CFG_INFO := $(info cfg: including dist rules)
592 include $(CFG_SRC_DIR)mk/dist.mk
595 ifneq ($(strip $(findstring snap,$(MAKECMDGOALS)) \
596 $(findstring clean,$(MAKECMDGOALS))),)
597 CFG_INFO := $(info cfg: including snap rules)
598 include $(CFG_SRC_DIR)mk/snap.mk
601 ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
602 $(findstring test,$(MAKECMDGOALS)) \
603 $(findstring perf,$(MAKECMDGOALS)) \
604 $(findstring tidy,$(MAKECMDGOALS))),)
605 CFG_INFO := $(info cfg: including test rules)
606 include $(CFG_SRC_DIR)mk/tests.mk
609 ifneq ($(findstring perf,$(MAKECMDGOALS)),)
610 CFG_INFO := $(info cfg: including perf rules)
611 include $(CFG_SRC_DIR)mk/perf.mk
614 ifneq ($(findstring clean,$(MAKECMDGOALS)),)
615 CFG_INFO := $(info cfg: including clean rules)
616 include $(CFG_SRC_DIR)mk/clean.mk
619 ifneq ($(findstring install,$(MAKECMDGOALS)),)
620 CFG_INFO := $(info cfg: including install rules)
621 include $(CFG_SRC_DIR)mk/install.mk
624 ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
625 $(findstring TAGS.vi,$(MAKECMDGOALS))),)
626 CFG_INFO := $(info cfg: including ctags rules)
627 include $(CFG_SRC_DIR)mk/ctags.mk
630 # Find all of the .d files and include them to add information about
631 # header file dependencies.
632 ALL_DEP_FILES := $(ALL_OBJ_FILES:%.o=%.d)
633 -include $(ALL_DEP_FILES)
636 # Show the comments from this file as "help"
637 # pick everything between tags | remove first line | remove last line
638 # | remove extra (?) line | strip leading `#` from lines
639 $(Q)awk '/<help>/,/<\/help>/' $(S)/Makefile.in | sed '1d' | sed '$$d' | sed 's/^# \?//'