Correct order of odd and even row colours in the rowcolors command, and set colours...
[kugel-rb.git] / tools / rbspeex / Makefile
bloba82e80e017bcb6b642917362ba416ca55a1faa75
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 ifndef V
11 SILENT = @
12 endif
14 SPEEXSRC = ../../apps/codecs/libspeex
16 INCLUDES = -I $(SPEEXSRC)
17 SPEEXOPTS = -DHAVE_CONFIG_H -DROCKBOX_VOICE_ENCODER
19 CFLAGS = $(SPEEXOPTS) $(INCLUDES) -O3 -fomit-frame-pointer -Wno-unused-parameter
21 #build standalone win32 executables on cygwin
22 ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
23 CFLAGS+=-mno-cygwin
24 endif
25 # on mingw32, make sure CC is set to gcc
26 ifeq ($(findstring MINGW,$(shell uname)),MINGW)
27 CC = gcc
28 endif
30 ifdef RBARCH
31 CFLAGS += -arch $(RBARCH)
32 endif
35 # This sets up 'SRC' based on the files mentioned in SOURCES
36 SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$")
38 OUT = build$(RBARCH)
39 SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
40 OBJS = $(addprefix $(OUT)/,$(SRC:%.c=%.o))
41 DEPFILE = $(OUT)/dep-speex
42 DIRS =
44 .PHONY : all
46 all: ../rbspeexenc ../rbspeexdec
48 $(DEPFILE): $(SOURCES)
49 @echo MKDIR build$(RBARCH)
50 $(SILENT)mkdir -p build$(RBARCH)
51 @echo Creating dependencies
52 $(SILENT)rm -f $(DEPFILE)
53 $(SILENT)(for each in $(SOURCES) x; do \
54 if test "x" != "$$each"; then \
55 obj=`echo $$each | sed -e 's/\.[cS]/.o/' | sed -e 's/^.*\///' `; \
56 $(CC) -MG -MM -MT "$(OUT)/$$obj" $(CFLAGS) $$each 2>/dev/null; \
57 fi; \
58 if test -n "$$del"; then \
59 rm $$del; \
60 del=""; \
61 fi \
62 done > $(DEPFILE); \
63 echo "oo" > /dev/null )
65 -include $(DEPFILE)
67 $(OUT)/librbspeex.a: $(OBJS) $(DEPFILE) $(OUT)/rbspeex.o
68 @echo AR $(OUT)/librbspeex$(RBARCH).a
69 $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1
71 librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
72 $(SILENT)cp $(OUT)/librbspeex.a librbspeex$(RBARCH).a
74 ../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a
75 @echo Linking ../rbspeexenc
76 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a -lm
78 ../rbspeexdec: $(OBJS) librbspeex$(RBARCH).a $(OUT)/rbspeexdec.o
79 @echo Linking ../rbspeexdec
80 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec $(OUT)/rbspeexdec.o librbspeex$(RBARCH).a -lm
82 %.o:
83 @echo CC $<
84 $(SILENT)$(CC) $(CFLAGS) -c $< -o $@
86 # some trickery to build ppc and i386 from a single call
87 ifeq ($(RBARCH),)
88 librbspeexi386.a:
89 make RBARCH=i386 librbspeexi386.a
91 librbspeexppc.a:
92 make RBARCH=ppc librbspeexppc.a
93 endif
95 librbspeex-universal: librbspeexi386.a librbspeexppc.a
96 @echo lipo librbspeex.a
97 $(SILENT) rm -f librbspeex.a
98 lipo -create librbspeexppc.a librbspeexi386.a -output librbspeex.a
100 clean:
101 rm -f $(OBJS) librbspeex* ../rbspeexenc ../rbspeexdec dep-speex
102 rm -rf build*
104 build$(RBARCH):
105 @echo MKDIR build$(RBARCH)
106 $(SILENT)mkdir build$(RBARCH)