Let qmake generate an install Makefile target to install the binary. Doesn't handle...
[Rockbox.git] / tools / rbspeex / Makefile
blob9b2feb196fd0748f80efeacc0dd9a9a401600b0f
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 # This sets up 'SRC' based on the files mentioned in SOURCES
31 SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#")
33 SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
34 OBJS := $(SRC:%.c=%.o)
35 DEPFILE = dep-speex
36 DIRS =
38 .PHONY : all
40 all: ../rbspeexenc ../rbspeexdec
42 $(DEPFILE): $(SOURCES)
43 $(SILENT)rm -f $(DEPFILE)
44 $(SILENT)(for each in $(SOURCES) x; do \
45 if test "x" != "$$each"; then \
46 obj=`echo $$each | sed -e 's/\.[cS]/.o/' | sed -e 's/^.*\///' `; \
47 $(CC) -MG -MM -MT "$$obj" $(CFLAGS) $$each 2>/dev/null; \
48 fi; \
49 if test -n "$$del"; then \
50 rm $$del; \
51 del=""; \
52 fi \
53 done > $(DEPFILE); \
54 echo "oo" > /dev/null )
56 librbspeex.a: $(OBJS) $(DEPFILE) rbspeex.o
57 @echo AR librbspeex.a
58 $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1
60 ../rbspeexenc: $(OBJS) rbspeexenc.o librbspeex.a
61 @echo Linking ../rbspeexenc
62 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc rbspeexenc.o librbspeex.a -lm
64 ../rbspeexdec: $(OBJS) librbspeex.a rbspeexdec.o
65 @echo Linking ../rbspeexdec
66 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec rbspeexdec.o librbspeex.a -lm
68 %.o:
69 @echo CC $<
70 $(SILENT)$(CC) $(CFLAGS) -c $< -o $@
73 clean:
74 rm -f $(OBJS) libspeex.a librbspeex.a rbspeexenc.o ../rbspeexenc dep-speex
76 -include $(DEPFILE)