From c6b3d38a156dd624760a8eb1bb374affd43b4f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= Date: Thu, 20 Nov 2008 11:27:31 +0000 Subject: 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 --- apps/codecs/libtremor/Makefile | 49 ----------------------------------- apps/codecs/libtremor/config-tremor.h | 2 +- apps/codecs/libtremor/ctype.c | 2 +- apps/codecs/libtremor/libtremor.make | 36 +++++++++++++++++++++++++ apps/codecs/libtremor/mapping0.c | 2 +- apps/codecs/libtremor/oggmalloc.c | 5 ++-- 6 files changed, 41 insertions(+), 55 deletions(-) delete mode 100644 apps/codecs/libtremor/Makefile create mode 100644 apps/codecs/libtremor/libtremor.make (limited to 'apps/codecs/libtremor') 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 #include "ogg.h" #include "ivorbiscodec.h" -#include +#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 +#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) { -- cgit v1.1