after compile cleanup? winavr

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey I have a question, in the make file we have:

	$(REMOVE) $(TARGET).hex
	$(REMOVE) $(TARGET).eep
	$(REMOVE) $(TARGET).obj
	$(REMOVE) $(TARGET).cof
	$(REMOVE) $(TARGET).elf
	$(REMOVE) $(TARGET).map
	$(REMOVE) $(TARGET).obj
	$(REMOVE) $(TARGET).a90
	$(REMOVE) $(TARGET).sym
	$(REMOVE) $(TARGET).lnk
	$(REMOVE) $(TARGET).lss
	$(REMOVE) $(OBJ)
	$(REMOVE) $(LST)
	$(REMOVE) $(SRC:.c=.s)
	$(REMOVE) $(SRC:.c=.d)
	$(REMOVE) *~

but after the compile and upload we still have:

d
elf
lst
map
o

hex

left in our dir? is there a way to make it remove everything, except of course the source files, after we click make? cause when you have alot of other .c files included that dir becomes large fast, and I just dont like i, sometimes the .elf file messes up new compiles.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ELF file contains debugging data, and shouldn't be deleted - you need it to debug your C code with AVRStudio.

The LST/MAP files contain compile information. You might need to look at those in the future.

The .d and .o files are the compiled object files. Deleting them means that each time you re-compile your program every module has to be re-compiled, not just the ones that have changed.

The latest WinAVR's makefile allows you to place the .d/.o files in a separate subdirectory.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Assuming you want to make "make clean" remove *everything*, you could just add the following lines to the clean list:

 $(REMOVE) $(TARGET).elf
   $(REMOVE) $(TARGET).hex
   $(REMOVE) $(TARGET).lst
   $(REMOVE) $(TARGET).lss
   $(REMOVE) $(TARGET).map
   $(REMOVE) $(SRC:.c=.d)
   $(REMOVE) $(SRC:.c=.o)

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

oh how can I made those files in a differnt dir now? that would be nicer then just removing them. but still I very rarely if ever debug my app or look threw the created files, it would be nice to be able to choose when I want too, you know what I mean? is it possible to have make launch anouther app after everything is done? cause if so I could just make a batch file or make somthin in c# or vb todo it.

edit:btw your articles kick ass, if you ask me they should be in the avrfreaks article section, the eeprom one got me threw a few times :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Update your WinAVR installation to the 2007 version, then change your makefile over to the included new template - that's the easiest method.

You can make your makefile execute a batch file, but you shouldn't. Moving the files just means the makefile won't be able to use them next time around, rendering them useless. Best to use the new makefile which is designed to handle multiple directories.

- Dean :twisted:

PS: Cheers for the compliment ;)

Make Atmel Studio better with my free extensions. Open source and feedback welcome!