mirror of
https://github.com/raphnet/gc_n64_usb-v3
synced 2024-11-14 13:15:17 -05:00
53 lines
994 B
Makefile
53 lines
994 B
Makefile
CC=avr-gcc
|
|
AS=$(CC)
|
|
LD=$(CC)
|
|
|
|
include Makefile.inc
|
|
|
|
PROGNAME=n64
|
|
OBJDIR=objs-$(PROGNAME)
|
|
CPU=at90usb1287
|
|
CFLAGS=-Wall -mmcu=$(CPU) -DF_CPU=16000000L -Os -DUART1_STDOUT -DSTK525 -DVERSIONSTR=$(VERSIONSTR)
|
|
LDFLAGS=-mmcu=$(CPU) -Wl,-Map=$(PROGNAME).map
|
|
HEXFILE=$(PROGNAME).hex
|
|
|
|
|
|
all: $(HEXFILE)
|
|
|
|
main.o: main.c reportdesc.c dataHidReport.c
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
%.o: %.S
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
%.o: %.c %.h
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
$(PROGNAME).elf: $(OBJS)
|
|
$(LD) $(OBJS) $(LDFLAGS) -o $(PROGNAME).elf
|
|
|
|
$(HEXFILE): $(PROGNAME).elf
|
|
avr-objcopy -j .data -j .text -O ihex $(PROGNAME).elf $(PROGNAME).hex
|
|
avr-size $(PROGNAME).elf
|
|
|
|
clean:
|
|
rm -f $(PROGNAME).elf $(PROGNAME).hex $(PROGNAME).map $(OBJS)
|
|
|
|
fuse:
|
|
|
|
flash: $(HEXFILE)
|
|
./enter_bootloader.sh
|
|
./wait_then_flash.sh $(CPU) $(HEXFILE)
|
|
|
|
justflash: $(HEXFILE)
|
|
./wait_then_flash.sh $(CPU) $(HEXFILE)
|
|
|
|
chip_erase:
|
|
dfu-programmer atmega32u2 erase
|
|
|
|
reset:
|
|
dfu-programmer atmega32u2 reset
|