Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (36 sloc) 1.03 KB
M68K=m68k-linux-gnu
AS=$(M68K)-as
LD=$(M68K)-ld
COPY=$(M68K)-objcopy
DUMP=$(M68K)-objdump
ASFLAGS=-m68340 --warn --fatal-warnings
LDFLAGS=-T m68k.ld
DUMPFLAGS=-m68020 -x -D
#EEPROM=AT28C256
EEPROM=SST39SF010A
PREFIX=m68k-
FMT=binary
SRCS=loader.s
OBJS=$(SRCS:.s=.o)
MAIN=loader
.PHONY: dump clean
all: $(MAIN)
.s.o:
$(AS) $(ASFLAGS) -o $@ $<
$(MAIN): $(OBJS)
$(LD) $(LDFLAGS) -o $(MAIN).a $(OBJS)
$(COPY) -O $(FMT) $(MAIN).a $(PREFIX)$(MAIN).bin
$(COPY) -b 0 -i 2 --interleave-width=1 -O $(FMT) $(MAIN).a $(PREFIX)$(MAIN)-even.bin
$(COPY) -b 1 -i 2 --interleave-width=1 -O $(FMT) $(MAIN).a $(PREFIX)$(MAIN)-odd.bin
clean:
rm -f *.o $(PREFIX)$(MAIN)-even.bin $(PREFIX)$(MAIN)-odd.bin $(PREFIX)$(MAIN).bin $(MAIN).a
prog_even:
@echo Programming $(MAIN)-even onto $(EEPROM)
minipro -p "$(EEPROM)" -w $(PREFIX)$(MAIN)-even.bin -s
prog_odd:
@echo Programming $(MAIN)-odd onto $(EEPROM)
minipro -p "$(EEPROM)" -w $(PREFIX)$(MAIN)-odd.bin -s
dump: $(MAIN)
$(DUMP) $(DUMPFLAGS) $(MAIN).a
vg:
vagrant ssh -c "cd /vagrant/loader/; make"