summaryrefslogtreecommitdiff
path: root/apps/plugins/Makefile
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/Makefile
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/Makefile')
-rw-r--r--apps/plugins/Makefile180
1 files changed, 0 insertions, 180 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
deleted file mode 100644
index 19d062286c..0000000000
--- a/apps/plugins/Makefile
+++ /dev/null
@@ -1,180 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
11 -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR)
12
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
20ifdef SOFTWARECODECS
21 CODECLIBS = -lmad -la52 -lffmpegFLAC -ltremor -lwavpack -lmusepack
22endif
23
24# Set up the bitmap libraries
25BITMAPLIBS =
26LINKBITMAPS =
27ifneq ($(strip $(BMP2RB_MONO)),)
28 BITMAPLIBS += pluginbitmapsmono
29 LINKBITMAPS += -lpluginbitmapsmono
30endif
31ifneq ($(strip $(BMP2RB_NATIVE)),)
32 BITMAPLIBS += pluginbitmapsnative
33 LINKBITMAPS += -lpluginbitmapsnative
34endif
35ifneq ($(strip $(BMP2RB_REMOTEMONO)),)
36 BITMAPLIBS += pluginbitmapsremotemono
37 LINKBITMAPS += -lpluginbitmapsremotemono
38endif
39ifneq ($(strip $(BMP2RB_REMOTENATIVE)),)
40 BITMAPLIBS += pluginbitmapsremotenative
41 LINKBITMAPS += -lpluginbitmapsremotenative
42endif
43
44LDS := plugin.lds
45LINKFILE := $(OBJDIR)/pluginlink.lds
46DEPFILE = $(OBJDIR)/dep-plugins
47
48# This sets up 'SRC' based on the files mentioned in SOURCES
49include $(TOOLSDIR)/makesrc.inc
50
51# This sets up 'SUBDIRS' based on the directories mentioned in SUBDIRS
52include $(TOOLSDIR)/makesubdirs.inc
53
54ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
55SOURCES = $(SRC)
56ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
57OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
58# as created by the cross-compiler for win32:
59DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
60DIRS = .
61
62.PHONY: $(SUBDIRS)
63all: build
64
65dep: $(DEPFILE)
66
67build: $(DEPFILE) $(BITMAPLIBS)
68 $(call PRINTS,MAKE rocks)$(MAKE) rocks
69 $(call PRINTS,MAKE subdirs)$(MAKE) subdirs
70
71rocks: $(ROCKS)
72
73subdirs: $(SUBDIRS)
74
75$(BUILDDIR)/credits.raw: $(DOCSDIR)/CREDITS
76 $(call PRINTS,create credits.raw)perl credits.pl < $< > $@
77
78$(OBJDIR)/credits.o: credits.c $(BUILDDIR)/credits.raw
79 $(SILENT)mkdir -p $(dir $@)
80 $(call PRINTS,CC $(<F))$(CC) $(CFLAGS) -I$(OBJDIR) -c $< -o $@
81
82pluginbitmapsmono:
83 $(call PRINTS,MAKE in plugins/bitmaps/mono)$(MAKE) -C bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono
84
85pluginbitmapsnative:
86 $(call PRINTS,MAKE in plugins/bitmaps/native)$(MAKE) -C bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native
87
88pluginbitmapsremotemono:
89 $(call PRINTS,MAKE in plugins/bitmaps/remote_mono)$(MAKE) -C bitmaps/remote_mono OBJDIR=$(OBJDIR)/bitmaps/remote_mono
90
91pluginbitmapsremotenative:
92 $(call PRINTS,MAKE in plugins/bitmaps/remote_native)$(MAKE) -C bitmaps/remote_native OBJDIR=$(OBJDIR)/bitmaps/remote_native
93
94ifndef SIMVER
95$(OBJDIR)/%.rock: $(OBJDIR)/%.o $(LINKFILE)
96 $(SILENT)$(CC) $(CFLAGS) -o $(OBJDIR)/$*.elf $< -L$(BUILDDIR) \
97 $(CODECLIBS) -lplugin $(LINKBITMAPS) -lgcc \
98 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/$*.map
99 $(call PRINTS,LINK $(@F))$(OC) -O binary $(OBJDIR)/$*.elf $(OBJDIR)/$*.rock
100
101else
102
103ifeq ($(SIMVER), x11)
104###################################################
105# This is the X11 simulator version
106
107$(OBJDIR)/%.rock : $(OBJDIR)/%.o
108 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
109ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
110# 'x' must be kept or you'll have "Win32 error 5"
111# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
112# #define ERROR_ACCESS_DENIED 5L
113else
114 $(SILENT)chmod -x $@
115endif
116
117else # end of x11-simulator
118ifeq ($(SIMVER), sdl)
119###################################################
120# This is the SDL simulator version
121
122$(OBJDIR)/%.rock : $(OBJDIR)/%.o
123 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
124ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
125# 'x' must be kept or you'll have "Win32 error 5"
126# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
127# #define ERROR_ACCESS_DENIED 5L
128else
129 $(SILENT)chmod -x $@
130endif
131
132else # end of sdl-simulator
133###################################################
134# This is the win32 simulator version
135DLLTOOLFLAGS = --export-all
136DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
137
138$(OBJDIR)/%.rock : $(OBJDIR)/%.o
139 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
140 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(BUILDDIR)/libplugin.a $(BITMAPLIBS) \
141 $(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) -o $@
142ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
143# 'x' must be kept or you'll have "Win32 error 5"
144# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
145# #define ERROR_ACCESS_DENIED 5L
146else
147 $(SILENT)chmod -x $@
148endif
149endif # end of win32-simulator
150endif
151
152endif # end of simulator section
153
154include $(TOOLSDIR)/make.inc
155
156pluginlib:
157 $(SILENT)mkdir -p $(OBJDIR)/lib
158 $(call PRINTS,MAKE in plugin/lib)$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib
159
160$(LINKFILE): $(LDS)
161 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@
162
163$(SUBDIRS):
164 $(SILENT)mkdir -p $(OBJDIR)/$@
165 $(call PRINTS,MAKE in $@)$(MAKE) -C $@ OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@ \
166 LINKBITMAPS="$(LINKBITMAPS)"
167
168clean:
169 $(call PRINTS,cleaning plugins)rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
170 $(BUILDDIR)/credits.raw $(OBJS) $(DEFS)
171 $(SILENT)$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib
172 $(SILENT)$(MAKE) -C bitmaps/mono clean OBJDIR=$(OBJDIR)/bitmaps/mono
173 $(SILENT)$(MAKE) -C bitmaps/native clean OBJDIR=$(OBJDIR)/bitmaps/native
174 $(SILENT)$(MAKE) -C bitmaps/remote_mono clean OBJDIR=$(OBJDIR)/bitmaps/remote_mono
175 $(SILENT)$(MAKE) -C bitmaps/remote_native clean OBJDIR=$(OBJDIR)/bitmaps/remote_native
176 $(SILENT)$(MAKE) -C rockboy clean OBJDIR=$(OBJDIR)/rockboy
177 $(SILENT)$(MAKE) -C searchengine clean OBJDIR=$(OBJDIR)/searchengine
178 @rm -rf $(BUILDDIR)/pluginbitmaps
179
180-include $(DEPFILE)