[En-Nut-Discussion] Makefile .elf removal

Harald Kipp harald.kipp at egnite.de
Mon Jul 17 19:03:10 CEST 2006


At 17:47 16.07.2006 +1000, Don Ingram wrote:

>Built it with .elf specified as one of the outputs & all is well.  What 
>baffles me is why the .elf file was being deleted but no matter. Have .elf 
>will travel

make automatically removes all intermediate files.

If you look to the Makefile, you'll see that .hex and .o
are specified targets:

   OBJS =  $(SRCS:.c=.o)
   TARG =  $(PROJ).hex

   all: $(OBJS) $(TARG) <---- Targets for all

According to Makerules:

   Specified target .hex requires unspecified target .elf
   Unspecified target .elf requires specified targets .o

Thus .elf will be removed, after .hex had been build.

Extending the target list for 'all' will keep .elf

   all: $(OBJS) $(TARG) $(PROJ).elf

Harald




More information about the En-Nut-Discussion mailing list