Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
118 lines (94 sloc)
2.67 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #LFUSE = E4 | |
| #HFUSE = DD | |
| MCU_PROGRAMMER = m64 | |
| PROGRAMMER_TYPE ?= avr109 | |
| PROGRAMMER_PORT ?= com28 | |
| PRG = famicom-dumper | |
| OBJ = dumper.o usart.o comm.o crc.o | |
| HEADERS = defines.h comm.h dumper.h usart.h crc.h | |
| #MCU_TARGET = at90s2313 | |
| #MCU_TARGET = at90s2333 | |
| #MCU_TARGET = at90s4414 | |
| #MCU_TARGET = at90s4433 | |
| #MCU_TARGET = at90s4434 | |
| #MCU_TARGET = at90s8515 | |
| #MCU_TARGET = at90s8535 | |
| #MCU_TARGET = atmega128 | |
| #MCU_TARGET = atmega1280 | |
| #MCU_TARGET = atmega1281 | |
| #MCU_TARGET = atmega16 | |
| #MCU_TARGET = atmega163 | |
| #MCU_TARGET = atmega164p | |
| #MCU_TARGET = atmega165 | |
| #MCU_TARGET = atmega165p | |
| #MCU_TARGET = atmega168 | |
| #MCU_TARGET = atmega169 | |
| #MCU_TARGET = atmega169p | |
| #MCU_TARGET = atmega32 | |
| #MCU_TARGET = atmega324p | |
| #MCU_TARGET = atmega325 | |
| #MCU_TARGET = atmega3250 | |
| #MCU_TARGET = atmega329 | |
| #MCU_TARGET = atmega3290 | |
| #MCU_TARGET = atmega48 | |
| MCU_TARGET = atmega64 | |
| #MCU_TARGET = atmega640 | |
| #MCU_TARGET = atmega644 | |
| #MCU_TARGET = atmega644p | |
| #MCU_TARGET = atmega645 | |
| #MCU_TARGET = atmega6450 | |
| #MCU_TARGET = atmega649 | |
| #MCU_TARGET = atmega6490 | |
| #MCU_TARGET = atmega8 | |
| #MCU_TARGET = atmega8515 | |
| #MCU_TARGET = atmega8535 | |
| #MCU_TARGET = atmega88 | |
| #MCU_TARGET = attiny2313 | |
| #MCU_TARGET = attiny24 | |
| #MCU_TARGET = attiny25 | |
| #MCU_TARGET = attiny26 | |
| #MCU_TARGET = attiny261 | |
| #MCU_TARGET = attiny44 | |
| #MCU_TARGET = attiny45 | |
| #MCU_TARGET = attiny461 | |
| #MCU_TARGET = attiny84 | |
| #MCU_TARGET = attiny85 | |
| #MCU_TARGET = attiny861 | |
| OPTIMIZE = -O2 | |
| DEFS = | |
| LIBS = | |
| CC = avr-gcc | |
| # Override is only needed by avr-lib build system. | |
| override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS) | |
| override LDFLAGS = -Wl,-Map,$(PRG).map | |
| OBJCOPY = avr-objcopy | |
| OBJDUMP = avr-objdump | |
| all: $(PRG).elf lst text | |
| $(PRG).elf: $(OBJ) | |
| $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) | |
| $(OBJ): $(HEADERS) | |
| clean: | |
| rm -rf *.o $(PRG).elf *.eps *.png *.pdf *.bak | |
| rm -rf *.lst *.map $(EXTRA_CLEAN_FILES) | |
| lst: $(PRG).lst | |
| %.lst: %.elf | |
| $(OBJDUMP) -h -S $< > $@ | |
| # Rules for building the .text rom images | |
| text: hex bin srec | |
| hex: $(PRG).hex | |
| bin: $(PRG).bin | |
| srec: $(PRG).srec | |
| %.hex: %.elf | |
| $(OBJCOPY) -j .text -j .data -O ihex $< $@ | |
| %.srec: %.elf | |
| $(OBJCOPY) -j .text -j .data -O srec $< $@ | |
| %.bin: %.elf | |
| $(OBJCOPY) -j .text -j .data -O binary $< $@ | |
| # Rules to update | |
| program: hex | |
| avrdude -V -p $(MCU_PROGRAMMER) -c $(PROGRAMMER_TYPE) -P $(PROGRAMMER_PORT) -U flash:w:$(PRG).hex | |
| reboot: | |
| ./famicom-dumper.exe bootloader --port $(PROGRAMMER_PORT) | |
| update: reboot program | |
| build: hex | |
| .PHONY: program reboot update |