Guest User

Untitled

a guest
Jul 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. DEVICE = atmega32 #90s2313
  2. AVRDUDE = avrdude -c usbasp -p $(DEVICE)
  3. # Choose your favorite programmer and interface above.
  4.  
  5. COMPILE = avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=$(DEVICE) #-DDEBUG_LEVEL=2
  6. # NEVER compile the final product with debugging! Any debug output will
  7. # distort timing so that the specs can't be met.
  8.  
  9. OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
  10.  
  11. # symbolic targets:
  12. all: main.hex
  13.  
  14. .c.o:
  15. $(COMPILE) -c $< -o $@
  16.  
  17. .S.o:
  18. $(COMPILE) -x assembler-with-cpp -c $< -o $@
  19. # "-x assembler-with-cpp" should not be necessary since this is the default
  20. # file type for the .S (with capital S) extension. However, upper case
  21. # characters are not always preserved on Windows. To ensure WinAVR
  22. # compatibility define the file type manually.
  23.  
  24. .c.s:
  25. $(COMPILE) -S $< -o $@
  26.  
  27. flash: all
  28. $(AVRDUDE) -U flash:w:main.hex:i
  29.  
  30. fuse_tiny2313: # only needed for attiny2313
  31. $(AVRDUDE) -U hfuse:w:0xdb:m -U lfuse:w:0xef:m
  32. clean:
  33. rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s
  34.  
  35. # file targets:
  36. main.bin: $(OBJECTS)
  37. $(COMPILE) -o main.bin $(OBJECTS)
  38.  
  39. main.hex: main.bin
  40. rm -f main.hex main.eep.hex
  41. avr-objcopy -j .text -j .data -O ihex main.bin main.hex
  42. ./checksize main.bin
  43. # do the checksize script as our last action to allow successful compilation
  44. # on Windows with WinAVR where the Unix commands will fail.
  45.  
  46. disasm: main.bin
  47. avr-objdump -d main.bin
  48.  
  49. cpp:
  50. $(COMPILE) -E main.c
Add Comment
Please, Sign In to add comment