2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 ifeq ($(ARCHOS
),ifp7xx
)
12 INCLUDES
= -I
$(FIRMDIR
)/include -I
$(FIRMDIR
)/export -I.
-I
$(OBJDIR
) \
15 DEPFILE
= $(OBJDIR
)/dep-stub
18 SRC
:= $(shell cat SOURCES |
$(CC
) -DMEMORYSIZE
=$(MEMORYSIZE
) $(INCLUDES
) $(TARGET
) $(DEFINES
) -E
-P
-include "config.h" - )
22 DIRS
+= $(subst :, ,$(APPEXTRA
))
23 INCLUDES
+= $(patsubst %,-I
%,$(subst :, ,$(APPEXTRA
)))
27 VERSION
=$(shell date
+%y
%m
%d-
%H
%M
)
30 CFLAGS
= $(GCCOPTS
) $(INCLUDES
) $(TARGET
) $(DEFINES
) \
31 -DAPPSVERSION
=\"$(VERSION
)\" $(EXTRA_DEFINES
) -DMEM
=${MEMORYSIZE}
33 OBJS
:= $(SRC
:%.c
=$(OBJDIR
)/%.o
)
35 LINKFILE
= $(OBJDIR
)/linkage.lds
37 LIBROCKBOX
= $(BUILDDIR
)/librockbox.a
39 all: $(BUILDDIR
)/$(BINARY
) $(FLASHFILE
)
44 $(call PRINTS
,Build
$(@F
))cat
$< |
$(CC
) -DMEMORYSIZE
=$(MEMORYSIZE
) $(INCLUDES
) $(TARGET
) $(DEFINES
) -E
-P
$(ROMBUILD
) - >$@
46 $(OBJDIR
)/stub.elf
: $(OBJS
) $(LINKFILE
) $(DEPFILE
) $(LIBROCKBOX
)
47 $(call PRINTS
,LD
$(@F
))$(CC
) $(GCCOPTS
) -Os
-nostdlib
-o
$@
$(OBJS
) -L
$(BUILDDIR
) -L
$(BUILDDIR
)/firmware
-lrockbox
-lgcc
-T
$(LINKFILE
) -Wl
,-Map
,$(OBJDIR
)/stub.map
49 $(OBJDIR
)/stub.bin
: $(OBJDIR
)/stub.elf
50 $(call PRINTS
,OBJCOPY
$(@F
))$(OC
) -O binary
$< $@
52 $(BUILDDIR
)/$(BINARY
) : $(OBJDIR
)/stub.bin
53 $(call PRINTS
,Build stub file
)$(MKFIRMWARE
) $< $@
55 include $(TOOLSDIR
)/make.inc
58 $(call PRINTS
,cleaning stub
)-rm -f
$(OBJS
) $(BUILDDIR
)/$(BINARY
) \
59 $(OBJDIR
)/stub.bin
$(OBJDIR
)/stub.elf
$(OBJDIR
)/*.map \
60 $(LINKFILE
) $(DEPFILE
)
74 OBJS
= start.o sh-stub.o setjmp.o
81 sh-elf-gcc
-O
$(EXTRA
) -I..
/firmware
/export -I..
/firmware
/include -m1
-Wall
-Wstrict-prototypes
-c
-o
$@
$<
84 sh-elf-gcc
-O
-I..
/firmware
/export -I..
/firmware
/include -m1
-Wall
-Wstrict-prototypes
-c
-o
$@
$<
86 $(TARGET
).
$(EXT
): $(TARGET
).elf
87 sh-elf-objcopy
-O binary
$(TARGET
).elf
$(TARGET
).out
88 ..
/tools
/scramble
$(TARGET
).out
$(TARGET
).
$(EXT
)
89 ..
/tools
/sh2d
$(TARGET
).out
-o
09000000 > $(TARGET
).asm
91 $(TARGET
).elf
: $(OBJS
)
92 sh-elf-gcc
-nostartfiles
$(OBJS
) -nostdlib
-Wl
,-Map
,$(TARGET
).map
-o
$(TARGET
).elf
-Tlinker.cfg
95 rm $(OBJS
) $(TARGET
).map
$(TARGET
).elf
$(TARGET
).out
$(TARGET
).mod
$(TARGET
).ajz