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