summaryrefslogtreecommitdiff
path: root/apps/plugins/clock
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/clock
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/clock')
-rw-r--r--apps/plugins/clock/Makefile112
-rw-r--r--apps/plugins/clock/clock.c4
-rw-r--r--apps/plugins/clock/clock.make21
-rw-r--r--apps/plugins/clock/clock_bitmap_strings.h2
-rw-r--r--apps/plugins/clock/clock_bitmaps.c28
-rw-r--r--apps/plugins/clock/clock_bitmaps.h2
-rw-r--r--apps/plugins/clock/clock_counter.h2
-rw-r--r--apps/plugins/clock/clock_draw_analog.c4
-rw-r--r--apps/plugins/clock/clock_draw_binary.c2
-rw-r--r--apps/plugins/clock/clock_draw_digital.c2
-rw-r--r--apps/plugins/clock/clock_settings.c2
11 files changed, 45 insertions, 136 deletions
diff --git a/apps/plugins/clock/Makefile b/apps/plugins/clock/Makefile
deleted file mode 100644
index abf932a682..0000000000
--- a/apps/plugins/clock/Makefile
+++ /dev/null
@@ -1,112 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $$Id: $$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(APPSDIR)/plugins/lib \
11 $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
12 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
13 -I$(BUILDDIR)/pluginbitmaps
14CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
15 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
16
17ifdef APPEXTRA
18 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
19endif
20
21LINKFILE := $(OBJDIR)/link.lds
22DEPFILE = $(OBJDIR)/dep-clock
23
24# This sets up 'SRC' based on the files mentioned in SOURCES
25include $(TOOLSDIR)/makesrc.inc
26
27SOURCES = $(SRC)
28OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
29DIRS = .
30
31ifndef SIMVER
32 LDS := ../plugin.lds
33 OUTPUT = $(OUTDIR)/clock.rock
34else ## simulators
35 OUTPUT = $(OUTDIR)/clock.rock
36endif
37
38all: $(OUTPUT)
39
40ifndef SIMVER
41$(OBJDIR)/clock.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
42 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
43 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/clock.map
44
45$(OUTPUT): $(OBJDIR)/clock.elf
46 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
47else
48
49ifeq ($(SIMVER), x11)
50###################################################
51# This is the X11 simulator version
52
53$(OUTPUT): $(OBJS)
54 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
55ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
56# 'x' must be kept or you'll have "Win32 error 5"
57# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
58# #define ERROR_ACCESS_DENIED 5L
59else
60 @chmod -x $@
61endif
62
63else # end of x11-simulator
64ifeq ($(SIMVER), sdl)
65###################################################
66# This is the SDL simulator version
67
68$(OUTPUT): $(OBJS)
69 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
70ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
71# 'x' must be kept or you'll have "Win32 error 5"
72# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
73# #define ERROR_ACCESS_DENIED 5L
74else
75 @chmod -x $@
76endif
77
78else # end of sdl-simulator
79###################################################
80# This is the win32 simulator version
81DLLTOOLFLAGS = --export-all
82DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
83
84$(OUTPUT): $(OBJS)
85 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
86 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
87 $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@
88ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
89# 'x' must be kept or you'll have "Win32 error 5"
90# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
91# #define ERROR_ACCESS_DENIED 5L
92else
93 @chmod -x $@
94endif
95endif # end of win32-simulator
96endif
97endif # end of simulator section
98
99
100include $(TOOLSDIR)/make.inc
101
102# MEMORYSIZE should be passed on to this makefile with the chosen memory size
103# given in number of MB
104$(LINKFILE): $(LDS)
105 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
106 $(DEFINES) -E -P - >$@
107
108clean:
109 $(call PRINTS,cleaning clock)rm -rf $(OBJDIR)/clock
110 $(SILENT)rm -f $(OBJDIR)/clock.* $(DEPFILE)
111
112-include $(DEPFILE)
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c
index 1d257fde6e..9279a182ee 100644
--- a/apps/plugins/clock/clock.c
+++ b/apps/plugins/clock/clock.c
@@ -21,8 +21,8 @@
21 21
22#include "plugin.h" 22#include "plugin.h"
23#include "time.h" 23#include "time.h"
24#include "pluginlib_actions.h" 24#include "lib/pluginlib_actions.h"
25#include "xlcd.h" 25#include "lib/xlcd.h"
26 26
27#include "clock.h" 27#include "clock.h"
28#include "clock_counter.h" 28#include "clock_counter.h"
diff --git a/apps/plugins/clock/clock.make b/apps/plugins/clock/clock.make
new file mode 100644
index 0000000000..c864d67503
--- /dev/null
+++ b/apps/plugins/clock/clock.make
@@ -0,0 +1,21 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10CLOCKSRCDIR := $(APPSDIR)/plugins/clock
11CLOCKBUILDDIR := $(BUILDDIR)/apps/plugins/clock
12
13ROCKS += $(CLOCKBUILDDIR)/clock.rock
14
15CLOCK_SRC := $(call preprocess, $(CLOCKSRCDIR)/SOURCES)
16CLOCK_OBJ := $(call c2obj, $(CLOCK_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(CLOCK_SRC)
20
21$(CLOCKBUILDDIR)/clock.rock: $(CLOCK_OBJ)
diff --git a/apps/plugins/clock/clock_bitmap_strings.h b/apps/plugins/clock/clock_bitmap_strings.h
index 549a4a9448..3f5a09d34b 100644
--- a/apps/plugins/clock/clock_bitmap_strings.h
+++ b/apps/plugins/clock/clock_bitmap_strings.h
@@ -23,7 +23,7 @@
23#ifndef _CLOCK_BITMAP_STRINGS_ 23#ifndef _CLOCK_BITMAP_STRINGS_
24#define _CLOCK_BITMAP_STRINGS_ 24#define _CLOCK_BITMAP_STRINGS_
25#include "plugin.h" 25#include "plugin.h"
26#include "picture.h" 26#include "lib/picture.h"
27 27
28void draw_string(struct screen* display, const struct picture* bitmaps, 28void draw_string(struct screen* display, const struct picture* bitmaps,
29 char* str, int x, int y); 29 char* str, int x, int y);
diff --git a/apps/plugins/clock/clock_bitmaps.c b/apps/plugins/clock/clock_bitmaps.c
index 2a0590015a..c237a290ec 100644
--- a/apps/plugins/clock/clock_bitmaps.c
+++ b/apps/plugins/clock/clock_bitmaps.c
@@ -23,24 +23,24 @@
23#include "clock_bitmaps.h" 23#include "clock_bitmaps.h"
24 24
25/* bitmaps */ 25/* bitmaps */
26#include "clock_binary.h" 26#include "pluginbitmaps/clock_binary.h"
27#include "clock_digits.h" 27#include "pluginbitmaps/clock_digits.h"
28#include "clock_smalldigits.h" 28#include "pluginbitmaps/clock_smalldigits.h"
29#include "clock_segments.h" 29#include "pluginbitmaps/clock_segments.h"
30#include "clock_smallsegments.h" 30#include "pluginbitmaps/clock_smallsegments.h"
31 31
32#include "clock_logo.h" 32#include "pluginbitmaps/clock_logo.h"
33#include "clock_messages.h" 33#include "pluginbitmaps/clock_messages.h"
34 34
35#if NB_SCREENS==2 35#if NB_SCREENS==2
36#include "clock_binary_remote.h" 36#include "pluginbitmaps/clock_binary_remote.h"
37#include "clock_digits_remote.h" 37#include "pluginbitmaps/clock_digits_remote.h"
38#include "clock_smalldigits_remote.h" 38#include "pluginbitmaps/clock_smalldigits_remote.h"
39#include "clock_segments_remote.h" 39#include "pluginbitmaps/clock_segments_remote.h"
40#include "clock_smallsegments_remote.h" 40#include "pluginbitmaps/clock_smallsegments_remote.h"
41 41
42#include "clock_logo_remote.h" 42#include "pluginbitmaps/clock_logo_remote.h"
43#include "clock_messages_remote.h" 43#include "pluginbitmaps/clock_messages_remote.h"
44 44
45#endif 45#endif
46 46
diff --git a/apps/plugins/clock/clock_bitmaps.h b/apps/plugins/clock/clock_bitmaps.h
index e6e09652d1..750c4d397e 100644
--- a/apps/plugins/clock/clock_bitmaps.h
+++ b/apps/plugins/clock/clock_bitmaps.h
@@ -21,7 +21,7 @@
21 21
22#ifndef _CLOCK_BITMAPS_ 22#ifndef _CLOCK_BITMAPS_
23#define _CLOCK_BITMAPS_ 23#define _CLOCK_BITMAPS_
24#include "picture.h" 24#include "lib/picture.h"
25 25
26extern const struct picture logos[]; 26extern const struct picture logos[];
27extern const struct picture messages[]; 27extern const struct picture messages[];
diff --git a/apps/plugins/clock/clock_counter.h b/apps/plugins/clock/clock_counter.h
index 25523d45f6..46563e9eb7 100644
--- a/apps/plugins/clock/clock_counter.h
+++ b/apps/plugins/clock/clock_counter.h
@@ -2,7 +2,7 @@
2#define _CLOCK_MESSAGE_ 2#define _CLOCK_MESSAGE_
3#include "clock.h" 3#include "clock.h"
4#include "plugin.h" 4#include "plugin.h"
5#include "picture.h" 5#include "lib/picture.h"
6 6
7struct counter{ 7struct counter{
8 int ticks_at_last_unpause;/* to count the time from last pause to now */ 8 int ticks_at_last_unpause;/* to count the time from last pause to now */
diff --git a/apps/plugins/clock/clock_draw_analog.c b/apps/plugins/clock/clock_draw_analog.c
index 391bd73519..c41ec3b24c 100644
--- a/apps/plugins/clock/clock_draw_analog.c
+++ b/apps/plugins/clock/clock_draw_analog.c
@@ -20,8 +20,8 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "clock_draw_analog.h" 22#include "clock_draw_analog.h"
23#include "xlcd.h" 23#include "lib/xlcd.h"
24#include "fixedpoint.h" 24#include "lib/fixedpoint.h"
25#include "clock_bitmaps.h" 25#include "clock_bitmaps.h"
26#include "clock_bitmap_strings.h" 26#include "clock_bitmap_strings.h"
27 27
diff --git a/apps/plugins/clock/clock_draw_binary.c b/apps/plugins/clock/clock_draw_binary.c
index b6c7a9ac29..99f90934d9 100644
--- a/apps/plugins/clock/clock_draw_binary.c
+++ b/apps/plugins/clock/clock_draw_binary.c
@@ -21,7 +21,7 @@
21#include "clock_draw_binary.h" 21#include "clock_draw_binary.h"
22#include "clock_bitmap_strings.h" 22#include "clock_bitmap_strings.h"
23#include "clock_bitmaps.h" 23#include "clock_bitmaps.h"
24#include "picture.h" 24#include "lib/picture.h"
25 25
26const struct picture* binary_skin[]={binary,digits,segments}; 26const struct picture* binary_skin[]={binary,digits,segments};
27 27
diff --git a/apps/plugins/clock/clock_draw_digital.c b/apps/plugins/clock/clock_draw_digital.c
index 7c5925d75f..de5f427c8c 100644
--- a/apps/plugins/clock/clock_draw_digital.c
+++ b/apps/plugins/clock/clock_draw_digital.c
@@ -23,7 +23,7 @@
23#include "clock_draw_digital.h" 23#include "clock_draw_digital.h"
24#include "clock_bitmap_strings.h" 24#include "clock_bitmap_strings.h"
25#include "clock_bitmaps.h" 25#include "clock_bitmaps.h"
26#include "picture.h" 26#include "lib/picture.h"
27 27
28const struct picture* digits_skin[]={digits,segments}; 28const struct picture* digits_skin[]={digits,segments};
29const struct picture* smalldigits_skin[]={smalldigits,smallsegments}; 29const struct picture* smalldigits_skin[]={smalldigits,smallsegments};
diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c
index 1147055ce5..1d78c4705e 100644
--- a/apps/plugins/clock/clock_settings.c
+++ b/apps/plugins/clock/clock_settings.c
@@ -23,7 +23,7 @@
23#include "clock_bitmaps.h" 23#include "clock_bitmaps.h"
24#include "clock_draw.h" 24#include "clock_draw.h"
25#include "clock_settings.h" 25#include "clock_settings.h"
26#include "picture.h" 26#include "lib/picture.h"
27 27
28static int max_skin[]={ 28static int max_skin[]={
29 [ANALOG]=2, 29 [ANALOG]=2,