summaryrefslogtreecommitdiff
path: root/tools/rbspeex/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/rbspeex/Makefile')
-rw-r--r--tools/rbspeex/Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/rbspeex/Makefile b/tools/rbspeex/Makefile
index 41bf775d38..8c46677ce8 100644
--- a/tools/rbspeex/Makefile
+++ b/tools/rbspeex/Makefile
@@ -31,9 +31,19 @@ ifdef RBARCH
31CFLAGS += -arch $(RBARCH) 31CFLAGS += -arch $(RBARCH)
32endif 32endif
33 33
34# don't try to use the systems libspeex when building a static binary.
35ifndef STATIC
36SYS_SPEEX = $(shell pkg-config --libs speex)
37endif
34 38
39# fall back to our own librbspeex if no suitable found.
40ifeq ($(SYS_SPEEX),)
35# This sets up 'SRC' based on the files mentioned in SOURCES 41# This sets up 'SRC' based on the files mentioned in SOURCES
36SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$") 42SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$")
43LIBS = $(TARGET_DIR)librbspeex$(RBARCH).a
44else
45LIBS = $(SYS_SPEEX)
46endif
37 47
38OUT = $(TARGET_DIR)build$(RBARCH) 48OUT = $(TARGET_DIR)build$(RBARCH)
39SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c 49SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
@@ -73,11 +83,11 @@ librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
73 83
74../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a 84../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a
75 @echo Linking ../rbspeexenc 85 @echo Linking ../rbspeexenc
76 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a -lm 86 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc $(OUT)/rbspeexenc.o $(LIBS) -lm $(TARGET_DIR)librbspeex$(RBARCH).a
77 87
78../rbspeexdec: $(OBJS) librbspeex$(RBARCH).a $(OUT)/rbspeexdec.o 88../rbspeexdec: $(OBJS) librbspeex$(RBARCH).a $(OUT)/rbspeexdec.o
79 @echo Linking ../rbspeexdec 89 @echo Linking ../rbspeexdec
80 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec $(OUT)/rbspeexdec.o librbspeex$(RBARCH).a -lm 90 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec $(OUT)/rbspeexdec.o $(LIBS) -lm $(TARGET_DIR)librbspeex$(RBARCH).a
81 91
82%.o: 92%.o:
83 @echo CC $< 93 @echo CC $<