summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-05-07 22:41:17 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-05-07 22:41:17 +0000
commitb8a23f9e4980e6a041d750c325ab2845aea8488a (patch)
treed10400e99208595638f13e7fe3b279274a173e56
parentd23afcd4f4ad72b1c2c087055a9ba4457f2646cd (diff)
downloadrockbox-b8a23f9e4980e6a041d750c325ab2845aea8488a.tar.gz
rockbox-b8a23f9e4980e6a041d750c325ab2845aea8488a.zip
Fixed makefiles for autoconf.g include.
Fixed build output look in several Makefiles Fixed code to include autoconf.h Fixed code to use ROCKBOX_*_ENDIAN instead of previous attempts. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6421 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/Makefile76
-rw-r--r--apps/codecs/Makefile31
-rw-r--r--apps/codecs/Tremor/Makefile9
-rw-r--r--apps/codecs/Tremor/config-tremor.h11
-rw-r--r--apps/codecs/libFLAC/Makefile16
-rw-r--r--apps/codecs/liba52/Makefile6
-rw-r--r--apps/codecs/liba52/config-a52.h2
-rw-r--r--apps/codecs/libmad/Makefile4
-rw-r--r--apps/codecs/libwavpack/Makefile6
-rw-r--r--apps/database.c5
-rw-r--r--apps/dbtree.c5
-rw-r--r--apps/plugins/Makefile39
-rw-r--r--apps/plugins/a52towav.c11
-rw-r--r--apps/plugins/lib/Makefile4
-rw-r--r--apps/plugins/mpc2wav.c6
-rw-r--r--apps/plugins/rockboy/Makefile26
-rw-r--r--apps/plugins/rockboy/defs.h2
-rw-r--r--apps/plugins/rockboy/fastmem.c4
-rw-r--r--apps/plugins/rockboy/rockmacros.h5
-rw-r--r--apps/plugins/rockboy/save.c2
-rw-r--r--apps/plugins/searchengine/Makefile32
-rw-r--r--apps/recorder/bmp.c3
-rw-r--r--firmware/Makefile19
-rw-r--r--firmware/export/config.h2
-rw-r--r--firmware/export/system.h2
-rwxr-xr-xtools/configure18
-rw-r--r--tools/make.inc1
-rw-r--r--uisimulator/common/Makefile5
-rw-r--r--uisimulator/win32/Makefile8
-rw-r--r--uisimulator/x11/Makefile5
30 files changed, 187 insertions, 178 deletions
diff --git a/apps/Makefile b/apps/Makefile
index 69b1fba577..b8db408a7e 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -7,7 +7,8 @@
7# $Id$ 7# $Id$
8# 8#
9 9
10INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) 10INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(BUILDDIR) \
11 -I$(OBJDIR)
11 12
12DEPFILE = $(OBJDIR)/dep-apps 13DEPFILE = $(OBJDIR)/dep-apps
13LDS := $(FIRMDIR)/app.lds 14LDS := $(FIRMDIR)/app.lds
@@ -43,29 +44,26 @@ MAXOUTFILE = $(OBJDIR)/romstart
43 44
44ifdef SIMVER 45ifdef SIMVER
45# this is a sim build 46# this is a sim build
46COMMONLIB = $(ROOTDIR)/uisimulator/common/libcomsim.a 47COMMONLIB = $(BUILDDIR)/comsim/libcomsim.a
47 48
48all: $(COMMONLIB) $(OBJDIR)/$(BINARY) $(CODECS) $(ROCKS) 49all: $(COMMONLIB) $(BUILDDIR)/$(BINARY) $(CODECS) $(ROCKS)
49 @$(MAKE) -C $(SIMDIR) 50 @$(MAKE) -C $(SIMDIR)
50 51
51$(COMMONLIB): 52$(COMMONLIB):
52 @$(MAKE) -C $(ROOTDIR)/uisimulator/common 53 @$(MAKE) -C $(ROOTDIR)/uisimulator/common
53else 54else
54# regular target build 55# regular target build
55all: $(OBJDIR)/$(BINARY) $(FLASHFILE) $(CODECS) $(ROCKS) $(ARCHOSROM) 56all: $(BUILDDIR)/$(BINARY) $(FLASHFILE) $(CODECS) $(ROCKS) $(ARCHOSROM)
56endif 57endif
57 58
58dep: $(DEPFILE) 59dep: $(DEPFILE)
59 60
60build-codecs: 61build-codecs:
61 @$(MAKE) -C codecs 62 @$(MAKE) -C codecs OBJDIR=$(OBJDIR)/codecs
62 63
63rocks: 64rocks:
64 @$(MAKE) -C plugins/lib 65 @$(MAKE) -C plugins/lib OBJDIR=$(OBJDIR)/plugins/lib
65 @$(MAKE) -C plugins 66 @$(MAKE) -C plugins OBJDIR=$(OBJDIR)/plugins
66
67$(OBJDIR)/librockbox.a:
68 @$(MAKE) -C $(FIRMDIR)
69 67
70$(LINKFILE): $(LDS) 68$(LINKFILE): $(LDS)
71 @echo "Build LDS file" 69 @echo "Build LDS file"
@@ -81,28 +79,28 @@ $(MAXOUTFILE):
81 @cat $(MAXINFILE) | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - > $(MAXOUTFILE) 79 @cat $(MAXINFILE) | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - > $(MAXOUTFILE)
82 @rm $(MAXINFILE) 80 @rm $(MAXINFILE)
83 81
84$(OBJDIR)/rombox.elf : $(OBJS) $(LINKROM) $(OBJDIR)/librockbox.a $(DEPFILE) 82$(OBJDIR)/rombox.elf : $(OBJS) $(LINKROM) $(DEPFILE)
85 @echo "LD rombox.elf" 83 @echo "LD rombox.elf"
86 @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMDIR) -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map 84 @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lgcc -L$(BUILDDIR)/firmware -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map
87 85
88ifndef SIMVER 86ifndef SIMVER
89 87
90$(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(OBJDIR)/librockbox.a $(DEPFILE) 88$(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(DEPFILE)
91 @echo "LD rockbox.elf" 89 @echo "LD rockbox.elf"
92 $(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map 90 @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR)/firmware -L$(BUILDDIR) -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map
93 91
94$(OBJDIR)/rockbox.bin : $(OBJDIR)/rockbox.elf 92$(OBJDIR)/rockbox.bin : $(OBJDIR)/rockbox.elf
95 @echo "OBJCOPY $<" 93 @echo "OBJCOPY "`basename $@`
96 @$(OC) -O binary $< $@ 94 @$(OC) -O binary $< $@
97 95
98$(OBJDIR)/rombox.bin : $(OBJDIR)/rombox.elf 96$(OBJDIR)/rombox.bin : $(OBJDIR)/rombox.elf
99 @echo "OBJCOPY $<" 97 @echo "OBJCOPY "`basename $@`
100 @$(OC) -O binary $< $@ 98 @$(OC) -O binary $< $@
101 99
102$(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin 100$(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin
103 $(TOOLSDIR)/sh2d -sh1 $< > $@ 101 $(TOOLSDIR)/sh2d -sh1 $< > $@
104 102
105$(OBJDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin 103$(BUILDDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin
106 @echo "Build firmware file" 104 @echo "Build firmware file"
107 @$(MKFIRMWARE) $< $@ 105 @$(MKFIRMWARE) $< $@
108 106
@@ -111,22 +109,23 @@ else
111 109
112ifeq ($(SIMVER), win32) 110ifeq ($(SIMVER), win32)
113# OK, this is ugly but we need it on the link line to make it do right 111# OK, this is ugly but we need it on the link line to make it do right
114EXTRAOBJ = $(OBJDIR)/uisw32-res.o 112EXTRAOBJ = $(BUILDDIR)/sim/uisw32-res.o
115endif 113endif
116 114
117 115
118$(OBJDIR)/$(BINARY) : $(OBJS) $(OBJDIR)/librockbox.a $(DEPFILE) $(OBJDIR)/libsim.a $(OBJDIR)/libcomsim.a 116$(BUILDDIR)/$(BINARY) : $(OBJS) $(DEPFILE) $(BUILDDIR)/libsim.a \
117 $(BUILDDIR)/libcomsim.a
119 @echo "LD $(BINARY)" 118 @echo "LD $(BINARY)"
120 $(CC) $(GCCOPTS) -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lsim -lcomsim $(LDOPTS) $(EXTRAOBJ) -Wl,-Map,$(OBJDIR)/rockbox.map 119 @$(CC) $(GCCOPTS) -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lsim -lcomsim $(LDOPTS) $(EXTRAOBJ) -Wl,-Map,$(OBJDIR)/rockbox.map
121 120
122$(OBJDIR)/libsim.a: 121$(BUILDDIR)/libsim.a:
123 @$(MAKE) -C $(SIMDIR) 122 @$(MAKE) -C $(SIMDIR) OBJDIR=$(BUILDDIR)/sim
124 123
125$(OBJDIR)/libcomsim.a: 124$(BUILDDIR)/libcomsim.a:
126 @$(MAKE) -C $(ROOTDIR)/uisimulator/common 125 @$(MAKE) -C $(ROOTDIR)/uisimulator/common OBJDIR=$(BUILDDIR)/comsim
127endif 126endif
128 127
129$(OBJDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin 128$(BUILDDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin
130 @a=`uclpack -h 2>/dev/null`; \ 129 @a=`uclpack -h 2>/dev/null`; \
131 if test -n "$$a"; then \ 130 if test -n "$$a"; then \
132 echo "UCLPACK rockbox" ; \ 131 echo "UCLPACK rockbox" ; \
@@ -136,7 +135,7 @@ $(OBJDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin
136 echo "fake" > $@; \ 135 echo "fake" > $@; \
137 fi 136 fi
138 137
139$(OBJDIR)/rombox.ucl: $(OBJDIR)/rombox.bin $(MAXOUTFILE) 138$(BUILDDIR)/rombox.ucl: $(OBJDIR)/rombox.bin $(MAXOUTFILE)
140 @a=`uclpack -h 2>/dev/null`; \ 139 @a=`uclpack -h 2>/dev/null`; \
141 if test -n "$$a"; then \ 140 if test -n "$$a"; then \
142 echo "UCLPACK rombox" ; \ 141 echo "UCLPACK rombox" ; \
@@ -157,7 +156,8 @@ $(OBJDIR)/rombox.ucl: $(OBJDIR)/rombox.bin $(MAXOUTFILE)
157 fi 156 fi
158 157
159$(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS 158$(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS
160 perl credits.pl < $< > $@ 159 @echo "create credits.raw"
160 @perl credits.pl < $< > $@
161 161
162$(OBJDIR)/credits.o: credits.c credits.h $(OBJDIR)/credits.raw 162$(OBJDIR)/credits.o: credits.c credits.h $(OBJDIR)/credits.raw
163 @mkdir -p `dirname $@` 163 @mkdir -p `dirname $@`
@@ -168,24 +168,26 @@ include $(TOOLSDIR)/make.inc
168 168
169$(OBJDIR)/build.lang: lang/$(LANGUAGE).lang $(TOOLSDIR)/uplang 169$(OBJDIR)/build.lang: lang/$(LANGUAGE).lang $(TOOLSDIR)/uplang
170 @echo "UPLANG" 170 @echo "UPLANG"
171 @mkdir -p `dirname $@`
171 @perl $(TOOLSDIR)/uplang lang/english.lang $< > $@ 172 @perl $(TOOLSDIR)/uplang lang/english.lang $< > $@
172 173
173$(OBJDIR)/lang.o: $(OBJDIR)/build.lang $(TOOLSDIR)/genlang 174$(OBJDIR)/lang.o: $(OBJDIR)/build.lang $(TOOLSDIR)/genlang
174 @echo "GENLANG" 175 @echo "GENLANG"
175 @perl -s $(TOOLSDIR)/genlang -p=$(OBJDIR)/lang $< 176 @mkdir -p `dirname $@`
177 @perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang $<
176 @echo "CC lang.c" 178 @echo "CC lang.c"
177 @$(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@ 179 @$(CC) $(CFLAGS) -c $(BUILDDIR)/lang.c -o $@
178 180
179clean: 181clean:
180 @echo "cleaning apps" 182 @echo "cleaning apps"
181 @-rm -f $(OBJS) $(OBJDIR)/$(BINARY) $(OBJDIR)/rockbox.asm \ 183 @-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/rockbox.asm \
182 $(OBJDIR)/rockbox.bin $(OBJDIR)/rockbox.elf $(OBJDIR)/*.map \ 184 $(OBJDIR)/rockbox.bin $(OBJDIR)/rockbox.elf $(OBJDIR)/*.map \
183 $(OBJDIR)/lang.o $(OBJDIR)/build.lang $(OBJDIR)/lang.[ch] \ 185 $(OBJDIR)/lang.o $(OBJDIR)/build.lang $(BUILDDIR)/lang.[ch] \
184 $(OBJDIR)/credits.raw $(LINKFILE) $(OBJDIR)/rockbox.ucl \ 186 $(OBJDIR)/credits.raw $(LINKFILE) $(BUILDDIR)/rockbox.ucl $(LINKROM) \
185 $(LINKROM) $(OBJDIR)/rombox.ucl $(OBJDIR)/rombox.bin \ 187 $(BUILDDIR)/rombox.ucl $(OBJDIR)/rombox.bin $(OBJDIR)/rombox.elf \
186 $(OBJDIR)/rombox.elf $(MAXOUTFILE) $(DEPFILE) 188 $(MAXOUTFILE) $(DEPFILE)
187 @$(MAKE) -C plugins clean 189 @$(MAKE) -C plugins clean OBJDIR=$(OBJDIR)/plugins
188 @$(MAKE) -C codecs clean 190 @$(MAKE) -C codecs clean OBJDIR=$(OBJDIR)/codecs
189 @rm -rf $(OBJDIR)/recorder $(OBJDIR)/player 191 @rm -rf $(OBJDIR)/recorder $(OBJDIR)/player
190ifdef SIMVER 192ifdef SIMVER
191 @$(MAKE) -C $(SIMDIR) clean 193 @$(MAKE) -C $(SIMDIR) clean
diff --git a/apps/codecs/Makefile b/apps/codecs/Makefile
index 341e0e67c2..ffd8eab44d 100644
--- a/apps/codecs/Makefile
+++ b/apps/codecs/Makefile
@@ -8,7 +8,7 @@
8# 8#
9 9
10INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \ 10INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
11 -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib 11 -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR)
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
13 -DMEM=${MEMORYSIZE} 13 -DMEM=${MEMORYSIZE}
14 14
@@ -28,44 +28,45 @@ include $(TOOLSDIR)/make.inc
28libmad: 28libmad:
29 @echo "MAKE in libmad" 29 @echo "MAKE in libmad"
30 @mkdir -p $(OBJDIR)/libmad 30 @mkdir -p $(OBJDIR)/libmad
31 @$(MAKE) -C libmad TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR)/libmad VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} OUTPUT=$(OBJDIR)/libmad.a 31 @$(MAKE) -C libmad OBJDIR=$(OBJDIR)/libmad OUTPUT=$(BUILDDIR)/libmad.a
32 32
33liba52: 33liba52:
34 @echo "MAKE in liba52" 34 @echo "MAKE in liba52"
35 @mkdir -p $(OBJDIR)/liba52 35 @mkdir -p $(OBJDIR)/liba52
36 @$(MAKE) -C liba52 TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR)/liba52 VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} OUTPUT=$(OBJDIR)/liba52.a 36 @$(MAKE) -C liba52 OBJDIR=$(OBJDIR)/liba52 OUTPUT=$(BUILDDIR)/liba52.a
37 37
38libFLAC: 38libFLAC:
39 @echo "MAKE in libFLAC" 39 @echo "MAKE in libFLAC"
40 @mkdir -p $(OBJDIR)/libFLAC 40 @mkdir -p $(OBJDIR)/libFLAC
41 @$(MAKE) -C libFLAC TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR)/libFLAC VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} OUTPUT=$(OBJDIR)/libFLAC.a 41 @$(MAKE) -C libFLAC OBJDIR=$(OBJDIR)/libFLAC OUTPUT=$(BUILDDIR)/libFLAC.a
42 42
43libTremor: 43libTremor:
44 @echo "MAKE in Tremor" 44 @echo "MAKE in Tremor"
45 @mkdir -p $(OBJDIR)/Tremor 45 @mkdir -p $(OBJDIR)/Tremor
46 @$(MAKE) -C Tremor TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR)/Tremor VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} OUTPUT=$(OBJDIR)/libTremor.a 46 @$(MAKE) -C Tremor OBJDIR=$(OBJDIR)/Tremor OUTPUT=$(BUILDDIR)/libTremor.a
47 47
48libwavpack: 48libwavpack:
49 @echo "MAKE in libwavpack" 49 @echo "MAKE in libwavpack"
50 @mkdir -p $(OBJDIR)/libwavpack 50 @mkdir -p $(OBJDIR)/libwavpack
51 @$(MAKE) -C libwavpack TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR)/libwavpack VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} OUTPUT=$(OBJDIR)/libwavpack.a 51 @$(MAKE) -C libwavpack OBJDIR=$(OBJDIR)/libwavpack OUTPUT=$(BUILDDIR)/libwavpack.a
52 52
53dumb: 53dumb:
54 @echo "MAKE in dumb" 54 @echo "MAKE in dumb"
55 @mkdir -p $(OBJDIR)/dumb 55 @mkdir -p $(OBJDIR)/dumb
56 @$(MAKE) -C dumb TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR)/dumb VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} LIBDIR=$(OBJDIR) OFLAGS="$(CFLAGS)" 56 @$(MAKE) -C dumb OBJDIR=$(OBJDIR)/dumb LIBDIR=$(BUILDDIR) OFLAGS="$(CFLAGS)"
57 57
58libmusepack: 58libmusepack:
59 @echo "MAKE in libmusepack" 59 @echo "MAKE in libmusepack"
60 @mkdir -p $(OBJDIR)/libmusepack 60 @mkdir -p $(OBJDIR)/libmusepack
61 @$(MAKE) -C libmusepack TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR)/libmusepack VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} OUTPUT=$(OBJDIR)/libmusepack.a 61 @$(MAKE) -C libmusepack OBJDIR=$(OBJDIR)/libmusepack OUTPUT=$(BUILDDIR)/libmusepack.a
62 62
63clean: 63clean:
64 @echo "cleaning codecs" 64 @echo "cleaning codecs"
65 @rm -fr $(OBJDIR)/libmad $(OBJDIR)/libmad.a $(OBJDIR)/liba52 $(OBJDIR)/libFLAC $(OBJDIR)/Tremor $(OBJDIR)/libwavpack $(OBJDIR)/dumb $(OBJDIR)/libdumb.a $(OBJDIR)/libdumbd.a $(OBJDIR)/libmusepack $(OBJDIR)/libmusepack.a 65 $(SILENT)rm -fr $(OBJDIR)/libmad $(BUILDDIR)/libmad.a $(OBJDIR)/liba52 $(OBJDIR)/libFLAC $(OBJDIR)/Tremor $(OBJDIR)/libwavpack $(OBJDIR)/dumb $(BUILDDIR)/libdumb.a $(BUILDDIR)/libdumbd.a $(OBJDIR)/libmusepack $(BUILDDIR)/libmusepack.a
66 @$(MAKE) -C libmad clean 66 @$(MAKE) -C libmad clean OBJDIR=$(OBJDIR)/libmad
67 @$(MAKE) -C liba52 clean 67 @$(MAKE) -C liba52 clean OBJDIR=$(OBJDIR)/liba52
68 @$(MAKE) -C libFLAC clean 68 @$(MAKE) -C libFLAC clean OBJDIR=$(OBJDIR)/libFLAC
69 @$(MAKE) -C Tremor clean 69 @$(MAKE) -C Tremor clean OBJDIR=$(OBJDIR)/Tremor
70 @$(MAKE) -C libwavpack clean 70 @$(MAKE) -C libwavpack clean OBJDIR=$(OBJDIR)/libwavpack
71 @$(MAKE) -C libmusepack clean 71 @$(MAKE) -C libmusepack clean OBJDIR=$(OBJDIR)/libmusepack
72 @$(MAKE) -C dumb clean OBJDIR=$(OBJDIR)/dumb
diff --git a/apps/codecs/Tremor/Makefile b/apps/codecs/Tremor/Makefile
index 5e97c60534..20e30bbbf6 100644
--- a/apps/codecs/Tremor/Makefile
+++ b/apps/codecs/Tremor/Makefile
@@ -8,14 +8,15 @@
8# 8#
9 9
10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers 11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
12 12
13ifdef APPEXTRA 13ifdef APPEXTRA
14INCLUDES += -I$(APPSDIR)/$(APPEXTRA) 14INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
15endif 15endif
16 16
17TREMOROPTS = 17TREMOROPTS =
18CFLAGS = $(GCCOPTS) $(TREMOROPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} 18CFLAGS = $(GCCOPTS) $(TREMOROPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
19-DMEM=${MEMORYSIZE}
19 20
20# This sets up 'SRC' based on the files mentioned in SOURCES 21# This sets up 'SRC' based on the files mentioned in SOURCES
21include $(TOOLSDIR)/makesrc.inc 22include $(TOOLSDIR)/makesrc.inc
@@ -26,7 +27,7 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
26DEPFILE = $(OBJDIR)/dep-Tremor 27DEPFILE = $(OBJDIR)/dep-Tremor
27DIRS = 28DIRS =
28 29
29OUTPUT = $(OBJDIR)/libTremor.a 30OUTPUT = $(BUILDDIR)/libTremor.a
30 31
31all: $(OUTPUT) 32all: $(OUTPUT)
32 33
@@ -35,7 +36,7 @@ $(OUTPUT): $(OBJS)
35 @$(AR) ruv $@ $+ >/dev/null 2>&1 36 @$(AR) ruv $@ $+ >/dev/null 2>&1
36 37
37$(OBJDIR)/Tremor/%.o: $(APPSDIR)/codecs/Tremor/%.c 38$(OBJDIR)/Tremor/%.o: $(APPSDIR)/codecs/Tremor/%.c
38 @echo "CC $<" 39 @echo "(Tremor) CC $<"
39 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/Tremor/ $< -o $@ 40 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/Tremor/ $< -o $@
40 41
41include $(TOOLSDIR)/make.inc 42include $(TOOLSDIR)/make.inc
diff --git a/apps/codecs/Tremor/config-tremor.h b/apps/codecs/Tremor/config-tremor.h
index e53c04898c..81aa5bffab 100644
--- a/apps/codecs/Tremor/config-tremor.h
+++ b/apps/codecs/Tremor/config-tremor.h
@@ -1,11 +1,12 @@
1#include "../codec.h" 1#include "../codec.h"
2 2
3#ifdef ROCKBOX_BIG_ENDIAN
3#define BIG_ENDIAN 1 4#define BIG_ENDIAN 1
4#define LITTLE_ENDIAN 0 5#define LITTLE_ENDIAN 0
5#define _LOW_ACCURACY_ 6#define BYTE_ORDER BIG_ENDIAN
6
7#ifdef SIMULATOR
8 #define BYTE_ORDER LITTLE_ENDIAN
9#else 7#else
10 #define BYTE_ORDER BIG_ENDIAN 8#define BYTE_ORDER LITTLE_ENDIAN
9#define LITTLE_ENDIAN 1
10#define BIG_ENDIAN 0
11#endif 11#endif
12#define _LOW_ACCURACY_
diff --git a/apps/codecs/libFLAC/Makefile b/apps/codecs/libFLAC/Makefile
index 1c8b0682a7..9da55ba0e2 100644
--- a/apps/codecs/libFLAC/Makefile
+++ b/apps/codecs/libFLAC/Makefile
@@ -7,8 +7,9 @@
7# $Id$ 7# $Id$
8# 8#
9 9
10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(APPSDIR)/codecs/libFLAC/include 11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(APPSDIR)/codecs/libFLAC/include \
12 -I$(BUILDDIR)
12 13
13ifdef APPEXTRA 14ifdef APPEXTRA
14INCLUDES += -I$(APPSDIR)/$(APPEXTRA) 15INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
@@ -16,9 +17,10 @@ endif
16 17
17NEWGCC=$(shell expr $(GCCNUM) ">" 303) 18NEWGCC=$(shell expr $(GCCNUM) ">" 303)
18 19
19FLACOPTS = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA \ 20FLACOPTS = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA \
20-DFLAC__INTEGER_ONLY_LIBRARY -DVERSION=\"1.1.2\" -fomit-frame-pointer \ 21-DFLAC__INTEGER_ONLY_LIBRARY -DVERSION=\"1.1.2\" -fomit-frame-pointer \
21-funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__ 22-funroll-loops -finline-functions -Wall -W -Wno-inline \
23-DFLaC__INLINE=__inline__
22 24
23ifeq ($(NEWGCC), 1) 25ifeq ($(NEWGCC), 1)
24 # this is 3.4.X options: 26 # this is 3.4.X options:
@@ -37,7 +39,7 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
37DEPFILE = $(OBJDIR)/dep-libFLAC 39DEPFILE = $(OBJDIR)/dep-libFLAC
38DIRS = 40DIRS =
39 41
40OUTPUT = $(OBJDIR)/libFLAC.a 42OUTPUT = $(BUILDDIR)/libFLAC.a
41 43
42all: $(OUTPUT) 44all: $(OUTPUT)
43 45
@@ -47,7 +49,7 @@ $(OUTPUT): $(OBJS)
47 49
48$(OBJDIR)/libFLAC/%.o: $(APPSDIR)/codecs/libFLAC/%.c 50$(OBJDIR)/libFLAC/%.o: $(APPSDIR)/codecs/libFLAC/%.c
49 @mkdir -p $(OBJDIR)/libFLAC 51 @mkdir -p $(OBJDIR)/libFLAC
50 @echo "CC $<" 52 @echo "(libFLAC) CC $<"
51 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libFLAC/include/FLAC $< -o $@ 53 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libFLAC/include/FLAC $< -o $@
52 54
53include $(TOOLSDIR)/make.inc 55include $(TOOLSDIR)/make.inc
diff --git a/apps/codecs/liba52/Makefile b/apps/codecs/liba52/Makefile
index 7baa71feb0..b31903f492 100644
--- a/apps/codecs/liba52/Makefile
+++ b/apps/codecs/liba52/Makefile
@@ -8,7 +8,7 @@
8# 8#
9 9
10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers 11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
12 12
13ifdef APPEXTRA 13ifdef APPEXTRA
14INCLUDES += -I$(APPSDIR)/$(APPEXTRA) 14INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
@@ -26,7 +26,7 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
26DEPFILE = $(OBJDIR)/dep-liba52 26DEPFILE = $(OBJDIR)/dep-liba52
27DIRS = 27DIRS =
28 28
29OUTPUT = $(OBJDIR)/liba52.a 29OUTPUT = $(BUILDDIR)/liba52.a
30 30
31all: $(OUTPUT) 31all: $(OUTPUT)
32 32
@@ -35,7 +35,7 @@ $(OUTPUT): $(OBJS)
35 @$(AR) ruv $@ $+ >/dev/null 2>&1 35 @$(AR) ruv $@ $+ >/dev/null 2>&1
36 36
37$(OBJDIR)/liba52/%.o: $(APPSDIR)/codecs/liba52/%.c 37$(OBJDIR)/liba52/%.o: $(APPSDIR)/codecs/liba52/%.c
38 @echo "CC $<" 38 @echo "(liba52) CC $<"
39 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/liba52/ $< -o $@ 39 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/liba52/ $< -o $@
40 40
41include $(TOOLSDIR)/make.inc 41include $(TOOLSDIR)/make.inc
diff --git a/apps/codecs/liba52/config-a52.h b/apps/codecs/liba52/config-a52.h
index 1aec4cda14..9e38034783 100644
--- a/apps/codecs/liba52/config-a52.h
+++ b/apps/codecs/liba52/config-a52.h
@@ -20,7 +20,7 @@
20 20
21/* Used in bitstream.h */ 21/* Used in bitstream.h */
22 22
23#ifndef SIMULATOR 23#ifdef ROCKBOX_BIG_ENDIAN
24#define WORDS_BIGENDIAN 1 24#define WORDS_BIGENDIAN 1
25#endif 25#endif
26 26
diff --git a/apps/codecs/libmad/Makefile b/apps/codecs/libmad/Makefile
index 74c726068e..1228cce16f 100644
--- a/apps/codecs/libmad/Makefile
+++ b/apps/codecs/libmad/Makefile
@@ -8,7 +8,7 @@
8# 8#
9 9
10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers 11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
12 12
13ifdef APPEXTRA 13ifdef APPEXTRA
14INCLUDES += -I$(APPSDIR)/$(APPEXTRA) 14INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
@@ -34,7 +34,7 @@ $(OUTPUT): $(OBJS)
34 $(AR) ruv $@ $+ >/dev/null 2>&1 34 $(AR) ruv $@ $+ >/dev/null 2>&1
35 35
36$(OBJDIR)/%.o: $(APPSDIR)/codecs/libmad/%.c 36$(OBJDIR)/%.o: $(APPSDIR)/codecs/libmad/%.c
37 @echo "CC $<" 37 @echo "(libmad) CC "`basename $<`
38 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libmad/ $< -o $@ 38 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libmad/ $< -o $@
39 39
40include $(TOOLSDIR)/make.inc 40include $(TOOLSDIR)/make.inc
diff --git a/apps/codecs/libwavpack/Makefile b/apps/codecs/libwavpack/Makefile
index 54d95be2c0..df26559f59 100644
--- a/apps/codecs/libwavpack/Makefile
+++ b/apps/codecs/libwavpack/Makefile
@@ -8,7 +8,7 @@
8# 8#
9 9
10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers 11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
12 12
13ifdef APPEXTRA 13ifdef APPEXTRA
14INCLUDES += -I$(APPSDIR)/$(APPEXTRA) 14INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
@@ -26,7 +26,7 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
26DEPFILE = $(OBJDIR)/dep-libwavpack 26DEPFILE = $(OBJDIR)/dep-libwavpack
27DIRS = 27DIRS =
28 28
29OUTPUT = $(OBJDIR)/libwavpack.a 29OUTPUT = $(BUILDDIR)/libwavpack.a
30 30
31all: $(OUTPUT) 31all: $(OUTPUT)
32 32
@@ -35,7 +35,7 @@ $(OUTPUT): $(OBJS)
35 @$(AR) ruv $@ $+ >/dev/null 2>&1 35 @$(AR) ruv $@ $+ >/dev/null 2>&1
36 36
37$(OBJDIR)/libwavpack/%.o: $(APPSDIR)/codecs/libwavpack/%.c 37$(OBJDIR)/libwavpack/%.o: $(APPSDIR)/codecs/libwavpack/%.c
38 @echo "CC $<" 38 @echo "(libwavpack) CC $<"
39 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libwavpack/ $< -o $@ 39 @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libwavpack/ $< -o $@
40 40
41include $(TOOLSDIR)/make.inc 41include $(TOOLSDIR)/make.inc
diff --git a/apps/database.c b/apps/database.c
index 615403dbed..c753362cd1 100644
--- a/apps/database.c
+++ b/apps/database.c
@@ -42,6 +42,7 @@
42#include "lang.h" 42#include "lang.h"
43#include "keyboard.h" 43#include "keyboard.h"
44#include "database.h" 44#include "database.h"
45#include "autoconf.h"
45 46
46#undef NEW_DB_CODE 47#undef NEW_DB_CODE
47 48
@@ -58,7 +59,7 @@ struct tagdb_header tagdbheader;
58int tagdb_init(void) 59int tagdb_init(void)
59{ 60{
60 unsigned char* ptr = (char*)&tagdbheader.version; 61 unsigned char* ptr = (char*)&tagdbheader.version;
61#ifdef LITTLE_ENDIAN 62#ifdef ROCKBOX_LITTLE_ENDIAN
62 int i, *p; 63 int i, *p;
63#endif 64#endif
64 65
@@ -76,7 +77,7 @@ int tagdb_init(void)
76 splash(HZ,true,"Not a rockbox ID3 database!"); 77 splash(HZ,true,"Not a rockbox ID3 database!");
77 return -1; 78 return -1;
78 } 79 }
79#ifdef LITTLE_ENDIAN 80#ifdef ROCKBOX_LITTLE_ENDIAN
80 p=(int *)&tagdbheader; 81 p=(int *)&tagdbheader;
81 for(i=0;i<17;i++) { 82 for(i=0;i<17;i++) {
82 *p=BE32(*p); 83 *p=BE32(*p);
diff --git a/apps/dbtree.c b/apps/dbtree.c
index 61879e32f1..0dc4112189 100644
--- a/apps/dbtree.c
+++ b/apps/dbtree.c
@@ -42,6 +42,7 @@
42#include "icons.h" 42#include "icons.h"
43#include "lang.h" 43#include "lang.h"
44#include "keyboard.h" 44#include "keyboard.h"
45#include "autoconf.h"
45 46
46static int db_play_folder(struct tree_context* c); 47static int db_play_folder(struct tree_context* c);
47static int db_search(struct tree_context* c, char* string); 48static int db_search(struct tree_context* c, char* string);
@@ -167,7 +168,7 @@ int db_load(struct tree_context* c)
167 if (rc < safeplacelen) 168 if (rc < safeplacelen)
168 return -1; 169 return -1;
169 170
170#ifdef LITTLE_ENDIAN 171#ifdef ROCKBOX_LITTLE_ENDIAN
171 for (i=0; i<tagdbheader.albumarraylen; i++) 172 for (i=0; i<tagdbheader.albumarraylen; i++)
172 safeplace[i] = BE32(safeplace[i]); 173 safeplace[i] = BE32(safeplace[i]);
173#endif 174#endif
@@ -186,7 +187,7 @@ int db_load(struct tree_context* c)
186 if (rc < safeplacelen) 187 if (rc < safeplacelen)
187 return -1; 188 return -1;
188 189
189#ifdef LITTLE_ENDIAN 190#ifdef ROCKBOX_LITTLE_ENDIAN
190 for (i=0; i<tagdbheader.songarraylen; i++) { 191 for (i=0; i<tagdbheader.songarraylen; i++) {
191 safeplace[i] = BE32(safeplace[i]); 192 safeplace[i] = BE32(safeplace[i]);
192 DEBUGF("db_load songs4album song %d: 0x%x\n",i,safeplace[i]); 193 DEBUGF("db_load songs4album song %d: 0x%x\n",i,safeplace[i]);
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index 38cd723ae0..23bc12d71a 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -8,7 +8,7 @@
8# 8#
9 9
10INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \ 10INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
11 -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib 11 -I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR)
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
13 -DMEM=${MEMORYSIZE} -DPLUGIN 13 -DMEM=${MEMORYSIZE} -DPLUGIN
14 14
@@ -48,15 +48,15 @@ endif
48 48
49 49
50.PHONY: $(SUBDIRS) 50.PHONY: $(SUBDIRS)
51all: $(OBJDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) 51all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
52 52
53ifndef SIMVER 53ifndef SIMVER
54$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a 54$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a
55 @echo "LD $@" 55 @echo "LD "`basename $@`
56 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map 56 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(BUILDDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
57 57
58$(OBJDIR)/%.rock : $(OBJDIR)/%.elf 58$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
59 @echo "OBJCOPY $<" 59 @echo "OBJCOPY "`basename $@`
60 @$(OC) -O binary $< $@ 60 @$(OC) -O binary $< $@
61else 61else
62 62
@@ -64,9 +64,9 @@ ifeq ($(SIMVER), x11)
64################################################### 64###################################################
65# This is the X11 simulator version 65# This is the X11 simulator version
66 66
67$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(OBJDIR)/libplugin.a 67$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a
68 @echo "LD $@" 68 @echo "LD "`basename $@`
69 @$(CC) $(CFLAGS) -shared $< -L$(OBJDIR) $(CODECLIBS) -lplugin -o $@ 69 @$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lplugin -o $@
70ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 70ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
71# 'x' must be kept or you'll have "Win32 error 5" 71# 'x' must be kept or you'll have "Win32 error 5"
72# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 72# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -81,11 +81,11 @@ else # end of x11-simulator
81DLLTOOLFLAGS = --export-all 81DLLTOOLFLAGS = --export-all
82DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin 82DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
83 83
84$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(OBJDIR)/libplugin.a 84$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a
85 @echo "DLL $@" 85 @echo "DLL "`basename $@`
86 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $< 86 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
87 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/libplugin.a \ 87 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(BUILDDIR)/libplugin.a \
88 $(patsubst -l%,$(OBJDIR)/lib%.a,$(CODECLIBS)) -o $@ 88 $(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) -o $@
89ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 89ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
90# 'x' must be kept or you'll have "Win32 error 5" 90# 'x' must be kept or you'll have "Win32 error 5"
91# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 91# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -99,9 +99,10 @@ endif # end of simulator section
99 99
100include $(TOOLSDIR)/make.inc 100include $(TOOLSDIR)/make.inc
101 101
102$(OBJDIR)/libplugin.a: 102$(BUILDDIR)/libplugin.a:
103 @echo "MAKE in lib" 103 @echo "MAKE in lib"
104 @$(MAKE) -C lib TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} 104 @mkdir -p $(OBJDIR)/lib
105 @$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib
105 106
106# MEM should be passed on to this makefile with the chosen memory size given 107# MEM should be passed on to this makefile with the chosen memory size given
107# in number of MB 108# in number of MB
@@ -112,14 +113,14 @@ $(LINKFILE): $(LDS)
112$(SUBDIRS): 113$(SUBDIRS):
113 @echo "MAKE in $@" 114 @echo "MAKE in $@"
114 @mkdir -p $(OBJDIR)/$@ 115 @mkdir -p $(OBJDIR)/$@
115 @$(MAKE) -C $@ TARGET=$(TARGET) DEBUG=$(DEBUG) OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@ VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE} 116 @$(MAKE) -C $@ OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@
116 117
117clean: 118clean:
118 @echo "cleaning plugins" 119 @echo "cleaning plugins"
119 @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \ 120 @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
120 $(OBJS) $(DEFS) 121 $(OBJS) $(DEFS)
121 @$(MAKE) -C lib clean 122 @$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib
122 @$(MAKE) -C rockboy clean 123 @$(MAKE) -C rockboy clean OBJDIR=$(OBJDIR)/rockboy
123 @$(MAKE) -C searchengine clean 124 @$(MAKE) -C searchengine clean OBJDIR=$(OBJDIR)/searchengine
124 125
125-include $(DEPFILE) 126-include $(DEPFILE)
diff --git a/apps/plugins/a52towav.c b/apps/plugins/a52towav.c
index 7bec8f290f..32353d823f 100644
--- a/apps/plugins/a52towav.c
+++ b/apps/plugins/a52towav.c
@@ -31,17 +31,10 @@
31 31
32static struct plugin_api* rb; 32static struct plugin_api* rb;
33 33
34/* FIX: We can remove this warning when the build system has a
35 mechanism for auto-detecting the endianness of the target CPU -
36 WORDS_BIGENDIAN is defined in liba52/config.h and is also used
37 internally by liba52.
38 */
39
40#ifdef WORDS_BIGENDIAN 34#ifdef WORDS_BIGENDIAN
41 #warning ************************************* BIG ENDIAN 35#define LE_S16(x) ( (uint16_t) ( ((uint16_t)(x) >> 8) | ((uint16_t)(x) << 8) ) )
42 #define LE_S16(x) ( (uint16_t) ( ((uint16_t)(x) >> 8) | ((uint16_t)(x) << 8) ) )
43#else 36#else
44 #define LE_S16(x) (x) 37#define LE_S16(x) (x)
45#endif 38#endif
46 39
47 40
diff --git a/apps/plugins/lib/Makefile b/apps/plugins/lib/Makefile
index fbd4cefbe0..21dea571ae 100644
--- a/apps/plugins/lib/Makefile
+++ b/apps/plugins/lib/Makefile
@@ -11,7 +11,7 @@
11# .. for stuff in the plugins dir 11# .. for stuff in the plugins dir
12# . for stuff in the pluginlib dir 12# . for stuff in the pluginlib dir
13INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 13INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
14 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers 14 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
15 15
16ifdef APPEXTRA 16ifdef APPEXTRA
17INCLUDES += -I$(APPSDIR)/$(APPEXTRA) 17INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
@@ -28,7 +28,7 @@ OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
28DEPFILE = $(OBJDIR)/dep-pluginlib 28DEPFILE = $(OBJDIR)/dep-pluginlib
29DIRS = . 29DIRS = .
30 30
31OUTPUT = $(OBJDIR)/libplugin.a 31OUTPUT = $(BUILDDIR)/libplugin.a
32 32
33all: $(OUTPUT) 33all: $(OUTPUT)
34 34
diff --git a/apps/plugins/mpc2wav.c b/apps/plugins/mpc2wav.c
index 747fbdc9ae..b1478bac31 100644
--- a/apps/plugins/mpc2wav.c
+++ b/apps/plugins/mpc2wav.c
@@ -77,8 +77,8 @@ get_size_impl(void *data)
77bool 77bool
78canseek_impl(void *data) 78canseek_impl(void *data)
79{ 79{
80 file_info_struct *f = (file_info_struct *)data; 80 (void)data;
81 return true; 81 return true;
82} 82}
83 83
84static int 84static int
@@ -110,7 +110,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
110 file_info_struct file_info; 110 file_info_struct file_info;
111 unsigned short Sample; 111 unsigned short Sample;
112 unsigned status = 1; 112 unsigned status = 1;
113 int i; 113 unsigned int i;
114 mpc_reader reader; 114 mpc_reader reader;
115 115
116 /* Generic plugin inititialisation */ 116 /* Generic plugin inititialisation */
diff --git a/apps/plugins/rockboy/Makefile b/apps/plugins/rockboy/Makefile
index 020d67bec8..dab4aa871e 100644
--- a/apps/plugins/rockboy/Makefile
+++ b/apps/plugins/rockboy/Makefile
@@ -7,8 +7,8 @@
7# $Id$ 7# $Id$
8# 8#
9 9
10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers 11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
12CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
13 -DMEM=${MEMORYSIZE} -DPLUGIN 13 -DMEM=${MEMORYSIZE} -DPLUGIN
14 14
@@ -46,13 +46,13 @@ endif
46all: $(OUTPUT) 46all: $(OUTPUT)
47 47
48ifndef SIMVER 48ifndef SIMVER
49$(OBJDIR)/rockboy.elf: $(OBJS) $(LINKFILE) $(OUTDIR)/libplugin.a 49$(OBJDIR)/rockboy.elf: $(OBJS) $(LINKFILE)
50 @echo "LD $@" 50 @echo "LD "`basename $@`
51 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(OUTDIR) -lplugin -lgcc \ 51 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
52 -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockboy.map 52 -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockboy.map
53 53
54$(OUTPUT): $(OBJDIR)/rockboy.elf 54$(OUTPUT): $(OBJDIR)/rockboy.elf
55 @echo "OBJCOPY $<" 55 @echo "OBJCOPY "`basename $@`
56 @$(OC) -O binary $< $@ 56 @$(OC) -O binary $< $@
57else 57else
58 58
@@ -60,9 +60,9 @@ ifeq ($(SIMVER), x11)
60################################################### 60###################################################
61# This is the X11 simulator version 61# This is the X11 simulator version
62 62
63$(OUTPUT): $(OBJS) $(OUTDIR)/libplugin.a 63$(OUTPUT): $(OBJS)
64 @echo "LD $@" 64 @echo "LD $@"
65 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(OUTDIR) -lplugin -o $@ 65 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
66ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 66ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
67# 'x' must be kept or you'll have "Win32 error 5" 67# 'x' must be kept or you'll have "Win32 error 5"
68# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 68# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -77,11 +77,11 @@ else # end of x11-simulator
77DLLTOOLFLAGS = --export-all 77DLLTOOLFLAGS = --export-all
78DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin 78DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
79 79
80$(OUTPUT): $(OBJS) $(OUTDIR)/libplugin.a 80$(OUTPUT): $(OBJS)
81 @echo "DLL $@" 81 @echo "DLL $@"
82 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS) 82 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
83 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \ 83 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
84 $(OUTDIR)/libplugin.a -o $@ 84 $(BUILDDIR)/libplugin.a -o $@
85ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 85ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
86# 'x' must be kept or you'll have "Win32 error 5" 86# 'x' must be kept or you'll have "Win32 error 5"
87# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 87# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -96,10 +96,10 @@ endif # end of simulator section
96 96
97include $(TOOLSDIR)/make.inc 97include $(TOOLSDIR)/make.inc
98 98
99# MEM should be passed on to this makefile with the chosen memory size given 99# MEMORYSIZE should be passed on to this makefile with the chosen memory size
100# in number of MB 100# given in number of MB
101$(LINKFILE): $(LDS) 101$(LINKFILE): $(LDS)
102 @echo "build $@" 102 @echo "build "`basename $@`
103 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \ 103 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
104 -E -P - >$@ 104 -E -P - >$@
105 105
diff --git a/apps/plugins/rockboy/defs.h b/apps/plugins/rockboy/defs.h
index 4c520ef698..fc929635cf 100644
--- a/apps/plugins/rockboy/defs.h
+++ b/apps/plugins/rockboy/defs.h
@@ -6,7 +6,7 @@
6 6
7#include "rockmacros.h" 7#include "rockmacros.h"
8 8
9#ifdef LITTLE_ENDIAN 9#ifdef ROCKBOX_LITTLE_ENDIAN
10#define LO 0 10#define LO 0
11#define HI 1 11#define HI 1
12#else 12#else
diff --git a/apps/plugins/rockboy/fastmem.c b/apps/plugins/rockboy/fastmem.c
index ffb0ed5371..d883438ce1 100644
--- a/apps/plugins/rockboy/fastmem.c
+++ b/apps/plugins/rockboy/fastmem.c
@@ -69,7 +69,7 @@ int readw(int a)
69 byte *p = mbc.rmap[a>>12]; 69 byte *p = mbc.rmap[a>>12];
70 if (p) 70 if (p)
71 { 71 {
72#ifdef LITTLE_ENDIAN 72#ifdef ROCKBOX_LITTLE_ENDIAN
73#ifndef ALLOW_UNALIGNED_IO 73#ifndef ALLOW_UNALIGNED_IO
74 if (a&1) return p[a] | (p[a+1]<<8); 74 if (a&1) return p[a] | (p[a+1]<<8);
75#endif 75#endif
@@ -89,7 +89,7 @@ void writew(int a, int w)
89 byte *p = mbc.wmap[a>>12]; 89 byte *p = mbc.wmap[a>>12];
90 if (p) 90 if (p)
91 { 91 {
92#ifdef LITTLE_ENDIAN 92#ifdef ROCKBOX_LITTLE_ENDIAN
93#ifndef ALLOW_UNALIGNED_IO 93#ifndef ALLOW_UNALIGNED_IO
94 if (a&1) 94 if (a&1)
95 { 95 {
diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h
index a6ca0f7231..03a6810a55 100644
--- a/apps/plugins/rockboy/rockmacros.h
+++ b/apps/plugins/rockboy/rockmacros.h
@@ -19,10 +19,7 @@
19 19
20#include <plugin.h> 20#include <plugin.h>
21 21
22/* workaround for cygwin not defining endian macros */ 22#include "autoconf.h"
23#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) && defined(_X86_)
24#define LITTLE_ENDIAN
25#endif
26 23
27#define malloc(a) my_malloc(a) 24#define malloc(a) my_malloc(a)
28void *my_malloc(size_t size); 25void *my_malloc(size_t size);
diff --git a/apps/plugins/rockboy/save.c b/apps/plugins/rockboy/save.c
index dc94ce69ff..f14a7191c1 100644
--- a/apps/plugins/rockboy/save.c
+++ b/apps/plugins/rockboy/save.c
@@ -15,7 +15,7 @@
15 15
16 16
17 17
18#ifdef LITTLE_ENDIAN 18#ifdef ROCKBOX_LITTLE_ENDIAN
19#define LIL(x) (x) 19#define LIL(x) (x)
20#else 20#else
21#define LIL(x) ((x<<24)|((x&0xff00)<<8)|((x>>8)&0xff00)|(x>>24)) 21#define LIL(x) ((x<<24)|((x&0xff00)<<8)|((x>>8)&0xff00)|(x>>24))
diff --git a/apps/plugins/searchengine/Makefile b/apps/plugins/searchengine/Makefile
index e6e980b7b0..e59bd8fbde 100644
--- a/apps/plugins/searchengine/Makefile
+++ b/apps/plugins/searchengine/Makefile
@@ -7,8 +7,8 @@
7# $Id$ 7# $Id$
8# 8#
9 9
10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) 11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
13 -DMEM=${MEMORYSIZE} -DPLUGIN 13 -DMEM=${MEMORYSIZE} -DPLUGIN
14 14
@@ -30,13 +30,13 @@ OUTPUT = $(OUTDIR)/searchengine.rock
30all: $(OUTPUT) 30all: $(OUTPUT)
31 31
32ifndef SIMVER 32ifndef SIMVER
33$(OBJDIR)/searchengine.elf: $(OBJS) $(LINKFILE) $(OUTDIR)/libplugin.a 33$(OBJDIR)/searchengine.elf: $(OBJS) $(LINKFILE)
34 @echo "LD $@" 34 @echo "LD "`basename $@`
35 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(OUTDIR) -lplugin -lgcc \ 35 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
36 -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/searchengine.map 36 -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/searchengine.map
37 37
38$(OUTPUT): $(OBJDIR)/searchengine.elf 38$(OUTPUT): $(OBJDIR)/searchengine.elf
39 @echo "OBJCOPY $<" 39 @echo "OBJCOPY "`basename $@`
40 @$(OC) -O binary $< $@ 40 @$(OC) -O binary $< $@
41else 41else
42 42
@@ -44,9 +44,9 @@ ifeq ($(SIMVER), x11)
44################################################### 44###################################################
45# This is the X11 simulator version 45# This is the X11 simulator version
46 46
47$(OUTPUT): $(OBJS) $(OUTDIR)/libplugin.a 47$(OUTPUT): $(OBJS)
48 @echo "LD $@" 48 @echo "LD $<"
49 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(OUTDIR) -lplugin -o $@ 49 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
50ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 50ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
51# 'x' must be kept or you'll have "Win32 error 5" 51# 'x' must be kept or you'll have "Win32 error 5"
52# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 52# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -61,11 +61,11 @@ else # end of x11-simulator
61DLLTOOLFLAGS = --export-all 61DLLTOOLFLAGS = --export-all
62DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin 62DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
63 63
64$(OUTPUT): $(OBJS) $(OUTDIR)/libplugin.a 64$(OUTPUT): $(OBJS)
65 @echo "DLL $@" 65 @echo "DLL $@"
66 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS) 66 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
67 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \ 67 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
68 $(OUTDIR)/libplugin.a -o $@ 68 $(BUILDDIR)/libplugin.a -o $@
69ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 69ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
70# 'x' must be kept or you'll have "Win32 error 5" 70# 'x' must be kept or you'll have "Win32 error 5"
71# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 71# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -80,12 +80,12 @@ endif # end of simulator section
80 80
81include $(TOOLSDIR)/make.inc 81include $(TOOLSDIR)/make.inc
82 82
83# MEM should be passed on to this makefile with the chosen memory size given 83# MEMORYSIZE should be passed on to this makefile with the chosen memory size
84# in number of MB 84# given in number of MB
85$(LINKFILE): $(LDS) 85$(LINKFILE): $(LDS)
86 @echo "build $@" 86 @echo "build "`basename $@`
87 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \ 87 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
88 -E -P - >$@ 88 $(DEFINES) -E -P - >$@
89 89
90clean: 90clean:
91 @echo "cleaning searchengine" 91 @echo "cleaning searchengine"
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index 0512f37497..841244057f 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -59,10 +59,9 @@ struct Fileheader {
59} STRUCT_PACKED; 59} STRUCT_PACKED;
60 60
61 61
62#ifdef LITTLE_ENDIAN 62#ifdef ROCKBOX_LITTLE_ENDIAN
63#define readshort(x) x 63#define readshort(x) x
64#define readlong(x) x 64#define readlong(x) x
65
66#else 65#else
67 66
68/* Endian functions */ 67/* Endian functions */
diff --git a/firmware/Makefile b/firmware/Makefile
index a858edfe7c..7211b3775f 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -7,7 +7,7 @@
7# $Id$ 7# $Id$
8# 8#
9 9
10INCLUDES=-Iinclude -I$(FIRMDIR) -Iexport -Icommon -Idrivers 10INCLUDES=-Iinclude -I$(FIRMDIR) -Iexport -Icommon -Idrivers -I$(BUILDDIR)
11 11
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} 12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
13 13
@@ -18,18 +18,15 @@ SOURCES = $(SRC)
18OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o 18OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o
19OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) 19OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
20DIRS:=. drivers common 20DIRS:=. drivers common
21OUTPUT = $(OBJDIR)/librockbox.a 21OUTPUT = $(BUILDDIR)/librockbox.a
22DEPFILE = $(OBJDIR)/dep-firmware 22DEPFILE = $(OBJDIR)/dep-firmware
23 23
24all: $(TOOLSDIR)/convbdf $(OUTPUT) $(EXTRA_TARGETS) 24all: $(OUTPUT) $(EXTRA_TARGETS)
25 25
26dep: $(DEPFILE) 26dep: $(DEPFILE)
27 27
28$(TOOLSDIR)/convbdf:
29 $(MAKE) CC=gcc LD=ld -C $(TOOLSDIR)
30
31$(OUTPUT): $(OBJS) $(DEPFILE) 28$(OUTPUT): $(OBJS) $(DEPFILE)
32 @echo "AR $@" 29 @echo "AR+RANLIB $@"
33 @$(AR) ruv $@ $(OBJS) >/dev/null 2>&1 30 @$(AR) ruv $@ $(OBJS) >/dev/null 2>&1
34 @$(RANLIB) $@ 31 @$(RANLIB) $@
35 32
@@ -42,13 +39,13 @@ clean:
42 39
43# Special targets 40# Special targets
44$(OBJDIR)/thread.o: thread.c export/thread.h 41$(OBJDIR)/thread.o: thread.c export/thread.h
45 @echo "CC thread.c" 42 $(SILENT)echo "CC thread.c"
46 @$(CC) -c -O -fomit-frame-pointer $(CFLAGS) $< -o $@ 43 $(SILENT)$(CC) -c -O -fomit-frame-pointer $(CFLAGS) $< -o $@
47 44
48$(OBJDIR)/sysfont.o: fonts/clR6x8.bdf 45$(OBJDIR)/sysfont.o: fonts/clR6x8.bdf
49 @echo "CONVBDF" 46 @echo "CONVBDF"
50 @$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $< 47 $(SILENT)$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $<
51 @echo "CC sysfont.c" 48 @echo "CC sysfont.c"
52 @$(CC) $(CFLAGS) -c $(OBJDIR)/sysfont.c -o $@ 49 $(SILENT)$(CC) $(CFLAGS) -c $(OBJDIR)/sysfont.c -o $@
53 50
54-include $(DEPFILE) 51-include $(DEPFILE)
diff --git a/firmware/export/config.h b/firmware/export/config.h
index a47581afc7..a7ef70f24d 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -20,6 +20,8 @@
20#ifndef __CONFIG_H__ 20#ifndef __CONFIG_H__
21#define __CONFIG_H__ 21#define __CONFIG_H__
22 22
23#include "autoconf.h"
24
23/* symbolic names for multiple choice configurations: */ 25/* symbolic names for multiple choice configurations: */
24 26
25/* CONFIG_TUNER (note these are combineable bit-flags) */ 27/* CONFIG_TUNER (note these are combineable bit-flags) */
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 1876bc3aaa..bc54be3e1c 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -51,7 +51,7 @@ void cpu_boost(bool on_off);
51#define MAX(a, b) (((a)>(b))?(a):(b)) 51#define MAX(a, b) (((a)>(b))?(a):(b))
52#endif 52#endif
53 53
54#ifdef LITTLE_ENDIAN 54#ifdef ROCKBOX_LITTLE_ENDIAN
55#define SWAB16(x) (x) 55#define SWAB16(x) (x)
56#define SWAB32(x) (x) 56#define SWAB32(x) (x)
57#endif 57#endif
diff --git a/tools/configure b/tools/configure
index aecdda4b14..34d80328b9 100755
--- a/tools/configure
+++ b/tools/configure
@@ -589,8 +589,14 @@ fi
589sed > autoconf.h \ 589sed > autoconf.h \
590 -e "s,@ENDIAN@,${defendian},g" \ 590 -e "s,@ENDIAN@,${defendian},g" \
591<<EOF 591<<EOF
592/* This header was made by configure */
593#ifndef __BUILD_AUTOCONF_H
594#define __BUILD_AUTOCONF_H
595
592/* Define endianess for the target or simulator platform */ 596/* Define endianess for the target or simulator platform */
593#define @ENDIAN@ 1 597#define @ENDIAN@ 1
598
599#endif /* __BUILD_AUTOCONF_H */
594EOF 600EOF
595 601
596sed > Makefile \ 602sed > Makefile \
@@ -641,7 +647,7 @@ export ARCHOSROM=@ARCHOSROM@
641export FLASHFILE=@FLASHFILE@ 647export FLASHFILE=@FLASHFILE@
642export TARGET=@TARGET@ 648export TARGET=@TARGET@
643export OBJDIR=@PWD@ 649export OBJDIR=@PWD@
644export BUILDDIR=\$(OBJDIR) 650export BUILDDIR=@PWD@
645export LANGUAGE=@LANGUAGE@ 651export LANGUAGE=@LANGUAGE@
646export MEMORYSIZE=@MEMORY@ 652export MEMORYSIZE=@MEMORY@
647export VERSION=\$(shell date +%y%m%d-%H%M) 653export VERSION=\$(shell date +%y%m%d-%H%M)
@@ -675,13 +681,13 @@ MAKEFLAGS += --no-print-directory
675.PHONY: all clean tags zip 681.PHONY: all clean tags zip
676 682
677all: 683all:
678 @\$(MAKE) -C \$(FIRMDIR) 684 @\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
679 @\$(MAKE) -C \$(APPSDIR) 685 @\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/apps
680 686
681clean: 687clean:
682 @\$(MAKE) -C \$(FIRMDIR) clean 688 @\$(MAKE) -C \$(FIRMDIR) clean OBJDIR=\$(BUILDDIR)/firmware
683 @\$(MAKE) -C \$(APPSDIR) clean 689 @\$(MAKE) -C \$(APPSDIR) clean OBJDIR=\$(BUILDDIR)/apps
684 @rm -f rockbox.zip TAGS 690 @rm -rf rockbox.zip TAGS apps firmware comsim sim
685 691
686tags: 692tags:
687 @rm -f TAGS 693 @rm -f TAGS
diff --git a/tools/make.inc b/tools/make.inc
index 9e6600f77a..ea9815b6d2 100644
--- a/tools/make.inc
+++ b/tools/make.inc
@@ -17,6 +17,7 @@ $(OBJDIR)/%.o: %.S
17# the lame echo stuff down here is to prevent any compiler errors/warnings 17# the lame echo stuff down here is to prevent any compiler errors/warnings
18# to cause an error code to get returned and thus stop the build 18# to cause an error code to get returned and thus stop the build
19$(DEPFILE): $(SOURCES) 19$(DEPFILE): $(SOURCES)
20 $(SILENT)mkdir -p `dirname $(DEPFILE)`
20 $(SILENT)rm -f $(DEPFILE) 21 $(SILENT)rm -f $(DEPFILE)
21 $(SILENT)(for each in $(SOURCES) x; do \ 22 $(SILENT)(for each in $(SOURCES) x; do \
22 if test "x" != "$$each"; then \ 23 if test "x" != "$$each"; then \
diff --git a/uisimulator/common/Makefile b/uisimulator/common/Makefile
index 62a124ac97..e4f3dd93c2 100644
--- a/uisimulator/common/Makefile
+++ b/uisimulator/common/Makefile
@@ -23,7 +23,8 @@ RM = rm -f
23DEBUG = -g 23DEBUG = -g
24 24
25# Use this for simulator-only files 25# Use this for simulator-only files
26INCLUDES = -I. -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) -I$(ROOTDIR)/uisimulator/$(SIMVER) 26INCLUDES = -I. -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) \
27-I$(ROOTDIR)/uisimulator/$(SIMVER) -I$(BUILDDIR)
27 28
28# This sets up 'SRC' based on the files mentioned in SOURCES 29# This sets up 'SRC' based on the files mentioned in SOURCES
29include $(TOOLSDIR)/makesrc.inc 30include $(TOOLSDIR)/makesrc.inc
@@ -39,7 +40,7 @@ DIRS = .
39 40
40CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS) 41CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS)
41 42
42OUTFILE = $(OBJDIR)/libcomsim.a 43OUTFILE = $(BUILDDIR)/libcomsim.a
43 44
44all: $(OUTFILE) 45all: $(OUTFILE)
45 46
diff --git a/uisimulator/win32/Makefile b/uisimulator/win32/Makefile
index f04a54bdd4..1921e54ca3 100644
--- a/uisimulator/win32/Makefile
+++ b/uisimulator/win32/Makefile
@@ -24,7 +24,8 @@ DEPFILE = $(OBJDIR)/dep-simwin
24RM = rm -f 24RM = rm -f
25DEBUG = -g 25DEBUG = -g
26 26
27INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) 27INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) \
28 -I$(BUILDDIR)
28 29
29DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ 30DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
30$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES) 31$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
@@ -39,7 +40,7 @@ DIRS = .
39 40
40CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin 41CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin
41 42
42OUTFILE = $(OBJDIR)/libsim.a 43OUTFILE = $(BUILDDIR)/libsim.a
43 44
44all: $(OUTFILE) 45all: $(OUTFILE)
45 @echo "MAKE in common sim" 46 @echo "MAKE in common sim"
@@ -62,7 +63,8 @@ $(OBJDIR)/UI256.bmp: UI-$(ARCHOS).bmp
62 @cp $< $@ 63 @cp $< $@
63 64
64$(OBJDIR)/uisw32-res.o: uisw32.rc $(OBJDIR)/UI256.bmp 65$(OBJDIR)/uisw32-res.o: uisw32.rc $(OBJDIR)/UI256.bmp
65 $(WINDRES) --include-dir $(OBJDIR) -i $< -o $@ 66 @echo "WINDRES"
67 @$(WINDRES) --include-dir $(OBJDIR) -i $< -o $@
66 68
67include $(TOOLSDIR)/make.inc 69include $(TOOLSDIR)/make.inc
68 70
diff --git a/uisimulator/x11/Makefile b/uisimulator/x11/Makefile
index f032c664be..4d3e1e7fce 100644
--- a/uisimulator/x11/Makefile
+++ b/uisimulator/x11/Makefile
@@ -25,7 +25,8 @@ RM = rm -f
25DEBUG = -g 25DEBUG = -g
26 26
27# Use this for simulator-only files 27# Use this for simulator-only files
28INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) 28INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) \
29 -I$(BUILDDIR)
29 30
30# This sets up 'SRC' based on the files mentioned in SOURCES 31# This sets up 'SRC' based on the files mentioned in SOURCES
31include $(TOOLSDIR)/makesrc.inc 32include $(TOOLSDIR)/makesrc.inc
@@ -41,7 +42,7 @@ DIRS = .
41 42
42CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS) 43CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS)
43 44
44OUTFILE = $(OBJDIR)/libsim.a 45OUTFILE = $(BUILDDIR)/libsim.a
45 46
46all: $(OUTFILE) 47all: $(OUTFILE)
47 @$(MAKE) -C $(SIMCOMMON) 48 @$(MAKE) -C $(SIMCOMMON)