 <p>Let's take an specific example and figure out what it does in the kernel 4.1, e.g. <code>IHEX</code>.</p> <p><strong>Find what a code does</strong></p> <p>Just run:</p> <pre><code>make SHELL='sh -x' </code></pre> <p>How that works: <a href="http://stackoverflow.com/a/32010960/895245">http://stackoverflow.com/a/32010960/895245</a></p> <p>If we grep the output for <code>IHEX</code>, we find the lines:</p> <pre><code>+ echo IHEX firmware/e100/d101s_ucode.bin IHEX firmware/e100/d101s_ucode.bin + objcopy -Iihex -Obinary /home/ciro/git/kernel/src/firmware/e100/d101s_ucode.bin.ihex firmware/e100/d101s_ucode.bin </code></pre> <p>so we conclude that <code>IHEX</code> does a <code>objcopy -Iihex</code>.</p> <p><strong>Find where a code is defined</strong></p> <p>Every kernel command must be defined with something like:</p> <pre><code>quiet_cmd_ihex = IHEX $@ cmd_ihex = $(OBJCOPY) -Iihex -Obinary $&lt; $@ $(obj)/%: $(obj)/%.ihex $(call cmd,ihex) </code></pre> <p>for the verbosity settings (e.g. <code>V=1</code> and <code>make -s</code>) to work.</p> <p>So in general, you just have to</p> <pre><code>git grep 'cmd.* = CODE' </code></pre> <p>to find <code>CODE</code>.</p> <p>I have explained in detail how this system works at: <a href="http://stackoverflow.com/a/32023861/895245">http://stackoverflow.com/a/32023861/895245</a></p> <p><strong>Get the list of all codes</strong></p> <pre><code>make | grep -E '^ ' | sort -uk1,1 </code></pre> <p><strong>CC and CC [M]</strong></p> <p>Defined in <code>scripts/Makefile.build</code>:</p> <pre><code>quiet_cmd_cc_o_c = CC $(quiet_modtag) $@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $&lt; </code></pre> <p>and the <code>[M]</code> comes from the <a href="http://stackoverflow.com/questions/32023711/what-is-the-meaning-of-a-variable-defined-on-the-same-line-of-a-rule-targets-pre">target specific variables</a>:</p> <pre><code>$(real-objs-m) : quiet_modtag := [M] $(real-objs-m:.o=.i) : quiet_modtag := [M] $(real-objs-m:.o=.s) : quiet_modtag := [M] $(real-objs-m:.o=.lst): quiet_modtag := [M] $(obj-m) : quiet_modtag := [M] </code></pre> <p>It is then called through:</p> <pre><code>$(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE [...] $(call if_changed_rule,cc_o_c) define rule_cc_o_c [...] $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ </code></pre> <p>where <code>if_changed_rule</code> is defined in <code>scripts/Kbuild.include</code> as:</p> <pre><code>if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \ @set -e; \ $(rule_$(1))) </code></pre> <p>and <code>Kbuild.include</code> gets included on the top level Makefile.</p> <p><strong>LD</strong></p> <p>There are a few versions, but the simplest seems to be:</p> <pre><code>quiet_cmd_link_o_target = LD $@ cmd_link_o_target = $(if $(strip $(obj-y)),\ $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ $(cmd_secanalysis),\ rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@) $(builtin-target): $(obj-y) FORCE $(call if_changed,link_o_target) </code></pre> <p>and in <code>scripts/Kbuild.include</code>:</p> <pre><code># Execute command if command has changed or prerequisite(s) are updated. # if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ @set -e; \ $(echo-cmd) $(cmd_$(1)); \ printf '%s\n' 'cmd_$@ := $(make-cmd)' &gt; $(dot-target).cmd) </code></pre>