summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor
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/codecs/libtremor
parentf66c30346783a400a029bedcd60ab67c81c34a07 (diff)
downloadrockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.zip
rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.tar.gz
rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.tar.bz2
rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.tar.xz
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/codecs/libtremor')
-rw-r--r--apps/codecs/libtremor/Makefile49
-rw-r--r--apps/codecs/libtremor/config-tremor.h2
-rw-r--r--apps/codecs/libtremor/ctype.c2
-rw-r--r--apps/codecs/libtremor/libtremor.make36
-rw-r--r--apps/codecs/libtremor/mapping0.c2
-rw-r--r--apps/codecs/libtremor/oggmalloc.c5
6 files changed, 41 insertions, 55 deletions
diff --git a/apps/codecs/libtremor/Makefile b/apps/codecs/libtremor/Makefile
deleted file mode 100644
index 674d2ae..0000000
--- a/apps/codecs/libtremor/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-# __________ __ ___.
-# Open \______ \ ____ ____ | | _\_ |__ _______ ___
-# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
-# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
-# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
-# \/ \/ \/ \/ \/
-# $Id$
-#
-
-INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
- -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
-
-ifdef APPEXTRA
- INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
-endif
-
-# Tremor is slightly faster on coldfire with -O3
-ifeq ($(CPU),coldfire)
- TREMOROPTS = -O3
-else
- TREMOROPTS = -O2
-endif
-
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TREMOROPTS) $(TARGET) \
-$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} ${PROFILE_OPTS}
-
-# This sets up 'SRC' based on the files mentioned in SOURCES
-include $(TOOLSDIR)/makesrc.inc
-
-SOURCES = $(SRC)
-OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
-OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
-DEPFILE = $(OBJDIR)/dep-libtremor
-DIRS =
-
-all: $(OUTPUT)
-
-$(OUTPUT): $(OBJS)
- $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
- $(SILENT)$(RANLIB) $@
-
-include $(TOOLSDIR)/make.inc
-
-clean:
- $(call PRINTS,cleaning libtremor)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
-
-ifneq ($(MAKECMDGOALS),clean)
--include $(DEPFILE)
-endif
diff --git a/apps/codecs/libtremor/config-tremor.h b/apps/codecs/libtremor/config-tremor.h
index e1ade70..7cfcb7e 100644
--- a/apps/codecs/libtremor/config-tremor.h
+++ b/apps/codecs/libtremor/config-tremor.h
@@ -1,4 +1,4 @@
-#include "../codec.h"
+#include "codeclib.h"
#ifdef CPU_ARM
#define _ARM_ASSEM_
#endif
diff --git a/apps/codecs/libtremor/ctype.c b/apps/codecs/libtremor/ctype.c
index 9eb6eef..10468bc 100644
--- a/apps/codecs/libtremor/ctype.c
+++ b/apps/codecs/libtremor/ctype.c
@@ -1 +1 @@
-#include "../../../firmware/common/ctype.c"
+#include "common/ctype.c"
diff --git a/apps/codecs/libtremor/libtremor.make b/apps/codecs/libtremor/libtremor.make
new file mode 100644
index 0000000..6f500ea
--- /dev/null
+++ b/apps/codecs/libtremor/libtremor.make
@@ -0,0 +1,36 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
+#
+
+# libtremor
+TREMORLIB := $(CODECDIR)/libtremor.a
+TREMORLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libtremor/SOURCES)
+TREMORLIB_OBJ := $(call c2obj, $(TREMORLIB_SRC))
+OTHER_SRC += $(TREMORLIB_SRC)
+
+$(TREMORLIB): $(TREMORLIB_OBJ)
+ $(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
+
+$(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c
+ $(SILENT)mkdir -p $(dir $@)
+ $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
+ -I$(APPSDIR)/codecs/libtremor \
+ $(CODECFLAGS) $(CFLAGS) -c $< -o $@
+
+TREMORFLAGS = -I$(APPSDIR)/codecs/libtremor $(filter-out -O%,$(CODECFLAGS))
+
+# Tremor is slightly faster on coldfire with -O3
+ifeq ($(CPU),coldfire)
+ TREMORFLAGS += -O3
+else
+ TREMORFLAGS += -O2
+endif
+
+$(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c
+ $(SILENT)mkdir -p $(dir $@)
+ $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TREMORFLAGS) -c $< -o $@
diff --git a/apps/codecs/libtremor/mapping0.c b/apps/codecs/libtremor/mapping0.c
index 6bcc717..2bb7a46 100644
--- a/apps/codecs/libtremor/mapping0.c
+++ b/apps/codecs/libtremor/mapping0.c
@@ -21,7 +21,7 @@
#include <math.h>
#include "ogg.h"
#include "ivorbiscodec.h"
-#include <codecs/lib/codeclib.h>
+#include "codeclib.h"
#include "codec_internal.h"
#include "codebook.h"
#include "window.h"
diff --git a/apps/codecs/libtremor/oggmalloc.c b/apps/codecs/libtremor/oggmalloc.c
index b11eaa5..ca917ff 100644
--- a/apps/codecs/libtremor/oggmalloc.c
+++ b/apps/codecs/libtremor/oggmalloc.c
@@ -1,7 +1,6 @@
-#include <os_types.h>
+#include "os_types.h"
-static unsigned char *mallocbuf;
-static size_t bufsize, tmp_ptr, mem_ptr;
+static size_t tmp_ptr;
void ogg_malloc_init(void)
{