-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.include
532 lines (434 loc) · 15 KB
/
Makefile.include
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
######################################################################
# Main makefile logic
######################################################################
CC ?= gcc
CXX ?= g++
LD ?= ld
OBJCPY ?= objcopy
BINDIR = bin
DEPDIR = deps
DOCDIR = doc/html
OBJDIR = objs
LIBDIR = lib
INCLUDEDIR = $(shell pwd)/include
#
# Cute stuff to beautify make output - use 'make V=1' to see command output
#
V ?= 0
Q_0 = @
Q = $(Q_$(V))
QDEP_0 = @echo " DEP" $<;
QDEP = $(QDEP_$(V))
QCC_0 = @echo " CC" $<;
QCC = $(QCC_$(V))
QCXX_0 = @echo " CXX" $<;
QCXX = $(QCXX_$(V))
QLINK_0 = @echo " LINK" $@;
QLINK = $(QLINK_$(V))
QSYM_0 = @echo " SYM" $@;
QSYM = $(QSYM_$(V))
QSTRIP_0 = @echo " STRIP" $@;
QSTRIP = $(QSTRIP_$(V))
QLNKSYM_0 = @echo " LNKSYM" $@;
QLNKSYM = $(QLNKSYM_$(V))
QAR_0 = @echo " AR" $@;
QAR = $(QAR_$(V))
QRANLIB_0 = @echo " RANLIB" $@;
QRANLIB = $(QRANLIB_$(V))
QDEPDBG_0 = @echo " DEP $< [debug]";
QDEPDBG = $(QDEPDBG_$(V))
QCCDBG_0 = @echo " CC $< [debug]";
QCCDBG = $(QCCDBG_$(V))
QCXXDBG_0 = @echo " CXX $< [debug]";
QCXXDBG = $(QCXXDBG_$(V))
QLINKDBG_0 = @echo " LINK $@ [debug]";
QLINKDBG = $(QLINKDBG_$(V))
QDEPCOV_0 = @echo " DEP $< [coverage]";
QDEPCOV = $(QDEPCOV_$(V))
QCCCOV_0 = @echo " CC $< [coverage]";
QCCCOV = $(QCCCOV_$(V))
QCXXCOV_0 = @echo " CXX $< [coverage]";
QCXXCOV = $(QCXXCOV_$(V))
QLINKCOV_0 = @echo " LINK $@ [coverage]";
QLINKCOV = $(QLINKCOV_$(V))
# Put this as the first target encountered
release:
# force target used further on
FORCE:
include $(TOPDIR)/Makefile.flags
#
# DIR_TARGETS - Macro to make directory creation rules
#
define DIR_TARGETS
D = $(1)
$(DEPDIR)/$$(D) $$(D)/$(OBJDIR) $$(D)/$(BINDIR) $$(D)/$(LIBDIR):
$$(Q)mkdir -p $$@
endef
#
# STD_TARGETS - Dependency and compile targets for individual
# source files
#
define STD_TARGETS
D = $(1)
T = $(2)
TMP_DEPS := $$($$(T)_OBJS:%o=$(DEPDIR)/$$(D)/%d)
#
# Create dependency '.d' file
#
$(DEPDIR)/$$(D)/%.d: SRCDIR := $$(D)
$(DEPDIR)/$$(D)/%.d: $$(D)/%.cc | $(DEPDIR)/$$(D)
$$(QDEP)$$(CXX) -MM -MP -MT '$$(SRCDIR)/$(OBJDIR)/$$*.o $$@' \
$$(CXXFLAGS_release) $$< -MF $$@
$(DEPDIR)/$$(D)/%.debug.d: $$(D)/%.cc | $(DEPDIR)/$$(D)
$$(QDEPDBG)$$(CXX) -MM -MP -MT '$$(SRCDIR)/$(OBJDIR)/$$*.debug.o $$@' \
$$(CXXFLAGS_debug) $$< -MF $$@
$(DEPDIR)/$$(D)/%.coverage.d: $$(D)/%.cc | $(DEPDIR)/$$(D)
$$(QDEPCOV)$$(CXX) -MM -MP -MT '$$(SRCDIR)/$(OBJDIR)/$$*.coverage.o $$@' \
$$(CXXFLAGS_coverage) $$< -MF $$@
$(DEPDIR)/$$(D)/%.d: $$(D)/%.c | $(DEPDIR)/$$(D)
$$(QDEP)$$(CC) -MM -MP -MT '$$(SRCDIR)/$(OBJDIR)/$$*.o $$@' \
$$(CFLAGS_release) $$< -MF $$@
$(DEPDIR)/$$(D)/%.debug.d: $$(D)/%.c | $(DEPDIR)/$$(D)
$$(QDEPDBG)$$(CC) -MM -MP -MT '$$(SRCDIR)/$(OBJDIR)/$$*.debug.o $$@' \
$$(CFLAGS_debug) $$< -MF $$@
$(DEPDIR)/$$(D)/%.coverage.d: $$(D)/%.c | $(DEPDIR)/$$(D)
$$(QDEPCOV)$$(CC) -MM -MP -MT '$$(SRCDIR)/$(OBJDIR)/$$*.coverage.o $$@' \
$$(CFLAGS_coverage) $$< -MF $$@
#
# Source unit compilation
#
$$(D)/$(OBJDIR)/%.o: $$(D)/%.cc | $$(D)/$(OBJDIR)
$$(QCXX)$$(CXX) $$(CXXFLAGS_release) -c $$(abspath $$<) -o $$@
$$(D)/$(OBJDIR)/%.debug.o: $$(D)/%.cc | $$(D)/$(OBJDIR)
$$(QCXXDBG)$$(CXX) $$(CXXFLAGS_debug) -c $$(abspath $$<) -o $$@
$$(D)/$(OBJDIR)/%.coverage.o: $$(D)/%.cc | $$(D)/$(OBJDIR)
$$(QCXXCOV)$(CXX) $$(CXXFLAGS_coverage) -c $$(abspath $$<) -o $$@
$$(D)/$(OBJDIR)/%.o: $$(D)/%.c | $$(D)/$(OBJDIR)
$$(QCC)$$(CC) $$(CFLAGS_release) -c $$(abspath $$<) -o $$@
$$(D)/$(OBJDIR)/%.debug.o: $$(D)/%.c | $$(D)/$(OBJDIR)
$$(QCC)$$(CC) $$(CFLAGS_debug) -c $$(abspath $$<) -o $$@
$$(D)/$(OBJDIR)/%.coverage.o: $$(D)/%.c | $$(D)/$(OBJDIR)
$$(QCCCOV)$$(CC) $$(CFLAGS_coverage) -c $$(abspath $$<) -o $$@
DEPS := $$(DEPS) $$(TMP_DEPS)
endef
#
# PROGRAM_TARGETS - These are the targets used to link together executables
#
define PROGRAM_TARGETS
D = $(1)
T = $(2)
EXE := $$(D)/$(BINDIR)/$$(T)
#
# Place compiled objects in $(OBJDIR)
#
$$(T)_OBJS := $$($$(T)_OBJS:%.o=$$(D)/$(OBJDIR)/%.o)
$$(T)_DBG_OBJS := $$($$(T)_OBJS:%.o=%.debug.o)
$$(T)_COV_OBJS := $$($$(T)_OBJS:%.o=%.coverage.o)
LIBDEPS := $$($$(T)_LIBDEPS:%=$(LIBDIR)/lib%.a)
DBG_LIBDEPS := $$($$(T)_LIBDEPS:%=$(LIBDIR)/lib%.debug.a)
COV_LIBDEPS := $$($$(T)_LIBDEPS:%=$(LIBDIR)/lib%.coverage.a)
$$(D)/$$(T): $$(EXE)
$$(D)/$$(T).debug: $$(EXE).debug
$$(D)/$$(T).coverage: $$(EXE).coverage
.PHONY: $$(D)/$$(T) $$(D)/$$(T).debug $$(D)/$$(T).coverage
#
# This is a gross hack to allow make invocations from subdirectories to
# 'just work' - any dependent libs are built by issuing a
# 'make -C $(TOPDIR) lib/libfoo.a' ... this needs to unconditionally occur
# however, hence the 'FORCE' hack here
#
ifeq ($$(D),.)
$$(LIBDEPS) $$(DBG_LIBDEPS) $$(COV_LIBDEPS): FORCE | $(LIBDIR)
$$(MAKE) -C $$(TOPDIR) $$@
rm -f $$@
ln $$(TOPDIR)/$$@ $$@
endif
#
# Link the release build, then strip it, preserving debug symbols in
# $(target).symbols
#
$$(EXE): $$($$(T)_OBJS) $$(LIBDEPS) | $$(D)/$(BINDIR)
$$(QLINK)$$(CXX) $$(CXXFLAGS_release) -o $$@ -L $(LIBDIR) \
$$(patsubst lib/lib%.a, -l%, $$^) \
$$(LDFLAGS_release) $$(LIBS_release)
$$(QSYM)$$(OBJCPY) --only-keep-debug $$@ [email protected]
$$(QSTRIP)$$(OBJCPY) --strip-all $$@
$$(QLNKSYM)$$(OBJCPY) --add-gnu-debuglink [email protected] $$@
$$(Q)chmod 644 [email protected]
# Debug
$$(EXE).debug: $$($$(T)_DBG_OBJS) $$(DBG_LIBDEPS) | $$(D)/$$(BINDIR)
$$(QLINKDBG)$$(CXX) $$(CXXFLAGS_debug) -o $$@ -L $(LIBDIR) \
$$(patsubst lib/lib%.a, -l%, $$^) \
$$(LDFLAGS_debug) $$(LIBS_debug)
# Coverage
$$(EXE).coverage: $$($$(T)_COV_OBJS) $$(COV_LIBDEPS) | $$(D)/$$(BINDIR)
$$(QLINKCOV)$$(CXX) $$(CXXFLAGS_coverage) -o $$@ -L $(LIBDIR) \
$$(patsubst lib/lib%.a, -l%, $$^) \
$$(LDFLAGS_coverage) $$(LIBS_coverage)
endef
#
# LIBRARY_TARGETS - Targets for building libraries; currently only static
# libs are supported.
#
define LIBRARY_TARGETS
D = $(1)
T = $(2)
STATIC_LIB := $$(D)/$$(LIBDIR)/$$(T).a
DBG_STATIC_LIB := $$(D)/$$(LIBDIR)/$$(T).debug.a
COV_STATIC_LIB := $$(D)/$$(LIBDIR)/$$(T).coverage.a
LINK_NAME := $$(T:lib%=-l%)
DBG_LINK_NAME := $$(T:lib%=-l%.debug)
COV_LINK_NAME := $$(T:lib%=-l%.coverage)
#
# Library objects to build
#
$$(T)_OBJS := $$($$(T)_OBJS:%.o=$$(D)/$$(OBJDIR)/%.o)
$$(T)_DBG_OBJS = $$($$(T)_OBJS:%.o=%.debug.o)
$$(T)_COV_OBJS = $$($$(T)_OBJS:%.o=%.coverage.o)
$$(D)/$$(T): $$(STATIC_LIB)
$$(D)/$$(T).debug: $$(DBG_STATIC_LIB)
$$(D)/$$(T).coverage: $$(COV_STATIC_LIB)
# release
$$(STATIC_LIB): $$($$(T)_OBJS) | $$(D)/$$(LIBDIR)
$$(QAR)ar -cSur $$@ $$^
$$(QRANLIB)ranlib $$@
# Debug
$$(DBG_STATIC_LIB): $$($$(T)_DBG_OBJS) | $$(D)/$$(LIBDIR)
$$(QAR)ar -cSur $$@ $$^
$$(QRANLIB)ranlib $$@
# Coverage
$$(COV_STATIC_LIB): $$($$(T)_COV_OBJS) | $$(D)/$$(LIBDIR)
$$(QAR)ar -cSur $$@ $$^
$$(QRANLIB)ranlib $$@
ifneq ($$(D),.)
$$(LIBDIR)/$$(T).a: $$(STATIC_LIB) | $$(LIBDIR)
@rm -f $$@
@ln $$^ $$@
$$(LIBDIR)/$$(T).debug.a: $$(DBG_STATIC_LIB) | $$(LIBDIR)
@rm -f $$@
@ln $$^ $$@
$$(LIBDIR)/$$(T).coverage.a: $$(COV_STATIC_LIB) | $$(LIBDIR)
@rm -f $$@
@ln $$^ $$@
endif
endef
#
# ACTION_TARGETS - These are user-defined actions that someone may wish
# to make... The implementation of this is still a little
# half-baked XXX
#
define ACTION_TARGETS
D = $(1)
T = $(2)
$$(D)_$$(T)_action := $$($$(T)_ACTION)
$$(D)_$$(T): $$(addprefix $$(D)/$(BINDIR)/, $$($$(T)_DEPS))
EXE=$$<; $$($$(@)_action)
$$(D)/$$(T): $$(D)_$$(T)
.PHONY: $$(D)_$$(T) $$(D)/$$(T) $$(T)
$$(T): $$(D)_$$(T)
endef
#
# INCLUDE_SUBMAKE - Include a sub-makefile that contains basic definitions
# for building stuff in a directory
#
define INCLUDE_SUBMAKE
D = $(1)
OLD_SUBDIRS := $$(SUBDIRS) $$(OLD_SUBDIRS)
OLD_TARGETS := $$(TARGETS)
OLD_LIB_TARGETS := $$(LIB_TARGETS)
OLD_ACTIONS := $$(ACTIONS)
SUBDIRS :=
TARGETS :=
LIB_TARGETS :=
include $$(D)/Makefile
$$(eval $$(call DIR_TARGETS, $$(D)))
$$(foreach T, $$(TARGETS) $$(LIB_TARGETS), \
$$(eval $$(call STD_TARGETS, $$(D), $$(T))))
$$(foreach T, $$(TARGETS), \
$$(eval $$(call PROGRAM_TARGETS, $$(D), $$(T))))
$$(foreach T, $$(LIB_TARGETS), \
$$(eval $$(call LIBRARY_TARGETS, $$(D), $$(T))))
$$(foreach T, $$(ACTIONS), \
$$(eval $$(call ACTION_TARGETS, $$(D), $$(T))))
TARGETS := $$(TARGETS:%=$$(D)/%)
TARGETS := $$(OLD_TARGETS) $$(TARGETS)
LIB_TARGETS := $$(LIB_TARGETS:%=$$(D)/%)
LIB_TARGETS := $$(OLD_LIB_TARGETS) $$(LIB_TARGETS)
ACTIONS := $$(ACTIONS:%=$$(D)/%)
ACTIONS := $$(OLD_ACTIONS) $$(ACTIONS)
SUBDIRS := $$(addprefix $$(D)/, $$(SUBDIRS))
$$(foreach DIR, $$(SUBDIRS),$$(eval $$(call INCLUDE_SUBMAKE, $$(DIR))))
D = $(1)
SUBDIRS := $$(OLD_SUBDIRS) $$(SUBDIRS)
OLD_SUBDIRS :=
endef
SUBMAKES = $(addsuffix /Makefile, $(SUBDIRS))
# First, build rules for the top-level directory
$(eval $(call DIR_TARGETS,.))
$(foreach T, $(TARGETS) $(LIB_TARGETS), $(eval $(call STD_TARGETS,.,$(T))))
$(foreach T, $(TARGETS), $(eval $(call PROGRAM_TARGETS,.,$(T))))
$(foreach T, $(LIB_TARGETS), $(eval $(call LIBRARY_TARGETS,.,$(T))))
$(foreach T, $(ACTIONS), $(eval $(call ACTION_TARGETS,.,$(T))))
# Make sure our Target Variables are set correctly (i.e. are preprended
# with a './'
TARGETS := $(TARGETS:%=./%)
LIB_TARGETS := $(LIB_TARGETS:%=./%)
ACTIONS := $(ACTIONS:%=./%)
# Now we walk each subdirectory's Makefile and do the same using a slightly
# more complicated macro
$(foreach DIR,$(SUBDIRS),$(eval $(call INCLUDE_SUBMAKE,$(strip $(DIR)))))
# Generate debug & coverage build target names from what we've already
# read/computed from the per-directory makefiles
DBG_TARGETS = $(TARGETS:%=%.debug)
DBG_LIB_TARGETS = $(LIB_TARGETS:%=%.debug)
COV_TARGETS = $(TARGETS:%=%.coverage)
COV_LIB_TARGETS = $(LIB_TARGETS:%=%.coverage)
.PHONY: $(ACTIONS)
#
# TARGETS - These are the main targets for the entire project
#
release: $(LIB_TARGETS) $(TARGETS)
debug: $(DBG_LIB_TARGETS) $(DBG_TARGETS)
coverage: $(COV_LIB_TARGETS) $(COV_TARGETS)
all: release debug coverage
coverage.info: coverage-check
lcov --quiet \
--no-external \
--capture \
--directory . \
--output-file $@
covreport: coverage.info
rm -rf coverage-report
BRANCH=$$(git rev-parse --abbrev-ref HEAD); \
CID=$$(git rev-parse --short=8 HEAD); \
genhtml $< --quiet \
--title "$$BRANCH branch; commit-id $$CID" \
--frames \
--show-details \
--demangle-cpp \
--legend \
--output-directory coverage-report \
--num-spaces=4 \
--rc=geninfo_gcov_all_blocks=1
chromium-browser coverage-report/index.html
docs: | $(DOCDIR)
$(DOCDIR): doc/Doxyfile $(shell find . -name '*.cc' -o -name '*.h')
rm -rf $@
$(Q)mkdir -p $@
doxygen doc/Doxyfile
tags:
ctags -R .
define SHOWACTIVE
cat $(1) | \
sed -e '/:$$/d' \
-e '/^$$/d' \
-e '/\\$$/ { H; d }' \
-e 'H; x' \
-e 's!\\\n!!g' \
-e 's!'$$(pwd -P)/'!!g' \
-e 's!^[^:]*:!!g' \
-e 's! \+! !g' \
-e 's!^ !!g' \
-e 's! $$!!g' \
-e 's! !\n!g' \
| sort -u
endef
.PHONY: showactive
showactive: $(DEPS)
$(call SHOWACTIVE, $^)
COLWIDTH=20
codecount: $(DEPS)
@/usr/bin/printf "%$(COLWIDTH)s % 7s % 7s % 7s\n" \
directory headers source total
@echo "---------------------------------------------------------"
@total=0; \
htotal=0; \
ctotal=0; \
for d in $$(dirname $$($(call SHOWACTIVE, $(DEPS))) | sort -u); do \
hcount=$$(find $$d -name '*.h' | \
xargs wc -l | tail -1 | sed -e 's/ *\([0-9]\+\) \+.*/\1/g') ;\
ccount=$$(find $$d -name '*.cc' -o -name '*.c' | \
xargs wc -l | tail -1 | sed -e 's/ *\([0-9]\+\) \+.*/\1/g') ;\
/usr/bin/printf "%$(COLWIDTH)s: %' 7d %' 7d %' 7d\n" \
$$d $$hcount $$ccount $$((hcount + ccount)); \
htotal=$$((htotal + hcount)) ; \
ctotal=$$((ctotal + ccount)) ; \
total=$$((total + hcount + ccount)) ; \
done; \
/usr/bin/printf "\n%$(COLWIDTH)s: %' 7d %' 7d %' 7d\n" \
"Dir Totals" $$htotal $$ctotal $$total
@for f in $$($(call SHOWACTIVE, $(DEPS))); do \
case $$f in \
(*.h) htotal=$$((htotal + $$(wc -l < $$f))) ;; \
(*.cc) ctotal=$$((ctotal + $$(wc -l < $$f))) ;; \
(*.c) ctotal=$$((ctotal + $$(wc -l < $$f))) ;; \
(*) htotal=$$((htotal + $$(wc -l < $$f))) ;; \
esac; \
done; \
/usr/bin/printf "\n%$(COLWIDTH)s: %' 7d %' 7d %' 7d\n" \
"Active Source" $$htotal $$ctotal $$((htotal + ctotal))
@h=$$(find . -name '*.h' | \
xargs wc -l | tail -1 | sed -e 's/total//g'); \
c=$$(find . -name '*.cc' -o -name '*.c' | \
xargs wc -l | tail -1 | sed -e 's/total//g'); \
/usr/bin/printf "%$(COLWIDTH)s: %' 7d %' 7d %' 7d\n" \
"All Source" $$h $$c $$((h + c))
@/usr/bin/printf "%$(COLWIDTH)s: %7s %7s %' 7d\n" "Makefiles" "" "" \
$$(find . -name 'Makefile*' \
| xargs wc -l | tail -1 | sed -e 's/total//g')
clean-cov:
@rm -rfv coverage.info coverage-report
@for dir in . $(SUBDIRS); do \
for f in $${dir}/$(OBJDIR)/*.{gcda,gcno} ; do \
if [ -f $$f ]; then rm -v $$f ; fi ; \
done ; \
done
clean: clean-cov
@for dir in . $(SUBDIRS); do \
rm -vrf $${dir}/$(OBJDIR) $${dir}/$(LIBDIR) $${dir}/$(BINDIR) \
$${dir}/*.info $${dir}/core $${dir}/core.[0123456789]* \
$${dir}/a.out; \
done
@rm -rf $(BINDIR) $(LIBDIR)
docclean:
@rm -rf $(DOCDIR)
realclean: clean docclean
@for dir in . $(SUBDIRS); do \
rm -vrf $${dir}/$(DEPDIR) $${dir}/.ycm_extra_conf.pyc \
$${dir}/config.cache tags $${dir}/coverage-report; \
done
print-targets:
@echo all release debug coverage \
$(strip $(TARGETS) $(LIB_TARGETS) $(ACTIONS)) | \
sed -e 's/ \+/\n\t/g' -e 's/^/\t/g' | sort
DBGDEPS := $(DEPS:%.d=%.debug.d)
COVDEPS := $(DEPS:%.d=%.coverage.d)
#
# There's no sense in making dependencies for targets if we aren't building
# them - this bit of stuff fixes all of that up
#
ifneq ($(strip $(findstring all,$(MAKECMDGOALS))),)
TMPDEPS += $(DEPS)
TMPDEPS += $(DBGDEPS)
TMPDEPS += $(COVDEPS)
endif
ifneq ($(strip $(findstring release,$(MAKECMDGOALS))),)
TMPDEPS += $(DEPS)
endif
ifneq ($(strip $(findstring debug,$(MAKECMDGOALS))),)
TMPDEPS += $(DBGDEPS)
endif
ifneq ($(strip $(findstring coverage,$(MAKECMDGOALS))),)
TMPDEPS += $(COVDEPS)
endif
ifdef TMPDEPS
DEPS := $(TMPDEPS)
endif
# optimization to avoid generating deps for targets that don't require them -
# there's no sense in building the dep files if we're execting a target
# without dependencies - XXX What can be added or should be removed from this
# list of targets?
NO_DEP_TARGETS = %clean clean% codecount tags print-targets
ifeq ($(strip $(filter $(NO_DEP_TARGETS), $(MAKECMDGOALS))),)
-include $(DEPS)
endif