AVR based 8-channel DMX dimmer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.5KB

  1. PRG = dmx8chan
  2. OBJ = dmx8chan.o
  3. MCU_TARGET = at90s2313
  4. OPTIMIZE = -Os
  5. DEFS =
  6. LIBS =
  7. # You should not have to change anything below here.
  8. CC = avr-gcc
  9. # Override is only needed by avr-lib build system.
  10. override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS)
  11. override LDFLAGS = -Wl,-Map,$(PRG).map
  12. OBJCOPY = avr-objcopy
  13. OBJDUMP = avr-objdump
  14. SIZE = avr-size
  15. all: $(PRG).elf lst text eeprom
  16. $(SIZE) -x -A $(PRG).elf
  17. $(PRG).elf: $(OBJ)
  18. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
  19. clean:
  20. rm -rf *.o *.lst *.map $(PRG).elf *.hex *.bin *.srec
  21. lst: $(PRG).lst
  22. %.lst: %.elf
  23. $(OBJDUMP) -h -S $< > $@
  24. # Rules for building the .text rom images
  25. text: hex bin srec
  26. hex: $(PRG).hex
  27. bin: $(PRG).bin
  28. srec: $(PRG).srec
  29. %.hex: %.elf
  30. $(OBJCOPY) -j .text -j .data -O ihex $< $@
  31. %.srec: %.elf
  32. $(OBJCOPY) -j .text -j .data -O srec $< $@
  33. %.bin: %.elf
  34. $(OBJCOPY) -j .text -j .data -O binary $< $@
  35. # Rules for building the .eeprom rom images
  36. eeprom: ehex ebin esrec
  37. ehex: $(PRG)_eeprom.hex
  38. ebin: $(PRG)_eeprom.bin
  39. esrec: $(PRG)_eeprom.srec
  40. %_eeprom.hex: %.elf
  41. $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@
  42. %_eeprom.srec: %.elf
  43. $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O srec $< $@
  44. %_eeprom.bin: %.elf
  45. $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O binary $< $@
  46. install: text
  47. avrdude -p m16 -c butterfly -b 19200 -U flash:w:$(PRG).srec