[En-Nut-Discussion] Makefile .elf removal

Don Ingram don at led.com.au
Mon Jul 17 23:17:58 CEST 2006


Harald Kipp wrote:
> 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
>
Thanks Harald,

Greatly appreciated.

Finally bit the bullet & bought the O'Reilly book ( Can't find the movie ;-)

Cheers

Don



More information about the En-Nut-Discussion mailing list