diff options
author | Björn Stenberg <bjorn@haxx.se> | 2008-11-20 11:27:31 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2008-11-20 11:27:31 +0000 |
commit | c6b3d38a156dd624760a8eb1bb374affd43b4f2a (patch) | |
tree | 493eba929e2396d86cf4f077709aa09fe172cd35 /apps/plugins/clock | |
parent | f66c30346783a400a029bedcd60ab67c81c34a07 (diff) | |
download | rockbox-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/Makefile | 112 | ||||
-rw-r--r-- | apps/plugins/clock/clock.c | 4 | ||||
-rw-r--r-- | apps/plugins/clock/clock.make | 21 | ||||
-rw-r--r-- | apps/plugins/clock/clock_bitmap_strings.h | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_bitmaps.c | 28 | ||||
-rw-r--r-- | apps/plugins/clock/clock_bitmaps.h | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_counter.h | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_analog.c | 4 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_binary.c | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_digital.c | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_settings.c | 2 |
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 | |||
10 | INCLUDES = -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 | ||
14 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
15 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
16 | |||
17 | ifdef APPEXTRA | ||
18 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
19 | endif | ||
20 | |||
21 | LINKFILE := $(OBJDIR)/link.lds | ||
22 | DEPFILE = $(OBJDIR)/dep-clock | ||
23 | |||
24 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
25 | include $(TOOLSDIR)/makesrc.inc | ||
26 | |||
27 | SOURCES = $(SRC) | ||
28 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
29 | DIRS = . | ||
30 | |||
31 | ifndef SIMVER | ||
32 | LDS := ../plugin.lds | ||
33 | OUTPUT = $(OUTDIR)/clock.rock | ||
34 | else ## simulators | ||
35 | OUTPUT = $(OUTDIR)/clock.rock | ||
36 | endif | ||
37 | |||
38 | all: $(OUTPUT) | ||
39 | |||
40 | ifndef 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 $< $@ | ||
47 | else | ||
48 | |||
49 | ifeq ($(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 $@ | ||
55 | ifeq ($(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 | ||
59 | else | ||
60 | @chmod -x $@ | ||
61 | endif | ||
62 | |||
63 | else # end of x11-simulator | ||
64 | ifeq ($(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 $@ | ||
70 | ifeq ($(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 | ||
74 | else | ||
75 | @chmod -x $@ | ||
76 | endif | ||
77 | |||
78 | else # end of sdl-simulator | ||
79 | ################################################### | ||
80 | # This is the win32 simulator version | ||
81 | DLLTOOLFLAGS = --export-all | ||
82 | DLLWRAPFLAGS = -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 $@ | ||
88 | ifeq ($(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 | ||
92 | else | ||
93 | @chmod -x $@ | ||
94 | endif | ||
95 | endif # end of win32-simulator | ||
96 | endif | ||
97 | endif # end of simulator section | ||
98 | |||
99 | |||
100 | include $(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 | |||
108 | clean: | ||
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 | |||
10 | CLOCKSRCDIR := $(APPSDIR)/plugins/clock | ||
11 | CLOCKBUILDDIR := $(BUILDDIR)/apps/plugins/clock | ||
12 | |||
13 | ROCKS += $(CLOCKBUILDDIR)/clock.rock | ||
14 | |||
15 | CLOCK_SRC := $(call preprocess, $(CLOCKSRCDIR)/SOURCES) | ||
16 | CLOCK_OBJ := $(call c2obj, $(CLOCK_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_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 | ||
28 | void draw_string(struct screen* display, const struct picture* bitmaps, | 28 | void 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 | ||
26 | extern const struct picture logos[]; | 26 | extern const struct picture logos[]; |
27 | extern const struct picture messages[]; | 27 | extern 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 | ||
7 | struct counter{ | 7 | struct 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 | ||
26 | const struct picture* binary_skin[]={binary,digits,segments}; | 26 | const 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 | ||
28 | const struct picture* digits_skin[]={digits,segments}; | 28 | const struct picture* digits_skin[]={digits,segments}; |
29 | const struct picture* smalldigits_skin[]={smalldigits,smallsegments}; | 29 | const 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 | ||
28 | static int max_skin[]={ | 28 | static int max_skin[]={ |
29 | [ANALOG]=2, | 29 | [ANALOG]=2, |