diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-03-26 22:24:57 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-03-26 22:27:40 +0200 |
commit | f269aa0060950f7b9c42216267c639a2fb556196 (patch) | |
tree | 218ad3a737f11cb18e48676f300bc22038cfa140 /apps | |
parent | 9445d4625a3d47b28d756a5763165eb73d6b4ada (diff) | |
download | rockbox-f269aa0060950f7b9c42216267c639a2fb556196.tar.gz rockbox-f269aa0060950f7b9c42216267c639a2fb556196.zip |
build system: unify/simplify library handling a bit.
libs in $ROOT/lib now add to $(CORE_LIBS) and $(EXTRA_LIBS) and are
automatically linked by the core and codecs/plugins respectively.
Change-Id: Iff482c792a8c8142718f6a16a450c6e2f1497c9a
Diffstat (limited to 'apps')
-rw-r--r-- | apps/codecs/codecs.make | 17 | ||||
-rw-r--r-- | apps/plugins/imageviewer/imageviewer.make | 2 | ||||
-rw-r--r-- | apps/plugins/mikmod/mikmod.make | 2 | ||||
-rw-r--r-- | apps/plugins/pdbox/pdbox.make | 2 | ||||
-rw-r--r-- | apps/plugins/plugins.make | 8 |
5 files changed, 16 insertions, 15 deletions
diff --git a/apps/codecs/codecs.make b/apps/codecs/codecs.make index 55002b229b..37713015ad 100644 --- a/apps/codecs/codecs.make +++ b/apps/codecs/codecs.make | |||
@@ -21,6 +21,9 @@ include $(APPSDIR)/codecs/lib/tlsf/libtlsf.make | |||
21 | include $(APPSDIR)/codecs/lib/libcodec.make | 21 | include $(APPSDIR)/codecs/lib/libcodec.make |
22 | OTHER_INC += -I$(APPSDIR)/codecs/lib | 22 | OTHER_INC += -I$(APPSDIR)/codecs/lib |
23 | 23 | ||
24 | # extra libraries | ||
25 | CODEC_LIBS := $(EXTRA_LIBS) $(TLSFLIB) $(CODECLIB) | ||
26 | |||
24 | # the codec libraries | 27 | # the codec libraries |
25 | include $(APPSDIR)/codecs/demac/libdemac.make | 28 | include $(APPSDIR)/codecs/demac/libdemac.make |
26 | include $(APPSDIR)/codecs/liba52/liba52.make | 29 | include $(APPSDIR)/codecs/liba52/liba52.make |
@@ -135,7 +138,7 @@ $(CODECDIR)/spc.codec : $(CODECDIR)/libspc.a | |||
135 | $(CODECDIR)/mpa.codec : $(CODECDIR)/libmad.a | 138 | $(CODECDIR)/mpa.codec : $(CODECDIR)/libmad.a |
136 | $(CODECDIR)/a52.codec : $(CODECDIR)/liba52.a | 139 | $(CODECDIR)/a52.codec : $(CODECDIR)/liba52.a |
137 | $(CODECDIR)/flac.codec : $(CODECDIR)/libffmpegFLAC.a | 140 | $(CODECDIR)/flac.codec : $(CODECDIR)/libffmpegFLAC.a |
138 | $(CODECDIR)/vorbis.codec : $(CODECDIR)/libtremor.a $(TLSFLIB) | 141 | $(CODECDIR)/vorbis.codec : $(CODECDIR)/libtremor.a |
139 | $(CODECDIR)/speex.codec : $(CODECDIR)/libspeex.a | 142 | $(CODECDIR)/speex.codec : $(CODECDIR)/libspeex.a |
140 | $(CODECDIR)/mpc.codec : $(CODECDIR)/libmusepack.a | 143 | $(CODECDIR)/mpc.codec : $(CODECDIR)/libmusepack.a |
141 | $(CODECDIR)/wavpack.codec : $(CODECDIR)/libwavpack.a | 144 | $(CODECDIR)/wavpack.codec : $(CODECDIR)/libwavpack.a |
@@ -168,10 +171,7 @@ $(CODECDIR)/sgc.codec : $(CODECDIR)/libsgc.a $(CODECDIR)/libemu2413.a | |||
168 | $(CODECDIR)/vgm.codec : $(CODECDIR)/libvgm.a $(CODECDIR)/libemu2413.a | 171 | $(CODECDIR)/vgm.codec : $(CODECDIR)/libvgm.a $(CODECDIR)/libemu2413.a |
169 | $(CODECDIR)/kss.codec : $(CODECDIR)/libkss.a $(CODECDIR)/libemu2413.a | 172 | $(CODECDIR)/kss.codec : $(CODECDIR)/libkss.a $(CODECDIR)/libemu2413.a |
170 | 173 | ||
171 | $(CODECS): $(CODECLIB) # this must be last in codec dependency list | 174 | $(CODECS): $(CODEC_LIBS) # this must be last in codec dependency list |
172 | |||
173 | # libfaad and libmusepack both contain a huffman.h file, with different | ||
174 | # content. So we compile them with special command lines: | ||
175 | 175 | ||
176 | # pattern rule for compiling codecs | 176 | # pattern rule for compiling codecs |
177 | $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.c | 177 | $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.c |
@@ -194,14 +194,13 @@ else | |||
194 | endif | 194 | endif |
195 | CODECLDFLAGS += $(GLOBAL_LDOPTS) | 195 | CODECLDFLAGS += $(GLOBAL_LDOPTS) |
196 | 196 | ||
197 | $(CODECDIR)/%-pre.map: $(CODEC_CRT0) $(CODECLINK_LDS) $(CODECDIR)/%.o $(CODECLIB) | 197 | $(CODECDIR)/%-pre.map: $(CODEC_CRT0) $(CODECLINK_LDS) $(CODECDIR)/%.o $(CODECS_LIBS) |
198 | $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*-pre.elf \ | 198 | $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*-pre.elf \ |
199 | $(filter %.o, $^) \ | 199 | $(filter %.o, $^) \ |
200 | $(filter-out $(CODECLIB),$(filter %.a, $+)) \ | 200 | $(filter-out $(CODECLIB),$(filter %.a, $+)) $(CODECLIB) \ |
201 | $(CODECLIB) \ | ||
202 | -lgcc $(subst .map,-pre.map,$(CODECLDFLAGS)) | 201 | -lgcc $(subst .map,-pre.map,$(CODECLDFLAGS)) |
203 | 202 | ||
204 | $(CODECDIR)/%.codec: $(CODECDIR)/%.o $(LIBSETJMP) $(LIBARMSUPPORT) | 203 | $(CODECDIR)/%.codec: $(CODECDIR)/%.o |
205 | $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \ | 204 | $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \ |
206 | $(filter %.o, $^) \ | 205 | $(filter %.o, $^) \ |
207 | $(filter %.a, $+) \ | 206 | $(filter %.a, $+) \ |
diff --git a/apps/plugins/imageviewer/imageviewer.make b/apps/plugins/imageviewer/imageviewer.make index 76cc3e266d..7f7d94320a 100644 --- a/apps/plugins/imageviewer/imageviewer.make +++ b/apps/plugins/imageviewer/imageviewer.make | |||
@@ -47,7 +47,7 @@ else | |||
47 | endif | 47 | endif |
48 | 48 | ||
49 | # rule to create reference map for image decoder | 49 | # rule to create reference map for image decoder |
50 | $(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(LIBARMSUPPORT) $(PLUGINLIB) $(PLUGINBITMAPLIB) | 50 | $(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGIN_LIBS) |
51 | $(call PRINTS,LD $(@F))$(CC) $(IMGDECFLAGS) -o /dev/null \ | 51 | $(call PRINTS,LD $(@F))$(CC) $(IMGDECFLAGS) -o /dev/null \ |
52 | $(filter %.o, $^) \ | 52 | $(filter %.o, $^) \ |
53 | $(filter %.a, $+) \ | 53 | $(filter %.a, $+) \ |
diff --git a/apps/plugins/mikmod/mikmod.make b/apps/plugins/mikmod/mikmod.make index c975e1e5c7..38a95c3695 100644 --- a/apps/plugins/mikmod/mikmod.make +++ b/apps/plugins/mikmod/mikmod.make | |||
@@ -20,7 +20,7 @@ OTHER_SRC += $(MIKMOD_SRC) | |||
20 | 20 | ||
21 | MIKMODCFLAGS = $(PLUGINFLAGS) -I$(MIKMODSRCDIR) -O2 | 21 | MIKMODCFLAGS = $(PLUGINFLAGS) -I$(MIKMODSRCDIR) -O2 |
22 | 22 | ||
23 | $(MIKMODBUILDDIR)/mikmod.rock: $(MIKMOD_OBJ) $(CODECDIR)/libtlsf.a | 23 | $(MIKMODBUILDDIR)/mikmod.rock: $(MIKMOD_OBJ) |
24 | 24 | ||
25 | # new rule needed to use extra compile flags | 25 | # new rule needed to use extra compile flags |
26 | $(MIKMODBUILDDIR)/%.o: $(MIKMODSRCDIR)/%.c | 26 | $(MIKMODBUILDDIR)/%.o: $(MIKMODSRCDIR)/%.c |
diff --git a/apps/plugins/pdbox/pdbox.make b/apps/plugins/pdbox/pdbox.make index 0e40232321..239e1c0852 100644 --- a/apps/plugins/pdbox/pdbox.make +++ b/apps/plugins/pdbox/pdbox.make | |||
@@ -18,7 +18,7 @@ PDBOX_OBJ := $(call c2obj, $(PDBOX_SRC)) | |||
18 | # add source files to OTHERSRC to get automatic dependencies | 18 | # add source files to OTHERSRC to get automatic dependencies |
19 | OTHER_SRC += $(PDBOX_SRC) | 19 | OTHER_SRC += $(PDBOX_SRC) |
20 | 20 | ||
21 | $(PDBOXBUILDDIR)/pdbox.rock: $(PDBOX_OBJ) $(MPEG_OBJ) $(CODECDIR)/libtlsf.a | 21 | $(PDBOXBUILDDIR)/pdbox.rock: $(PDBOX_OBJ) $(MPEG_OBJ) |
22 | 22 | ||
23 | PDBOXFLAGS = $(PLUGINFLAGS) -fno-strict-aliasing | 23 | PDBOXFLAGS = $(PLUGINFLAGS) -fno-strict-aliasing |
24 | PDBOXLDFLAGS = $(PLUGINLDFLAGS) | 24 | PDBOXLDFLAGS = $(PLUGINLDFLAGS) |
diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make index 272b1b8e93..3ea6d96432 100644 --- a/apps/plugins/plugins.make +++ b/apps/plugins/plugins.make | |||
@@ -53,6 +53,8 @@ else | |||
53 | PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS) | 53 | PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS) |
54 | endif | 54 | endif |
55 | 55 | ||
56 | PLUGIN_LIBS := $(EXTRA_LIBS) $(TLSFLIB) $(PLUGINLIB) $(PLUGINBITMAPLIB) | ||
57 | |||
56 | # include <dir>.make from each subdir (yay!) | 58 | # include <dir>.make from each subdir (yay!) |
57 | $(foreach dir,$(PLUGINSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make)) | 59 | $(foreach dir,$(PLUGINSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make)) |
58 | 60 | ||
@@ -65,7 +67,7 @@ PLUGINFLAGS = -I$(APPSDIR)/plugins -DPLUGIN $(CFLAGS) | |||
65 | $(ROCKS1): $(BUILDDIR)/%.rock: $(BUILDDIR)/%.o | 67 | $(ROCKS1): $(BUILDDIR)/%.rock: $(BUILDDIR)/%.o |
66 | 68 | ||
67 | # dependency for all plugins | 69 | # dependency for all plugins |
68 | $(ROCKS): $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(LIBARMSUPPORT) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(PLUGIN_CRT0) $(LIBSETJMP) | 70 | $(ROCKS): $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGIN_LIBS) $(PLUGIN_CRT0) |
69 | 71 | ||
70 | $(PLUGINLIB): $(PLUGINLIB_OBJ) | 72 | $(PLUGINLIB): $(PLUGINLIB_OBJ) |
71 | $(SILENT)$(shell rm -f $@) | 73 | $(SILENT)$(shell rm -f $@) |
@@ -85,7 +87,7 @@ $(BUILDDIR)/credits.raw credits.raw: $(DOCSDIR)/CREDITS | |||
85 | $(call PRINTS,Create credits.raw)perl $(APPSDIR)/plugins/credits.pl < $< > $(BUILDDIR)/$(@F) | 87 | $(call PRINTS,Create credits.raw)perl $(APPSDIR)/plugins/credits.pl < $< > $(BUILDDIR)/$(@F) |
86 | 88 | ||
87 | # special dependencies | 89 | # special dependencies |
88 | $(BUILDDIR)/apps/plugins/wav2wv.rock: $(BUILDDIR)/apps/codecs/libwavpack.a $(PLUGINLIB) | 90 | $(BUILDDIR)/apps/plugins/wav2wv.rock: $(BUILDDIR)/apps/codecs/libwavpack.a $(PLUGIN_LIBS) |
89 | 91 | ||
90 | # Do not use '-ffunction-sections' and '-fdata-sections' when compiling sdl-sim | 92 | # Do not use '-ffunction-sections' and '-fdata-sections' when compiling sdl-sim |
91 | ifeq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim) | 93 | ifeq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim) |
@@ -129,7 +131,7 @@ endif | |||
129 | $(BUILDDIR)/apps/plugins/%.lua: $(ROOTDIR)/apps/plugins/%.lua | 131 | $(BUILDDIR)/apps/plugins/%.lua: $(ROOTDIR)/apps/plugins/%.lua |
130 | $(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $(BUILDDIR)/apps/plugins/ | 132 | $(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $(BUILDDIR)/apps/plugins/ |
131 | 133 | ||
132 | $(BUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(OVERLAYREF_LDS) $(LIBARMSUPPORT) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(LIBSETJMP) $(PLUGIN_CRT0) | 134 | $(BUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(OVERLAYREF_LDS) $(PLUGIN_LIBS) |
133 | $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o /dev/null \ | 135 | $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o /dev/null \ |
134 | $(filter %.o, $^) \ | 136 | $(filter %.o, $^) \ |
135 | $(filter %.a, $+) \ | 137 | $(filter %.a, $+) \ |