PageRenderTime 136ms CodeModel.GetById 39ms app.highlight 86ms RepoModel.GetById 1ms app.codeStats 1ms

/Makefile.in

http://github.com/jruderman/rust
Autoconf | 543 lines | 316 code | 104 blank | 123 comment | 1 complexity | 27092dbf5cb021f792036184371e3aae MD5 | raw file
  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
 34# by rustc. In general, rust programs, even those compiled for the
 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
 45STAGES = 0 1 2 3
 46
 47######################################################################
 48# Residual auto-configuration
 49######################################################################
 50
 51# Recursive wildcard function
 52# http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
 53rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
 54  $(filter $(subst *,%,$2),$d))
 55
 56include config.mk
 57
 58# We track all of the object files we might build so that we can find
 59# and include all of the .d files in one fell swoop.
 60ALL_OBJ_FILES :=
 61
 62MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*)
 63NON_HOST_TRIPLES = $(filter-out $(CFG_HOST_TRIPLE),$(CFG_TARGET_TRIPLES))
 64
 65ifneq ($(MAKE_RESTARTS),)
 66CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))
 67endif
 68
 69CFG_INFO := $(info cfg: shell host triple $(CFG_HOST_TRIPLE))
 70
 71ifneq ($(wildcard $(NON_HOST_TRIPLES)),)
 72CFG_INFO := $(info cfg: non host triples $(NON_HOST_TRIPLES))
 73endif
 74
 75CFG_RUSTC_FLAGS := $(RUSTFLAGS)
 76CFG_GCCISH_CFLAGS :=
 77CFG_GCCISH_LINK_FLAGS :=
 78
 79ifdef CFG_DISABLE_OPTIMIZE
 80  $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
 81  CFG_RUSTC_FLAGS +=
 82else
 83  CFG_RUSTC_FLAGS += -O
 84endif
 85
 86ifdef CFG_ENABLE_DEBUG
 87  $(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
 88  CFG_RUSTC_FLAGS +=
 89  CFG_GCCISH_CFLAGS += -DRUST_DEBUG
 90else
 91  CFG_GCCISH_CFLAGS += -DRUST_NDEBUG
 92endif
 93
 94ifdef SAVE_TEMPS
 95  CFG_RUSTC_FLAGS += --save-temps
 96endif
 97ifdef TIME_PASSES
 98  CFG_RUSTC_FLAGS += -Z time-passes
 99endif
100ifdef TIME_LLVM_PASSES
101  CFG_RUSTC_FLAGS += -Z time-llvm-passes
102endif
103
104# platform-specific auto-configuration
105include $(CFG_SRC_DIR)mk/platform.mk
106
107# Run the stage1/2 compilers under valgrind
108ifdef VALGRIND_COMPILE
109  CFG_VALGRIND_COMPILE :=$(CFG_VALGRIND)
110else
111  CFG_VALGRIND_COMPILE :=
112endif
113
114CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
115CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
116CFG_CORELIB :=$(call CFG_LIB_NAME,core)
117CFG_STDLIB :=$(call CFG_LIB_NAME,std)
118CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc)
119CFG_LIBSYNTAX :=$(call CFG_LIB_NAME,syntax)
120
121STDLIB_GLOB :=$(call CFG_LIB_GLOB,std)
122CORELIB_GLOB :=$(call CFG_LIB_GLOB,core)
123LIBRUSTC_GLOB :=$(call CFG_LIB_GLOB,rustc)
124LIBSYNTAX_GLOB :=$(call CFG_LIB_GLOB,syntax)
125STDLIB_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,std)
126CORELIB_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,core)
127LIBRUSTC_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,rustc)
128LIBSYNTAX_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,syntax)
129
130# version-string calculation
131CFG_GIT_DIR := $(CFG_SRC_DIR).git
132CFG_RELEASE = 0.3.1
133CFG_VERSION = $(CFG_RELEASE)
134
135ifneq ($(wildcard $(CFG_GIT)),)
136ifneq ($(wildcard $(CFG_GIT_DIR)),)
137    CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
138                     --pretty=format:'(%h %ci)')
139    CFG_VER_HASH = $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
140                     --pretty=format:'%H')
141endif
142endif
143
144ifdef CFG_DISABLE_VALGRIND
145  $(info cfg: disabling valgrind (CFG_DISABLE_VALGRIND))
146  CFG_VALGRIND :=
147endif
148ifdef CFG_BAD_VALGRIND
149  $(info cfg: disabling valgrind due to its unreliability on this platform)
150  CFG_VALGRIND :=
151endif
152
153
154######################################################################
155# Target-and-rule "utility variables"
156######################################################################
157
158ifdef VERBOSE
159  Q :=
160  E =
161else
162  Q := @
163  E = echo $(1)
164endif
165
166S := $(CFG_SRC_DIR)
167X := $(CFG_EXE_SUFFIX)
168
169# Look in doc and src dirs.
170VPATH := $(S)doc $(S)src
171
172# "Source" files we generate in builddir along the way.
173GENERATED :=
174
175# Delete the built-in rules.
176.SUFFIXES:
177%:: %,v
178%:: RCS/%,v
179%:: RCS/%
180%:: s.%
181%:: SCCS/s.%
182
183######################################################################
184# Core library variables
185######################################################################
186
187CORELIB_CRATE := $(S)src/libcore/core.rc
188CORELIB_INPUTS := $(wildcard $(addprefix $(S)src/libcore/,        \
189                                           core.rc *.rs */*.rs))
190
191######################################################################
192# Standard library variables
193######################################################################
194
195STDLIB_CRATE := $(S)src/libstd/std.rc
196STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/libstd/,          \
197                                          std.rc *.rs */*.rs))
198
199######################################################################
200# rustc crate variables
201######################################################################
202
203COMPILER_CRATE := $(S)src/rustc/rustc.rc
204COMPILER_INPUTS := $(filter-out $(S)src/rustc/driver/rustc.rs,     \
205                       $(wildcard $(addprefix $(S)src/rustc/,      \
206                           rustc.rc *.rs */*.rs */*/*.rs */*/*/*.rs)))
207
208LIBSYNTAX_CRATE := $(S)src/libsyntax/syntax.rc
209LIBSYNTAX_INPUTS := $(wildcard $(addprefix $(S)src/libsyntax/, \
210                            syntax.rc *.rs */*.rs */*/*.rs))
211
212RUSTC_INPUTS := $(S)src/rustc/driver/rustc.rs
213
214######################################################################
215# LLVM macros
216######################################################################
217
218# FIXME: x86-ism
219LLVM_COMPONENTS=x86 ipo bitreader bitwriter linker asmparser
220
221define DEF_LLVM_VARS
222# The configure script defines these variables with the target triples
223# separated by Z. This defines new ones with the expected format.
224CFG_LLVM_BUILD_DIR_$(1):=$$(CFG_LLVM_BUILD_DIR_$(subst -,_,$(1)))
225CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_INST_DIR_$(subst -,_,$(1)))
226
227# Any rules that depend on LLVM should depend on LLVM_CONFIG
228LLVM_CONFIG_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-config$$(X)
229LLVM_MC_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-mc$$(X)
230LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
231LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
232LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
233LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
234LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
235LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
236# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),
237# so we replace -I with -iquote to ensure that it searches bundled LLVM first.
238LLVM_CXXFLAGS_$(1)=$$(subst -I, -iquote , $$(shell "$$(LLVM_CONFIG_$(1))" --cxxflags))
239LLVM_HOST_TRIPLE_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --host-target)
240
241LLVM_AS_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-as$$(X)
242LLC_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llc$$(X)
243
244endef
245
246$(foreach target,$(CFG_TARGET_TRIPLES), \
247 $(eval $(call DEF_LLVM_VARS,$(target))))
248
249######################################################################
250# Exports for sub-utilities
251######################################################################
252
253# Note that any variable that re-configure should pick up needs to be
254# exported
255
256export CFG_SRC_DIR
257export CFG_BUILD_DIR
258export CFG_VERSION
259export CFG_HOST_TRIPLE
260export CFG_LLVM_ROOT
261export CFG_ENABLE_MINGW_CROSS
262export CFG_PREFIX
263export CFG_LIBDIR
264
265######################################################################
266# Subprograms
267######################################################################
268
269######################################################################
270# Per-stage targets and runner
271######################################################################
272
273define SREQ
274# $(1) is the stage number
275# $(2) is the target triple
276# $(3) is the host triple
277
278# Destinations of artifacts for the host compiler
279HROOT$(1)_H_$(3) = $(3)/stage$(1)
280HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
281HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR)
282
283# Destinations of artifacts for target architectures
284TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustc/$(2)
285TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
286TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/$$(CFG_LIBDIR)
287
288# The name of the core and standard libraries used by rustc
289ifdef CFG_DISABLE_SHAREDSTD
290  HCORELIB_DEFAULT$(1)_H_$(3) = \
291    $$(HLIB$(1)_H_$(3))/libcore.rlib
292  TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
293    $$(TLIB$(1)_T_$(2)_H_$(3))/libcore.rlib
294
295  HSTDLIB_DEFAULT$(1)_H_$(3) = \
296    $$(HLIB$(1)_H_$(3))/libstd.rlib
297  TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
298    $$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib
299
300  HLIBRUSTC_DEFAULT$(1)_H_$(3) = \
301    $$(HLIB$(1)_H_$(3))/librustc.rlib
302  TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3) = \
303    $$(TLIB$(1)_T_$(2)_H_$(3))/librustc.rlib
304else
305  HCORELIB_DEFAULT$(1)_H_$(3) = \
306    $$(HLIB$(1)_H_$(3))/$(CFG_CORELIB)
307  TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
308    $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_CORELIB)
309
310  HSTDLIB_DEFAULT$(1)_H_$(3) = \
311    $$(HLIB$(1)_H_$(3))/$(CFG_STDLIB)
312  TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
313    $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB)
314
315  HLIBRUSTC_DEFAULT$(1)_H_$(3) = \
316    $$(HLIB$(1)_H_$(3))/$(CFG_LIBRUSTC)
317  TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3) = \
318    $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC)
319endif
320
321# Preqrequisites for using the stageN compiler
322HSREQ$(1)_H_$(3) = \
323	$$(HBIN$(1)_H_$(3))/rustc$$(X) \
324	$$(HLIB$(1)_H_$(3))/$$(CFG_RUNTIME) \
325	$$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLLVM) \
326	$$(HCORELIB_DEFAULT$(1)_H_$(3)) \
327	$$(HSTDLIB_DEFAULT$(1)_H_$(3)) \
328	$$(HLIBRUSTC_DEFAULT$(1)_H_$(3)) \
329	$$(MKFILE_DEPS)
330
331# Prerequisites for using the stageN compiler to build target artifacts
332TSREQ$(1)_T_$(2)_H_$(3) = \
333	$$(HSREQ$(1)_H_$(3)) \
334	$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUNTIME) \
335	$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
336
337# Prerequisites for complete stageN targets
338SREQ$(1)_T_$(2)_H_$(3) = \
339	$$(TSREQ$(1)_T_$(2)_H_$(3)) \
340	$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB) \
341	$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB)  \
342	$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC)
343
344ifeq ($(1),0)
345# Don't run the the stage0 compiler under valgrind - that ship has sailed
346CFG_VALGRIND_COMPILE$(1) =
347else
348CFG_VALGRIND_COMPILE$(1) = $$(CFG_VALGRIND_COMPILE)
349endif
350
351# Add RUSTFLAGS_STAGEN values to the build command
352EXTRAFLAGS_STAGE$(1) = $$(RUSTFLAGS_STAGE$(1))
353
354STAGE$(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 stage$(1)					\
359		$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2))
360
361PERF_STAGE$(1)_T_$(2)_H_$(3) := 				\
362	$$(Q)$$(call CFG_RUN_TARG,$(1),				\
363		$$(CFG_PERF_TOOL) 						\
364		$$(HBIN$(1)_H_$(3))/rustc$$(X)			\
365		--cfg stage$(1)					\
366		$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2))
367
368endef
369
370$(foreach build,$(CFG_TARGET_TRIPLES), \
371 $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
372  $(eval $(foreach stage,$(STAGES), \
373   $(eval $(call SREQ,$(stage),$(target),$(build))))))))
374
375######################################################################
376# rustc-H-targets
377#
378# Builds a functional Rustc for the given host.
379######################################################################
380
381define DEF_RUSTC_STAGE_TARGET
382# $(1) == architecture
383# $(2) == stage
384
385rustc-stage$(2)-H-$(1):							\
386	$$(foreach target,$$(CFG_TARGET_TRIPLES),	\
387		$$(SREQ$(2)_T_$$(target)_H_$(1)))
388
389endef
390
391$(foreach host,$(CFG_TARGET_TRIPLES),							\
392 $(eval $(foreach stage,1 2 3,									\
393  $(eval $(call DEF_RUSTC_STAGE_TARGET,$(host),$(stage))))))
394
395rustc-stage1: rustc-stage1-H-$(CFG_HOST_TRIPLE)
396rustc-stage2: rustc-stage2-H-$(CFG_HOST_TRIPLE)
397rustc-stage3: rustc-stage3-H-$(CFG_HOST_TRIPLE)
398
399define DEF_RUSTC_TARGET
400# $(1) == architecture
401
402rustc-H-$(1): rustc-stage2-H-$(1)
403endef
404
405$(foreach host,$(CFG_TARGET_TRIPLES),			\
406 $(eval $(call DEF_RUSTC_TARGET,$(host))))
407
408rustc-stage1: rustc-stage1-H-$(CFG_HOST_TRIPLE)
409rustc-stage2: rustc-stage2-H-$(CFG_HOST_TRIPLE)
410rustc-stage3: rustc-stage3-H-$(CFG_HOST_TRIPLE)
411rustc: rustc-H-$(CFG_HOST_TRIPLE)
412
413rustc-H-all: $(foreach host,$(CFG_TARGET_TRIPLES),rustc-H-$(host))
414
415######################################################################
416# Entrypoint rule
417######################################################################
418
419.DEFAULT_GOAL := all
420
421ifneq ($(CFG_IN_TRANSITION),)
422
423CFG_INFO := $(info cfg:)
424CFG_INFO := $(info cfg: *** compiler is in snapshot transition ***)
425CFG_INFO := $(info cfg: *** stage2 and later will not be built ***)
426CFG_INFO := $(info cfg:)
427
428all: $(SREQ1$(CFG_HOST_TRIPLE)) $(GENERATED) docs
429
430else
431
432TSREQS :=											\
433	$(foreach target,$(CFG_TARGET_TRIPLES),			\
434		$(SREQ3_T_$(target)_H_$(CFG_HOST_TRIPLE)))
435FUZZ := $(HBIN2_H_$(CFG_HOST_TRIPLE))/fuzzer$(X)
436CARGO := $(HBIN2_H_$(CFG_HOST_TRIPLE))/cargo$(X)
437RUSTDOC := $(HBIN2_H_$(CFG_HOST_TRIPLE))/rustdoc$(X)
438
439all: rustc $(GENERATED) docs $(FUZZ) $(CARGO) $(RUSTDOC)
440
441endif
442
443
444######################################################################
445# Re-configuration
446######################################################################
447
448ifndef CFG_DISABLE_MANAGE_SUBMODULES
449# This is a pretty expensive operation but I don't see any way to avoid it
450NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)')
451else
452NEED_GIT_RECONFIG=0
453endif
454
455ifeq ($(NEED_GIT_RECONFIG),0)
456else
457# If the submodules have changed then always execute config.mk
458.PHONY: config.stamp
459endif
460
461Makefile config.mk: config.stamp
462
463config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
464	@$(call E, cfg: reconfiguring)
465	$(Q)$(S)configure $(CFG_CONFIGURE_ARGS)
466
467
468######################################################################
469# Primary-target makefiles
470######################################################################
471
472include $(CFG_SRC_DIR)mk/target.mk
473include $(CFG_SRC_DIR)mk/host.mk
474include $(CFG_SRC_DIR)mk/stage0.mk
475include $(CFG_SRC_DIR)mk/rt.mk
476include $(CFG_SRC_DIR)mk/rustllvm.mk
477include $(CFG_SRC_DIR)mk/tools.mk
478include $(CFG_SRC_DIR)mk/docs.mk
479include $(CFG_SRC_DIR)mk/llvm.mk
480
481######################################################################
482# Secondary makefiles, conditionalized for speed
483######################################################################
484
485ifneq ($(strip $(findstring dist,$(MAKECMDGOALS))   \
486               $(findstring check,$(MAKECMDGOALS))  \
487               $(findstring test,$(MAKECMDGOALS))   \
488               $(findstring tidy,$(MAKECMDGOALS))   \
489               $(findstring clean,$(MAKECMDGOALS))),)
490  CFG_INFO := $(info cfg: including dist rules)
491  include $(CFG_SRC_DIR)mk/dist.mk
492endif
493
494ifneq ($(strip $(findstring snap,$(MAKECMDGOALS))   \
495               $(findstring clean,$(MAKECMDGOALS))),)
496  CFG_INFO := $(info cfg: including snap rules)
497  include $(CFG_SRC_DIR)mk/snap.mk
498endif
499
500ifneq ($(findstring reformat,$(MAKECMDGOALS)),)
501  CFG_INFO := $(info cfg: including reformat rules)
502  include $(CFG_SRC_DIR)mk/pp.mk
503endif
504
505ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
506               $(findstring test,$(MAKECMDGOALS))  \
507               $(findstring perf,$(MAKECMDGOALS))  \
508               $(findstring tidy,$(MAKECMDGOALS))),)
509  CFG_INFO := $(info cfg: including test rules)
510  include $(CFG_SRC_DIR)mk/tests.mk
511endif
512
513ifneq ($(findstring perf,$(MAKECMDGOALS)),)
514  CFG_INFO := $(info cfg: including perf rules)
515  include $(CFG_SRC_DIR)mk/perf.mk
516endif
517
518ifneq ($(findstring clean,$(MAKECMDGOALS)),)
519  CFG_INFO := $(info cfg: including clean rules)
520  include $(CFG_SRC_DIR)mk/clean.mk
521endif
522
523ifneq ($(findstring install,$(MAKECMDGOALS)),)
524  ifdef DESTDIR
525    CFG_INFO := $(info cfg: setting CFG_PREFIX via DESTDIR, $(DESTDIR))
526    CFG_PREFIX:=$(DESTDIR)
527    export CFG_PREFIX
528  endif
529
530  CFG_INFO := $(info cfg: including install rules)
531  include $(CFG_SRC_DIR)mk/install.mk
532endif
533
534ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
535               $(findstring TAGS.vi,$(MAKECMDGOALS))),)
536  CFG_INFO := $(info cfg: including ctags rules)
537  include $(CFG_SRC_DIR)mk/ctags.mk
538endif
539
540# Find all of the .d files and include them to add information about
541# header file dependencies.
542ALL_DEP_FILES := $(ALL_OBJ_FILES:%.o=%.d)
543-include $(ALL_DEP_FILES)