2002-04-15 08:35:08 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
2003-05-17 00:31:50 +00:00
|
|
|
|
|
|
|
ifdef RECORDER
|
|
|
|
EXTRA = -DRECORDER
|
|
|
|
EXT = ajz
|
|
|
|
else
|
|
|
|
EXT = mod
|
|
|
|
endif
|
|
|
|
|
2002-04-15 08:35:08 +00:00
|
|
|
TARGET = stub
|
2003-05-17 00:31:50 +00:00
|
|
|
OBJS = start.o sh-stub.o setjmp.o
|
2002-04-15 08:35:08 +00:00
|
|
|
LIBS = -lgcc
|
|
|
|
|
|
|
|
.s.o:
|
|
|
|
sh-elf-as -o $@ $<
|
|
|
|
|
|
|
|
.c.o:
|
2003-05-17 00:31:50 +00:00
|
|
|
sh-elf-gcc -O $(EXTRA) -I../firmware/export -I../firmware/include -m1 -Wall -Wstrict-prototypes -c -o $@ $<
|
|
|
|
|
|
|
|
.S.o:
|
|
|
|
sh-elf-gcc -O -I../firmware/export -I../firmware/include -m1 -Wall -Wstrict-prototypes -c -o $@ $<
|
2002-04-15 08:35:08 +00:00
|
|
|
|
2003-05-17 00:31:50 +00:00
|
|
|
$(TARGET).$(EXT): $(TARGET).elf
|
2002-04-15 08:35:08 +00:00
|
|
|
sh-elf-objcopy -O binary $(TARGET).elf $(TARGET).out
|
2003-05-17 00:31:50 +00:00
|
|
|
../tools/scramble $(TARGET).out $(TARGET).$(EXT)
|
2003-06-29 21:56:32 +00:00
|
|
|
../tools/sh2d $(TARGET).out -o 09000000 > $(TARGET).asm
|
2002-04-15 08:35:08 +00:00
|
|
|
|
|
|
|
$(TARGET).elf: $(OBJS)
|
2003-05-17 00:31:50 +00:00
|
|
|
sh-elf-gcc -nostartfiles $(OBJS) -nostdlib -Wl,-Map,$(TARGET).map -o $(TARGET).elf -Tlinker.cfg
|
2002-04-15 08:35:08 +00:00
|
|
|
|
|
|
|
clean:
|
2003-05-17 00:31:50 +00:00
|
|
|
rm $(OBJS) $(TARGET).map $(TARGET).elf $(TARGET).out $(TARGET).mod $(TARGET).ajz
|
2002-04-15 08:35:08 +00:00
|
|
|
|
2003-06-29 21:56:32 +00:00
|
|
|
start.o: start.S
|
2002-05-11 20:04:48 +00:00
|
|
|
sh-stub.o: sh-stub.c
|
2003-05-17 00:31:50 +00:00
|
|
|
setjmp.o: setjmp.S
|