2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 INCLUDES
= -I
$(APPSDIR
) -I..
-I.
$(TARGET_INC
) -I
$(FIRMDIR
)/include -I
$(FIRMDIR
)/export \
11 -I
$(FIRMDIR
)/common
-I
$(FIRMDIR
)/drivers
-I
$(OUTDIR
) -I
$(BUILDDIR
)
12 CFLAGS
= $(INCLUDES
) $(GCCOPTS
) -O2
$(TARGET
) $(EXTRA_DEFINES
) \
13 -DTARGET_ID
=$(TARGET_ID
) -DMEM
=${MEMORYSIZE} -DPLUGIN
-finline-functions
16 INCLUDES
+= $(patsubst %,-I
$(APPSDIR
)/%,$(subst :, ,$(APPEXTRA
)))
19 LINKFILE
:= $(OBJDIR
)/link.lds
20 DEPFILE
= $(OBJDIR
)/dep-rockboy
21 SRC
= cpu.c emu.c events.c fastmem.c hw.c lcd.c lcdc.c loader.c \
22 mem.c menu.c rbsound.c rockboy.c rtc.c save.c sound.c sys_rockbox.c \
23 ..
/..
/..
/firmware
/common
/sscanf.c
29 OBJS
:= $(SRC
:%.c
=$(OBJDIR
)/%.o
)
33 ifneq (,$(findstring RECORDER
,$(TARGET
))) ## Archos recorder targets
35 OUTPUT
= $(OUTDIR
)/rockboy.ovl
38 OUTPUT
= $(OUTDIR
)/rockboy.rock
41 OUTPUT
= $(OUTDIR
)/rockboy.rock
47 $(OBJDIR
)/rockboy.elf
: $(OBJS
) $(LINKFILE
)
48 $(call PRINTS
,LD
$(@F
))$(CC
) $(CFLAGS
) -o
$@
$(OBJS
) -L
$(BUILDDIR
) -lplugin
-fast
-lgcc \
49 -T
$(LINKFILE
) -Wl
,--gc-sections
-Wl
,-Map
,$(OBJDIR
)/rockboy.map
51 $(OUTPUT
): $(OBJDIR
)/rockboy.elf
52 $(call PRINTS
,OBJCOPY
$(@F
))$(OC
) -O binary
$< $@
56 ###################################################
57 # This is the X11 simulator version
60 $(call PRINTS
,LD
$(@F
))$(CC
) $(CFLAGS
) $(SHARED_FLAG
) $(OBJS
) -L
$(BUILDDIR
) -lplugin
-o
$@
61 ifeq ($(findstring CYGWIN
,$(UNAME
)),CYGWIN
)
62 # 'x' must be kept or you'll have "Win32 error 5"
63 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
64 # #define ERROR_ACCESS_DENIED 5L
69 else # end of x11-simulator
71 ###################################################
72 # This is the sdl simulator version
75 $(call PRINTS
,LD
$(@F
))$(CC
) $(CFLAGS
) $(SHARED_FLAG
) $(OBJS
) -L
$(BUILDDIR
) -lplugin
-o
$@
76 ifeq ($(findstring CYGWIN
,$(UNAME
)),CYGWIN
)
77 # 'x' must be kept or you'll have "Win32 error 5"
78 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
79 # #define ERROR_ACCESS_DENIED 5L
84 else # end of sdl-simulator
85 ###################################################
86 # This is the win32 simulator version
87 DLLTOOLFLAGS
= --export-all
88 DLLWRAPFLAGS
= -s
--entry _DllMain@
12 --target
=i386-mingw32
-mno-cygwin
91 $(call PRINTS
,DLL
$(@F
))$(DLLTOOL
) $(DLLTOOLFLAGS
) -z
$(OBJDIR
)/$*.def
$(OBJS
)
92 $(SILENT
)$(DLLWRAP
) $(DLLWRAPFLAGS
) --def
$(OBJDIR
)/$*.def
$(OBJS
) \
93 $(BUILDDIR
)/libplugin.a
-o
$@
94 ifeq ($(findstring CYGWIN
,$(UNAME
)),CYGWIN
)
95 # 'x' must be kept or you'll have "Win32 error 5"
96 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
97 # #define ERROR_ACCESS_DENIED 5L
101 endif # end of win32-simulator
103 endif # end of simulator section
106 include $(TOOLSDIR
)/make.inc
108 # MEMORYSIZE should be passed on to this makefile with the chosen memory size
109 # given in number of MB
111 $(call PRINTS
,build
$(@F
))cat
$< |
$(CC
) -DMEMORYSIZE
=$(MEMORYSIZE
) $(INCLUDES
) $(TARGET
) $(DEFINES
) \
115 $(call PRINTS
,cleaning rockboy
)rm -rf
$(OBJDIR
)/rockboy
116 $(SILENT
)rm -f
$(OBJDIR
)/rockboy.
* $(DEPFILE
)