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 -I
$(BUILDDIR
)/pluginbitmaps
13 CFLAGS
= $(INCLUDES
) $(GCCOPTS
) $(TARGET
) $(EXTRA_DEFINES
) \
14 -DTARGET_ID
=$(TARGET_ID
) -DMEM
=${MEMORYSIZE} -DPLUGIN
17 INCLUDES
+= $(patsubst %,-I
$(APPSDIR
)/%,$(subst :, ,$(APPEXTRA
)))
20 LINKFILE
:= $(OBJDIR
)/link.lds
21 DEPFILE
= $(OBJDIR
)/dep-shortcuts
23 SOURCES
:= shortcuts_common.c shortcuts_view.c shortcuts_append.c
24 VIEW_OBJS
:= $(OBJDIR
)/shortcuts_common.o
$(OBJDIR
)/shortcuts_view.o
25 APPEND_OBJS
:= $(OBJDIR
)/shortcuts_common.o
$(OBJDIR
)/shortcuts_append.o
32 OUTPUT
= $(OUTDIR
)/shortcuts_view.rock
$(OUTDIR
)/shortcuts_append.rock
37 $(OBJDIR
)/shortcuts_view.elf
: $(VIEW_OBJS
) $(LINKFILE
) $(BITMAPLIBS
)
38 $(call PRINTS
,LD
$(@F
))$(CC
) $(GCCOPTS
) -O
-nostdlib
-o
$@
$(VIEW_OBJS
) -L
$(BUILDDIR
) -lplugin
-lgcc \
39 $(LINKBITMAPS
) -Wl
,--gc-sections
-T
$(LINKFILE
) -Wl
,-Map
,$(OBJDIR
)/shortcuts_view.map
41 $(OUTDIR
)/shortcuts_view.rock
: $(OBJDIR
)/shortcuts_view.elf
42 $(call PRINTS
,OBJCOPY
$(@F
))$(OC
) -O binary
$< $@
44 $(OBJDIR
)/shortcuts_append.elf
: $(APPEND_OBJS
) $(LINKFILE
) $(BITMAPLIBS
)
45 $(call PRINTS
,LD
$(@F
))$(CC
) $(GCCOPTS
) -O
-nostdlib
-o
$@
$(APPEND_OBJS
) -L
$(BUILDDIR
) -lplugin
-lgcc \
46 $(LINKBITMAPS
) -Wl
,--gc-sections
-T
$(LINKFILE
) -Wl
,-Map
,$(OBJDIR
)/shortcuts_append.map
48 $(OUTDIR
)/shortcuts_append.rock
: $(OBJDIR
)/shortcuts_append.elf
49 $(call PRINTS
,OBJCOPY
$(@F
))$(OC
) -O binary
$< $@
52 ###################################################
53 # This is the SDL simulator version
55 $(OUTDIR
)/shortcuts_view.rock
: $(VIEW_OBJS
)
56 $(call PRINTS
,LD
$(@F
))$(CC
) $(CFLAGS
) $(SHARED_FLAG
) $(VIEW_OBJS
) -L
$(BUILDDIR
) -lplugin
$(LINKBITMAPS
) -o
$@
57 ifeq ($(findstring CYGWIN
,$(UNAME
)),CYGWIN
)
58 # 'x' must be kept or you'll have "Win32 error 5"
59 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
60 # #define ERROR_ACCESS_DENIED 5L
65 $(OUTDIR
)/shortcuts_append.rock
: $(APPEND_OBJS
)
66 $(call PRINTS
,LD
$(@F
))$(CC
) $(CFLAGS
) $(SHARED_FLAG
) $(APPEND_OBJS
) -L
$(BUILDDIR
) -lplugin
$(LINKBITMAPS
) -o
$@
67 ifeq ($(findstring CYGWIN
,$(UNAME
)),CYGWIN
)
68 # 'x' must be kept or you'll have "Win32 error 5"
69 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
70 # #define ERROR_ACCESS_DENIED 5L
75 endif # end of simulator section
78 include $(TOOLSDIR
)/make.inc
80 # MEMORYSIZE should be passed on to this makefile with the chosen memory size
81 # given in number of MB
83 $(call PRINTS
,build
$(@F
))cat
$< |
$(CC
) -DMEMORYSIZE
=$(MEMORYSIZE
) $(INCLUDES
) $(TARGET
) \
84 $(DEFINES
) -E
-P
- >$@
87 $(call PRINTS
,cleaning shortcuts
)rm -rf
$(OBJDIR
)/shortcuts
88 $(SILENT
)rm -f
$(OBJDIR
)/shortcuts
* $(DEPFILE
)