summaryrefslogtreecommitdiff
path: root/apps/plugins/shortcuts
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2008-11-20 11:27:31 +0000
committerBjörn Stenberg <bjorn@haxx.se>2008-11-20 11:27:31 +0000
commitc6b3d38a156dd624760a8eb1bb374affd43b4f2a (patch)
tree493eba929e2396d86cf4f077709aa09fe172cd35 /apps/plugins/shortcuts
parentf66c30346783a400a029bedcd60ab67c81c34a07 (diff)
downloadrockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.tar.gz
rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.zip
New makefile solution: A single invocation of 'make' to build the entire tree. Fully controlled dependencies give faster and more correct recompiles.
Many #include lines adjusted to conform to the new standards. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19146 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/shortcuts')
-rw-r--r--apps/plugins/shortcuts/Makefile90
-rw-r--r--apps/plugins/shortcuts/shortcuts.make25
2 files changed, 25 insertions, 90 deletions
diff --git a/apps/plugins/shortcuts/Makefile b/apps/plugins/shortcuts/Makefile
deleted file mode 100644
index 2958af8818..0000000000
--- a/apps/plugins/shortcuts/Makefile
+++ /dev/null
@@ -1,90 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $$Id: $$
8#
9
10INCLUDES = -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
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-shortcuts
22
23SOURCES := shortcuts_common.c shortcuts_view.c shortcuts_append.c
24VIEW_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_view.o
25APPEND_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_append.o
26DIRS = .
27
28ifndef SIMVER
29 LDS := ../plugin.lds
30endif
31
32OUTPUT = $(OUTDIR)/shortcuts_view.rock $(OUTDIR)/shortcuts_append.rock
33
34all: $(OUTPUT)
35
36ifndef SIMVER
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
40
41$(OUTDIR)/shortcuts_view.rock: $(OBJDIR)/shortcuts_view.elf
42 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
43
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
47
48$(OUTDIR)/shortcuts_append.rock: $(OBJDIR)/shortcuts_append.elf
49 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
50else
51
52###################################################
53# This is the SDL simulator version
54
55$(OUTDIR)/shortcuts_view.rock: $(VIEW_OBJS)
56 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(VIEW_OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
57ifeq ($(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
61else
62 @chmod -x $@
63endif
64
65$(OUTDIR)/shortcuts_append.rock: $(APPEND_OBJS)
66 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(APPEND_OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
67ifeq ($(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
71else
72 @chmod -x $@
73endif
74
75endif # end of simulator section
76
77
78include $(TOOLSDIR)/make.inc
79
80# MEMORYSIZE should be passed on to this makefile with the chosen memory size
81# given in number of MB
82$(LINKFILE): $(LDS)
83 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
84 $(DEFINES) -E -P - >$@
85
86clean:
87 $(call PRINTS,cleaning shortcuts)rm -rf $(OBJDIR)/shortcuts
88 $(SILENT)rm -f $(OBJDIR)/shortcuts* $(DEPFILE)
89
90-include $(DEPFILE)
diff --git a/apps/plugins/shortcuts/shortcuts.make b/apps/plugins/shortcuts/shortcuts.make
new file mode 100644
index 0000000000..fc2a77a2f5
--- /dev/null
+++ b/apps/plugins/shortcuts/shortcuts.make
@@ -0,0 +1,25 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10SHCUTSRCDIR := $(APPSDIR)/plugins/shortcuts
11SHCUTBUILDDIR := $(BUILDDIR)/apps/plugins/shortcuts
12
13ROCKS += $(SHCUTBUILDDIR)/shortcuts_view.rock
14ROCKS += $(SHCUTBUILDDIR)/shortcuts_append.rock
15
16# add source files to OTHER_SRC to get automatic dependencies
17OTHER_SRC += $(SHCUTSRCDIR)/shortcuts_common.c \
18 $(SHCUTSRCDIR)/shortcuts_view.c \
19 $(SHCUTSRCDIR)/shortcuts_append.c
20
21$(SHCUTBUILDDIR)/shortcuts_view.rock: \
22 $(SHCUTBUILDDIR)/shortcuts_common.o $(SHCUTBUILDDIR)/shortcuts_view.o
23
24$(SHCUTBUILDDIR)/shortcuts_append.rock: \
25 $(SHCUTBUILDDIR)/shortcuts_common.o $(SHCUTBUILDDIR)/shortcuts_append.o