1 # boilermake: A reusable, but flexible, boilerplate Makefile.
3 # Copyright 2008, 2009, 2010 Dan Moulding, Alan T. DeKok
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Caution: Don't edit this Makefile! Create your own main.mk and other
19 # submakefiles, which will be included by this Makefile.
20 # Only edit this if you need to modify boilermake's behavior (fix
21 # bugs, add features, etc).
23 # Note: Parameterized "functions" in this makefile that are marked with
24 # "USE WITH EVAL" are only useful in conjuction with eval. This is
25 # because those functions result in a block of Makefile syntax that must
26 # be evaluated after expansion. Since they must be used with eval, most
27 # instances of "$" within them need to be escaped with a second "$" to
28 # accomodate the double expansion that occurs when eval is invoked.
31 # You can watch what it's doing by:
33 # $ VERBOSE=1 make ... args ...
41 # ADD_CLEAN_RULE - Parameterized "function" that adds a new rule and phony
42 # target for cleaning the specified target (removing its build-generated
48 clean: clean_$(notdir ${1})
49 .PHONY: clean_$(notdir ${1})
51 $(Q)$(strip rm -f ${${1}_BUILD}/${1} $${${1}_OBJS} $${${1}_DEPS} $${${1}_OBJS:%.${OBJ_EXT}=%.[do]}) $(if ${TARGET_DIR},$${TARGET_DIR}/$(notdir ${1}))
56 # FILTER_DEPENDS: function to turn a *.d file into a *.mk file.
57 # We start off with the dependencies as created by the compiler,
58 # CPP, or makedepend. We then ensure that there is an empty dependency
59 # for each header file. The blank target ensures that the build
60 # can proceed even if the header file has been deleted.
64 # remove dependencies on global include files
65 # remove empty dependencies
66 # remove CPP hacks like "foo: <built-in>"
68 # 1) Filter the .d file to remove unnecessary cruft
71 # Replace ".o" with "${OBJ_EXT}"
72 # delete empty continuation lines
74 # replace "build/" with "${BUILD_DIR}/" when it's at the start of a line
75 # delete references to ${BUILD_DIR}/make/include, the "config.mk"
76 # file adds these dependencies automatically.
77 # replace "build/" with "${BUILD_DIR}/" when it's in the middle of a line
79 # remove sequential duplicate lines
81 # 2) Create empty dependencies from the files
84 # remove existing targets
85 # remove continuations (to make the targets stand by themselves)
87 # add in empty dependency for each file.
88 # remove sequential duplicate lines
91 $(Q)mkdir -p $$(dir $${BUILD_DIR}/make/src/$$*)
92 $(Q)mkdir -p $$(dir $${BUILD_DIR}/objs/$$*)
93 $(Q)sed -e 's/#.*//' \
94 -e 's,^$${top_srcdir},$$$${top_srcdir},' \
95 -e 's, $${top_srcdir}, $$$${top_srcdir},' \
96 -e 's,^$${BUILD_DIR},$$$${BUILD_DIR},' \
97 -e 's, $${BUILD_DIR}/make/include/[^ :]*,,' \
98 -e 's, $${BUILD_DIR}, $$$${BUILD_DIR},' \
100 -e 's,^ *[^:]* *: *$$$$,,' \
102 -e 's/\.o: /.$$$${OBJ_EXT}: /' \
104 < $${BUILD_DIR}/objs/$$*.d | sed -e '$$$$!N; /^\(.*\)\n\1$$$$/!P; D' \
105 > $${BUILD_DIR}/make/src/$$*.mk
106 $(Q)sed -e 's/#.*//' \
107 -e 's, $${BUILD_DIR}/make/include/[^ :]*,,' \
109 -e 's,^ *[^:]* *: *$$$$,,' \
114 < $${BUILD_DIR}/objs/$$*.d | sed -e '$$$$!N; /^\(.*\)\n\1$$$$/!P; D' \
115 >> $${BUILD_DIR}/make/src/$$*.mk
116 @rm -f $${BUILD_DIR}/objs/$$*.d
119 # ADD_OBJECT_RULE - Parameterized "function" that adds a pattern rule, using
120 # the commands from the second argument, for building object files from
121 # source files with the filename extension specified in the first argument.
123 # This function assumes that the C/C++ sources files have filenames
124 # *relative* to the source root. If they have absolute pathnames, it
125 # creates the wrong filenames...
129 ifeq "${CPP_MAKEDEPEND}" "yes"
130 define ADD_OBJECT_RULE
131 $${BUILD_DIR}/objs/%.${OBJ_EXT} $${BUILD_DIR}/objs/%.d: ${1} ${JLIBTOOL}
133 $${CPP} $${CPPFLAGS} $$(addprefix -I,$${SRC_INCDIRS}) $${SRC_DEFS} $$< | sed \
134 -n 's,^\# *[0-9][0-9]* *"\([^"]*\)".*,$$@: \1,p' > $${BUILD_DIR}/objs/$$*.d
139 define ADD_OBJECT_RULE
140 $${BUILD_DIR}/objs/%.${OBJ_EXT} $${BUILD_DIR}/objs/%.d: ${1} ${JLIBTOOL}
146 define ADD_ANALYZE_RULE
147 $${BUILD_DIR}/plist/%.plist: ${1} ${JLIBTOOL}
151 # ADD_TARGET_DIR - Parameterized "function" that makes a link from
152 # TARGET_DIR to the executable or library in the BUILD_DIR directory.
156 ifneq "${TARGET_DIR}" ""
157 define ADD_TARGET_DIR
158 all: $${TARGET_DIR}/$$(notdir ${1})
160 $${TARGET_DIR}/$$(notdir ${1}): ${1}
161 [ -f $${TARGET_DIR}/$$(notdir ${1}) ] || ln -s ${1} $${TARGET_DIR}/$$(notdir ${1})
166 # ADD_TARGET_TO_ALL - Parameterized "function" that adds the target,
167 # and makes "all" depend on it.
171 define ADD_TARGET_TO_ALL
176 # ADD_TARGET_RULE.* - Parameterized "functions" that adds a new target to the
177 # Makefile. There should be one ADD_TARGET_RULE definition for each
178 # type of target that is used in the build.
180 # New rules can be added by copying one of the existing ones, and
181 # replacing the line after the "mkdir"
184 # ADD_TARGET_RULE.exe - Build an executable target.
188 define ADD_TARGET_RULE.exe
189 # So "make ${1}" works
191 ${1}: $${${1}_BUILD}/${1}
193 # Create executable ${1}
194 $${${1}_BUILD}/${1}: $${${1}_OBJS} $${${1}_PRBIN} $${${1}_PRLIBS}
195 $(Q)$(strip mkdir -p $(dir $${${1}_BUILD}/${1}))
196 $(Q)$(ECHO) LINK $${${1}_BUILD}/${1}
197 $(Q)$${${1}_LINKER} -o $${${1}_BUILD}/${1} $${RPATH_FLAGS} $${LDFLAGS} \
198 $${${1}_LDFLAGS} $${${1}_OBJS} $${${1}_PRLIBS} \
199 $${LDLIBS} $${${1}_LDLIBS}
200 $(Q)$${${1}_POSTMAKE}
202 ifneq "${ANALYZE.c}" ""
203 scan.${1}: $${${1}_PLISTS}
207 # ADD_TARGET_RULE.a - Build a static library target.
211 define ADD_TARGET_RULE.a
212 # So "make ${1}" works
214 ${1}: $${${1}_BUILD}/${1}
216 # Create static library ${1}
217 $${${1}_BUILD}/${1}: $${${1}_OBJS} $${${1}_PRLIBS}
218 $(Q)$(strip mkdir -p $(dir $${${1}_BUILD}/${1}))
219 $(Q)$(ECHO) LINK $${${1}_BUILD}/${1}
220 $(Q)$${AR} $${ARFLAGS} $${${1}_BUILD}/${1} $${${1}_OBJS}
221 $(Q)$${${1}_POSTMAKE}
223 ifneq "${ANALYZE.c}" ""
224 scan.${1}: $${${1}_PLISTS}
228 # ADD_TARGET_RULE.so - Build a ".so" target.
232 define ADD_TARGET_RULE.so
233 $(error Please add rules to build a ".so" file.)
236 # ADD_TARGET_RULE.dll - Build a ".dll" target.
240 define ADD_TARGET_RULE.dll
241 $(error Please add rules to build a ".dll" file.)
244 # ADD_TARGET_RULE.dylib - Build a ".dylib" target.
248 define ADD_TARGET_RULE.dylib
249 $(error Please add rules to build a ".dylib" file.)
252 # CANONICAL_PATH - Given one or more paths, converts the paths to the canonical
253 # form. The canonical form is the path, relative to the project's top-level
254 # directory (the directory from which "make" is run), and without
255 # any "./" or "../" sequences. For paths that are not located below the
256 # top-level directory, the canonical form is the absolute path (i.e. from
257 # the root of the filesystem) also without "./" or "../" sequences.
258 define CANONICAL_PATH
259 $(patsubst ${CURDIR}/%,%,$(abspath ${1}))
262 # COMPILE_C_CMDS - Commands for compiling C source code.
263 ifeq "$(CPPCHECK)" ""
264 define COMPILE_C_CMDS
265 $(Q)mkdir -p $(dir $@)
267 $(Q)$(strip ${COMPILE.c} -o $@ -c -MD ${CPPFLAGS} ${CFLAGS} ${SRC_CFLAGS} ${INCDIRS} \
268 $(addprefix -I, ${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} $<)
272 # do cppcheck AND compilation, so that we have correct dependencies
273 # Suppress variable scope warnings for now. They're style, and don't really
276 define COMPILE_C_CMDS
277 $(Q)mkdir -p $(dir $@)
279 $(Q)$(strip ${COMPILE.c} -o $@ -c -MD ${CPPFLAGS} ${CFLAGS} ${SRC_CFLAGS} ${INCDIRS} \
280 $(addprefix -I,${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} $<)
281 $(Q)cppcheck --enable=style -q ${CHECKFLAGS} $(filter -isystem%,${SRC_CFLAGS}) \
282 $(filter -I%,${SRC_CFLAGS}) $(filter -D%,${SRC_CFLAGS}) ${INCDIRS} \
283 $(addprefix -I,${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} --suppress=variableScope --suppress=invalidscanf $<
287 # ANALYZE_C_CMDS - Commands for analyzing C source code with clang.
288 define ANALYZE_C_CMDS
289 $(Q)mkdir -p $(dir $@)
291 $(Q)$(strip ${ANALYZE.c} --analyze -Xanalyzer -analyzer-output=html -c $< -o $@ ${CPPFLAGS} \
292 ${CFLAGS} ${SRC_CFLAGS} ${INCDIRS} $(addprefix -I,${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS}) || (rm -f $@ && false)
296 # COMPILE_CXX_CMDS - Commands for compiling C++ source code.
297 define COMPILE_CXX_CMDS
298 $(Q)mkdir -p $(dir $@)
299 $(Q)$(strip ${COMPILE.cxx} -o $@ -c -MD ${CPPFLAGS} ${CXXFLAGS} ${SRC_CXXFLAGS} ${INCDIRS} \
300 $(addprefix -I,${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} $<)
303 # INCLUDE_SUBMAKEFILE - Parameterized "function" that includes a new
304 # "submakefile" fragment into the overall Makefile. It also recursively
305 # includes all submakefiles of the specified submakefile fragment.
309 define INCLUDE_SUBMAKEFILE
310 # Initialize all variables that can be defined by a makefile fragment, then
311 # include the specified makefile fragment.
333 # A directory stack is maintained so that the correct paths are used as we
334 # recursively include all submakefiles. Get the makefile's directory and
335 # push it onto the stack.
336 DIR := $(call CANONICAL_PATH,$(dir ${1}))
337 DIR_STACK := $$(call PUSH,$${DIR_STACK},$${DIR})
341 # Initialize internal local variables.
344 # Determine which target this makefile's variables apply to. A stack is
345 # used to keep track of which target is the "current" target as we
346 # recursively include other submakefiles.
347 ifneq "$$(strip $${TARGET})" ""
348 # This makefile defined a new target. Target variables defined by this
349 # makefile apply to this new target. Initialize the target's variables.
351 # libs go into ${BUILD_DIR}/lib
352 # everything else goes into ${BUILD_DIR}/bin
353 # TGT := $$(strip $$(if $$(suffix $${TARGET}),$${BUILD_DIR}/lib,$${BUILD_DIR}/bin)/$${TARGET})
356 # A "hook" to rewrite "libfoo.a" -> "libfoo.la" when using libtool
357 $$(eval $$(call ADD_LIBTOOL_SUFFIX))
360 $${TGT}_LDFLAGS := $${TGT_LDFLAGS}
361 $${TGT}_LDLIBS := $${TGT_LDLIBS}
362 $${TGT}_LINKER := $${TGT_LINKER}
363 $${TGT}_POSTMAKE := $${TGT_POSTMAKE}
364 $${TGT}_POSTCLEAN := $${TGT_POSTCLEAN}
365 $${TGT}_POSTINSTALL := $${TGT_POSTINSTALL}
366 $${TGT}_PREREQS := $${TGT_PREREQS}
367 $${TGT}_PRBIN := $$(addprefix $${BUILD_DIR}/bin/,$$(filter-out %.a %.so %.la,$${TGT_PREREQS}))
368 $${TGT}_PRLIBS := $$(addprefix $${BUILD_DIR}/lib/,$$(filter %.a %.so %.la,$${TGT_PREREQS}))
372 $${TGT}_MAN := $${MAN}
373 $${TGT}_SUFFIX := $$(if $$(suffix $${TGT}),$$(suffix $${TGT}),.exe)
375 # If it's an EXE, ensure that transitive library linking works.
376 # i.e. we build libfoo.a which in turn requires -lbar. So, the executable
377 # has to be linked to both libfoo.a and -lbar.
378 ifeq "$${$${TGT}_SUFFIX}" ".exe"
379 $${TGT}_LDLIBS += $$(filter-out %.a %.so %.la,$${$${TGT_PREREQS}_LDLIBS})
382 $${TGT}_BUILD := $$(if $$(suffix $${TGT}),$${BUILD_DIR}/lib,$${BUILD_DIR}/bin)
383 $${TGT}_MAKEFILES += ${1}
384 $${TGT}_CHECK_HEADERS := $${TGT_CHECK_HEADERS}
385 $${TGT}_CHECK_LIBS := $${TGT_CHECK_LIBS}
387 # The values defined by this makefile apply to the the "current" target
388 # as determined by which target is at the top of the stack.
389 TGT := $$(strip $$(call PEEK,$${TGT_STACK}))
390 $${TGT}_LDFLAGS += $${TGT_LDFLAGS}
391 $${TGT}_LDLIBS += $${TGT_LDLIBS}
392 $${TGT}_POSTCLEAN += $${TGT_POSTCLEAN}
393 $${TGT}_POSTMAKE += $${TGT_POSTMAKE}
394 $${TGT}_PREREQS += $${TGT_PREREQS}
397 # Push the current target onto the target stack.
398 TGT_STACK := $$(call PUSH,$${TGT_STACK},$${TGT})
400 # If there's no target, don't build the sources.
401 ifneq "$$(strip $${TARGET})" ""
403 # if there's no sources, don't do the automatic object build
404 ifneq "$$(strip $${SOURCES})" ""
405 # This makefile builds one or more objects from source. Validate the
406 # specified sources against the supported source file types.
407 BAD_SRCS := $$(strip $$(filter-out $${ALL_SRC_EXTS},$${SOURCES}))
408 ifneq "$${BAD_SRCS}" ""
409 $$(error Unsupported source file(s) found in ${1} [$${BAD_SRCS}])
412 # Qualify and canonicalize paths.
413 SOURCES := $$(call QUALIFY_PATH,$${DIR},$${SOURCES})
414 SOURCES := $$(call CANONICAL_PATH,$${SOURCES})
415 SRC_INCDIRS := $$(call QUALIFY_PATH,$${DIR},$${SRC_INCDIRS})
416 SRC_INCDIRS := $$(call CANONICAL_PATH,$${SRC_INCDIRS})
418 # Save the list of source files for this target.
419 $${TGT}_SOURCES += $${SOURCES}
421 # Convert the source file names to their corresponding object file
423 OBJS := $$(addprefix $${BUILD_DIR}/objs/,\
424 $$(addsuffix .${OBJ_EXT},$$(basename $${SOURCES})))
426 PLISTS := $$(addprefix $${BUILD_DIR}/plist/,\
427 $$(addsuffix .plist,$$(basename $${SOURCES})))
428 ALL_PLISTS += ${PLISTS}
430 # Add the objects to the current target's list of objects, and create
431 # target-specific variables for the objects based on any source
432 # variables that were defined.
433 $${TGT}_OBJS += $${OBJS}
434 $${TGT}_PLISTS += $${PLISTS}
435 $${TGT}_DEPS += $$(addprefix $${BUILD_DIR}/make/src/,\
436 $$(addsuffix .mk,$$(basename $${SOURCES})))
438 # A "hook" to define variables needed by the "legacy" makefiles.
439 $$(eval $$(call ADD_LEGACY_VARIABLES,$$(dir ${1}),$${TGT}))
441 $${OBJS}: SRC_CFLAGS := $${SRC_CFLAGS}
442 $${OBJS}: SRC_CXXFLAGS := $${SRC_CXXFLAGS}
443 $${OBJS}: SRC_DEFS := $$(addprefix -D,$${SRC_DEFS})
444 $${OBJS}: SRC_INCDIRS := $${SRC_INCDIRS}
447 $${PLISTS}: SRC_CFLAGS := $${SRC_CFLAGS}
448 $${PLISTS}: SRC_CXXFLAGS := $${SRC_CXXFLAGS}
449 $${PLISTS}: SRC_DEFS := $$(addprefix -D,$${SRC_DEFS})
450 $${PLISTS}: SRC_INCDIRS := $${SRC_INCDIRS}
455 ifneq "$$(strip $${SUBMAKEFILES})" ""
456 # This makefile has submakefiles. Recursively include them.
457 $$(foreach MK,$${SUBMAKEFILES},\
458 $$(eval $$(call INCLUDE_SUBMAKEFILE,\
459 $$(call CANONICAL_PATH,\
460 $$(call QUALIFY_PATH,$${DIR},$${MK})))))
463 # Reset the "current" target to it's previous value.
464 TGT_STACK := $$(call POP,$${TGT_STACK})
465 # If we're about to change targets, create the rules for the target
466 ifneq "$${TGT}" "$$(call PEEK,$${TGT_STACK})"
467 # add rules to build the target, and have "all" depend on it.
468 $$(eval $$(call ADD_TARGET_TO_ALL,$${TGT}))
470 # A "hook" to add rules for ${TARGET_DIR}/foo, if TARGET_DIR
471 # is defined. Otherwise, we leave the source directory untouched.
472 $$(eval $$(call ADD_TARGET_DIR,$${TGT}))
474 # A "hook" to build the libtool target.
475 $$(eval $$(call ADD_LIBTOOL_TARGET))
477 # Choose the correct linker.
478 ifeq "$$(strip $$(filter $${CXX_SRC_EXTS},$${$${TGT}_SOURCES}))" ""
479 ifeq "$${$${TGT}_LINKER}" ""
480 $${TGT}_LINKER := ${LL}$${LINK.c}
483 ifeq "$${$${TGT}_LINKER}" ""
484 $${TGT}_LINKER := ${LL}$${LINK.cxx}
488 # add rules to build the target
489 $$(eval $$(call ADD_TARGET_RULE$${$${TGT}_SUFFIX},$${TGT}))
491 # generate the clean rule for this target.
492 $$(eval $$(call ADD_CLEAN_RULE,$${TGT}))
494 # Hook to add an installation target
495 $$(eval $$(call ADD_INSTALL_TARGET,$${TGT}))
497 # Hook to add a configuration target
498 $$(eval $$(call ADD_TARGET_CONFIG,$${TGT}))
500 # "hook" for legacy Makefiles
501 $$(eval $$(call ADD_LEGACY_RULE,$${TGT}))
504 TGT := $$(call PEEK,$${TGT_STACK})
506 # Reset the "current" directory to it's previous value.
507 DIR_STACK := $$(call POP,$${DIR_STACK})
508 DIR := $$(call PEEK,$${DIR_STACK})
511 # MIN - Parameterized "function" that results in the minimum lexical value of
512 # the two values given.
514 $(firstword $(sort ${1} ${2}))
517 # PEEK - Parameterized "function" that results in the value at the top of the
518 # specified colon-delimited stack.
520 $(lastword $(subst :, ,${1}))
523 # POP - Parameterized "function" that pops the top value off of the specified
524 # colon-delimited stack, and results in the new value of the stack. Note that
525 # the popped value cannot be obtained using this function; use peek for that.
527 ${1:%:$(lastword $(subst :, ,${1}))=%}
530 # PUSH - Parameterized "function" that pushes a value onto the specified colon-
531 # delimited stack, and results in the new value of the stack.
536 # QUALIFY_PATH - Given a "root" directory and one or more paths, qualifies the
537 # paths using the "root" directory (i.e. appends the root directory name to
538 # the paths) except for paths that are absolute.
540 $(addprefix ${1}/,$(filter-out /%,${2})) $(filter /%,${2})
543 ###############################################################################
545 # Start of Makefile Evaluation
547 ###############################################################################
549 # Older versions of GNU Make lack capabilities needed by boilermake.
550 # With older versions, "make" may simply output "nothing to do", likely leading
551 # to confusion. To avoid this, check the version of GNU make up-front and
552 # inform the user if their version of make doesn't meet the minimum required.
553 MIN_MAKE_VERSION := 3.81
554 MIN_MAKE_VER_MSG := boilermake requires GNU Make ${MIN_MAKE_VERSION} or greater
555 ifeq "${MAKE_VERSION}" ""
556 $(info GNU Make not detected)
557 $(error ${MIN_MAKE_VER_MSG})
559 ifneq "${MIN_MAKE_VERSION}" "$(call MIN,${MIN_MAKE_VERSION},${MAKE_VERSION})"
560 $(info This is GNU Make version ${MAKE_VERSION})
561 $(error ${MIN_MAKE_VER_MSG})
564 # Define the source file extensions that we know how to handle.
567 CXX_SRC_EXTS := %.C %.cc %.cp %.cpp %.CPP %.cxx %.c++
568 ALL_SRC_EXTS := ${C_SRC_EXTS} ${CXX_SRC_EXTS}
570 # Initialize global variables.
577 ifeq "${top_builddir}" ""
581 # Ensure that valid values are set for BUILD_DIR
582 ifeq "$(strip ${BUILD_DIR})" ""
583 ifeq "${top_builddir}" "${PWD}"
586 BUILD_DIR := ${top_builddir}/build
589 BUILD_DIR := $(call CANONICAL_PATH,${BUILD_DIR})
592 # Define compilers and linkers
600 # Set ECHO to "true" for *very* quiet builds
603 # Define the "all" target (which simply builds all user-defined targets) as the
608 # Add "clean" rules to remove all build-generated files.
612 top_makedir := $(dir $(lastword ${MAKEFILE_LIST}))
614 -include ${top_makedir}/install.mk
615 -include ${top_makedir}/libtool.mk
617 ifneq "${CPPCHECK}" ""
618 CHECKFLAGS := -DCPPCHECK $(filter -isystem%,$(CPPFLAGS) $(CFLAGS)) $(filter -I%,$(CPPFLAGS) $(CFLAGS)) $(filter -D%,$(CPPFLAGS) $(CFLAGS))
621 # Include the main user-supplied submakefile. This also recursively includes
622 # all other user-supplied submakefiles.
623 $(eval $(call INCLUDE_SUBMAKEFILE,${top_builddir}/main.mk))
625 # Perform post-processing on global variables as needed.
626 DEFS := $(addprefix -D,${DEFS})
627 INCDIRS := $(addprefix -I,$(call CANONICAL_PATH,${INCDIRS}))
629 # Add pattern rule(s) for creating compiled object code from C source.
630 $(foreach EXT,${C_SRC_EXTS},\
631 $(eval $(call ADD_OBJECT_RULE,${EXT},$${COMPILE_C_CMDS})))
633 ifneq "${ANALYZE.c}" ""
634 $(foreach EXT,${C_SRC_EXTS},\
635 $(eval $(call ADD_ANALYZE_RULE,${EXT},$${ANALYZE_C_CMDS})))
638 # Add pattern rule(s) for creating compiled object code from C++ source.
639 $(foreach EXT,${CXX_SRC_EXTS},\
640 $(eval $(call ADD_OBJECT_RULE,${EXT},$${COMPILE_CXX_CMDS})))
642 # Don't include the target dependencies if we're doing a "make clean"
643 # Future: have a list of targets that don't require dependency generation,
644 # and see if MAKECMDGOALS is one of them.
645 ifneq "$(MAKECMDGOALS)" "clean"
646 $(foreach TGT,${ALL_TGTS},\
647 $(eval -include ${${TGT}_DEPS}))
654 $(Q)rm -rf ${ALL_PLISTS}