I cam across the following command in a 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 this command generate no-symbols-control-file? What is the use of a no symbol image file?
                        
Piece by piece analysis:
The Makefile's target is:
%-nosyms.$(TARGET).elfThe list of prerequisites is:
%.co $(PROJECT_OBJECTFILES) $(INTERRUPT_OBJECTFILES) contiki-$(TARGET).aThe target recipe is:
Makefile's logic is:
If
*-nosyms.$(TARGET).elffile exists, compare the file's timestamp to that of all its pre-requisites. Rebuild this file (i.e., run the given recipe) if any of the pre-requisites is newer. If the target is marked as.PHONY) (seems not to be the case), rebuild without checking the timestamp.Else, go to each prerequisite recipe and execute one by one (or in parallel if
-joption provided tomake):%.co$(PROJECT_OBJECTFILES)$(INTERRUPT_OBJECTFILES)contiki-$(TARGET).aThen, handle the recipe for the current target, by calling:
$(CC) $(CFLAGS) -o $@ $(filter-out %.a,$^) $(filter %.a,$^) $(filter %.a,$^) $(LDFLAGS)Where:
$@: the name of the current target (i.e.*-nosyms.$(TARGET).elf)$^: The list of prerequisites (i.e.%.co $(PROJECT_OBJECTFILES) $(INTERRUPT_OBJECTFILES) contiki-$(TARGET).a)$(filter-out %.a,$^): the non-*.afiles from the prerequisite list.$(filter %.a,$^): the*.afiles from the prerequisite list.