gnu make - What does the following makefile command do? /no-symbols-control-file -


i cam across following command in makefile:

%-nosyms.$(target).elf: %.co $(project_objectfiles) $(interrupt_objectfiles) contiki-$(target).a $(cc) $(cflags) -o $@ $(filter-out %.a,$^) $(filter %.a,$^) $(filter %.a,$^) $(ldflags) 

source: contiki/cpu/arm/stm32f103/makefile.stm32f103 .

does command generate no-symbols-control-file? use of no symbol image file?

piece piece analysis:

the makefile's target is:

%-nosyms.$(target).elf

the list of prerequisites is:

%.co $(project_objectfiles) $(interrupt_objectfiles) contiki-$(target).a

the target recipe is:

$(cc) $(cflags) -o $@ $(filter-out %.a,$^) $(filter %.a,$^) $(filter %.a,$^) $(ldflags) 

makefile's logic is:

  1. if *-nosyms.$(target).elf file exists, compare file's timestamp of all pre-requisites. rebuild file (i.e., run given recipe) if of pre-requisites newer. if target marked .phony) (seems not case), rebuild without checking timestamp.

  2. else, go each prerequisite recipe , execute 1 one (or in parallel if -j option provided make):

    • %.co
    • $(project_objectfiles)
    • $(interrupt_objectfiles)
    • contiki-$(target).a
  3. then, handle recipe current target, calling:

$(cc) $(cflags) -o $@ $(filter-out %.a,$^) $(filter %.a,$^) $(filter %.a,$^) $(ldflags)

where:

  • $@: name of current target (i.e. *-nosyms.$(target).elf)
  • $^: list of prerequisites (i.e. %.co $(project_objectfiles) $(interrupt_objectfiles) contiki-$(target).a)
  • $(filter-out %.a,$^): non-*.a files prerequisite list.
  • $(filter %.a,$^): *.a files prerequisite list.

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -