Commit FS#10234 - Spacerocks respawn invulnerability by Eric Clayton. Gives you...
[kugel-rb.git] / tools / rbspeex / Makefile
blobc11ae29b04a70c42914a77c89de4573d773b73e1
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) $(OUT)
49 $(SILENT)rm -f $(DEPFILE)
50 $(SILENT)(for each in $(SOURCES) x; do \
51 if test "x" != "$$each"; then \
52 obj=`echo $$each | sed -e 's/\.[cS]/.o/' | sed -e 's/^.*\///' `; \
53 $(CC) -MG -MM -MT "$(OUT)/$$obj" $(CFLAGS) $$each 2>/dev/null; \
54 fi; \
55 if test -n "$$del"; then \
56 rm $$del; \
57 del=""; \
58 fi \
59 done > $(DEPFILE); \
60 echo "oo" > /dev/null )
62 -include $(DEPFILE)
64 $(OUT)/librbspeex.a: $(OBJS) $(DEPFILE) $(OUT)/rbspeex.o
65 @echo AR $(OUT)/librbspeex$(RBARCH).a
66 $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1
68 librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
69 $(SILENT)cp $(OUT)/librbspeex.a librbspeex$(RBARCH).a
71 ../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a
72 @echo Linking ../rbspeexenc
73 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a -lm
75 ../rbspeexdec: $(OBJS) librbspeex$(RBARCH).a $(OUT)/rbspeexdec.o
76 @echo Linking ../rbspeexdec
77 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec $(OUT)/rbspeexdec.o librbspeex$(RBARCH).a -lm
79 %.o:
80 @echo CC $<
81 $(SILENT)$(CC) $(CFLAGS) -c $< -o $@
83 # some trickery to build ppc and i386 from a single call
84 ifeq ($(RBARCH),)
85 librbspeexi386.a:
86 make RBARCH=i386 librbspeexi386.a
88 librbspeexppc.a:
89 make RBARCH=ppc librbspeexppc.a
90 endif
92 librbspeex-universal: librbspeexi386.a librbspeexppc.a
93 @echo lipo librbspeex.a
94 $(SILENT) rm -f librbspeex.a
95 lipo -create librbspeexppc.a librbspeexi386.a -output librbspeex.a
97 clean:
98 rm -f $(OBJS) librbspeex* ../rbspeexenc ../rbspeexdec dep-speex
99 rm -rf build*
101 build$(RBARCH):
102 @echo MKDIR build$(RBARCH)
103 $(SILENT)mkdir build$(RBARCH)