summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-02-16 20:15:30 +0000
committerDave Chapman <dave@dchapman.com>2005-02-16 20:15:30 +0000
commit1c6b2513ea0114150447824df45e566d87fd06d9 (patch)
tree1138445a98a60d8fef1ce32bd6949915782a0f77 /apps
parentf729fce058d863b6df15ea4ca22e033820b783a0 (diff)
Add libFLAC to the build system
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5987 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/Makefile10
-rw-r--r--apps/codecs/libFLAC/Makefile45
-rw-r--r--apps/codecs/libFLAC/SOURCES12
3 files changed, 65 insertions, 2 deletions
diff --git a/apps/codecs/Makefile b/apps/codecs/Makefile
index 805eaf55cd..863d552a1e 100644
--- a/apps/codecs/Makefile
+++ b/apps/codecs/Makefile
@@ -16,7 +16,7 @@ ifdef APPEXTRA
INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
endif
-all: $(OBJDIR)/libmad.a $(OBJDIR)/liba52.a
+all: $(OBJDIR)/libmad.a $(OBJDIR)/liba52.a $(OBJDIR)/libFLAC.a
include $(TOOLSDIR)/make.inc
@@ -30,8 +30,14 @@ $(OBJDIR)/liba52.a:
@mkdir -p $(OBJDIR)/liba52
@$(MAKE) -C liba52 TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE}
+$(OBJDIR)/libFLAC.a:
+ @echo "MAKE in libFLAC"
+ @mkdir -p $(OBJDIR)/libFLAC
+ @$(MAKE) -C libFLAC TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE}
+
clean:
@echo "cleaning codecs"
- @rm -fr $(OBJDIR)/libmad $(OBJDIR)/liba52
+ @rm -fr $(OBJDIR)/libmad $(OBJDIR)/liba52 $(OBJDIR)/libFLAC
@$(MAKE) -C libmad clean
@$(MAKE) -C liba52 clean
+ @$(MAKE) -C libFLAC clean
diff --git a/apps/codecs/libFLAC/Makefile b/apps/codecs/libFLAC/Makefile
new file mode 100644
index 0000000000..d711134ae9
--- /dev/null
+++ b/apps/codecs/libFLAC/Makefile
@@ -0,0 +1,45 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id$
+#
+
+INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
+ -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(APPSDIR)/codecs/libFLAC/include
+
+ifdef APPEXTRA
+INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
+endif
+
+FLACOPTS = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA -DFLAC__INTEGER_ONLY_LIBRARY -DVERSION=\"1.1.2\" -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__
+CFLAGS = $(GCCOPTS) $(FLACOPTS)\
+$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
+
+SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
+SOURCES = $(SRC)
+OBJS := $(SRC:%.c=$(OBJDIR)/libFLAC/%.o)
+DEPFILE = $(OBJDIR)/dep-libFLAC
+DIRS =
+
+OUTPUT = $(OBJDIR)/libFLAC.a
+
+all: $(OUTPUT)
+
+$(OUTPUT): $(OBJS)
+ @echo "AR $@"
+ @$(AR) ruv $@ $+ >/dev/null 2>&1
+
+$(OBJDIR)/libFLAC/%.o: $(APPSDIR)/codecs/libFLAC/%.c
+ @mkdir -p $(OBJDIR)/libFLAC
+ @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libFLAC/include/FLAC $< -o $@
+
+include $(TOOLSDIR)/make.inc
+
+clean:
+ @echo "cleaning libFLAC"
+ @rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
+
+-include $(DEPFILE)
diff --git a/apps/codecs/libFLAC/SOURCES b/apps/codecs/libFLAC/SOURCES
new file mode 100644
index 0000000000..fc793f5e10
--- /dev/null
+++ b/apps/codecs/libFLAC/SOURCES
@@ -0,0 +1,12 @@
+bitbuffer.c
+bitmath.c
+cpu.c
+crc.c
+fixed.c
+float.c
+format.c
+lpc.c
+md5.c
+memory.c
+seekable_stream_decoder.c
+stream_decoder.c