mirror of
https://github.com/hoglet67/AtomBusMon.git
synced 2024-12-22 16:30:06 +00:00
8a857ae45e
Change-Id: Ib5115d9e7b736c45bb46a0a063325a0173b6f823
54 lines
1.4 KiB
Makefile
54 lines
1.4 KiB
Makefile
# Paths that will need changing
|
|
|
|
ATOMFPGA=$(HOME)/atom/AtomBusMon
|
|
PAPILIO_LOADER=/opt/GadgetFactory/papilio-loader/programmer
|
|
XILINX=/opt/Xilinx/14.7
|
|
|
|
# Shouldn't need to make changes below this point
|
|
|
|
BIT_FILE=$(ATOMFPGA)/working/AtomFast6502.bit
|
|
BMM_FILE=$(ATOMFPGA)/src/AtomFast6502_bd.bmm
|
|
|
|
|
|
# Papilio dev environment
|
|
PROG=${PAPILIO_LOADER}/linux32/papilio-prog
|
|
BSCAN=${PAPILIO_LOADER}/bscan_spi_xc3s500e.bit
|
|
SREC_CAT=srec_cat
|
|
GAWK=gawk
|
|
DATA2MEM=${XILINX}/ISE_DS/ISE/bin/lin/data2mem
|
|
|
|
# AVR dev environment
|
|
MCU=atmega103
|
|
F_CPU=15855484
|
|
CC=avr-gcc
|
|
OBJCOPY=avr-objcopy
|
|
|
|
CFLAGS=-DCPU=6502 -DCPUEMBEDDED -DF_CPU=${F_CPU}UL -DSERIAL_STATUS -DCOOKED_SERIAL -DNOUSART1 -mmcu=$(MCU) -Wall -Os -mcall-prologues
|
|
|
|
OBJECTS=AtomBusMon.o dis6502.o regs6502.o status.o
|
|
|
|
build: avr6502fast.bit
|
|
|
|
avr6502fast.bit: avr_progmem.mem
|
|
$(DATA2MEM) -bm $(BMM_FILE) -bd avr_progmem.mem -bt $(BIT_FILE) -o b avr6502fast.bit
|
|
|
|
avr_progmem.mem: avr_progmem.hex
|
|
$(SREC_CAT) $< -Intel -Byte_Swap 2 -Data_Only -o tmp.mem -vmem 8
|
|
$(GAWK) ' BEGIN{FS=" ";} { $$1= ""; print}' tmp.mem > $@
|
|
rm tmp.mem
|
|
|
|
|
|
avr_progmem.hex : avr_progmem.out
|
|
$(OBJCOPY) -R .eeprom -O ihex avr_progmem.out avr_progmem.hex
|
|
avr_progmem.out : $(OBJECTS)
|
|
$(CC) $(CFLAGS) -o avr_progmem.out -Wl,-Map,avr_progmem.map $^
|
|
%.o : %.c
|
|
$(CC) $(CFLAGS) -Os -c $<
|
|
%.o : %.S
|
|
$(CC) $(CFLAGS) -Os -c $<
|
|
|
|
.phony: clean
|
|
|
|
clean:
|
|
rm -f avr6502fast.bit avr_progmem.mem avr_progmem.hex avr_progmem.out avr_progmem.map *.o
|