Fix previous commit to work both inside and outside src directory

parent 6594a7be
sdk/SILK_SDK_SRC_v1.0.9/SILK_SDK_SRC_FIX_v1.0.9/libSKP_SILK_SDK.a
.libs
*.o
*.la
*.lo
Makefile
.deps/
INSTALL
Makefile.in
......
silk_version = 1.0.9
silk_extracted_directory = SILK_SDK_SRC_v$(silk_version)
silk_flavour_dir = SILK_SDK_SRC_$(SILK_FLAVOUR)_v$(silk_version)
silk_src_dir = $(build_dir)/$(silk_extracted_directory)/$(silk_flavour_dir)
silk_src_dir = $(silk_extracted_directory)/$(silk_flavour_dir)
silk_lib = libSKP_SILK_SDK.a
$(silk_src_dir):
copy-sdk:
mkdir -p $(silk_extracted_directory)
cp -r $(srcdir)/$(silk_src_dir) $(silk_extracted_directory)
if [ ! -d "$(silk_src_dir)" ]; then cp -r $(abs_srcdir)/$(silk_src_dir) $(silk_src_dir); fi
# Call Skype Makefile to build the library
all-local: $(silk_src_dir)
all-local: copy-sdk
cd $(silk_src_dir) && $(MAKE) AS="$(AS)" AR="$(AR)" RANLIB="$(RANLIB)" CC="$(CC) $(CFLAGS)" LD="$(LD)" $(SILK_MAKE_OPTIONS) $(AM_MAKEFLAGS) lib
check-local: $(silk_src_dir)
check-local: copy-sdk
cd $(silk_src_dir) && $(MAKE) $(AM_MAKEFLAGS) test
clean-local: $(silk_src_dir)
clean-local: copy-sdk
cd $(silk_src_dir) && $(MAKE) $(AM_MAKEFLAGS) clean
install-data-local: $(silk_src_dir)
install-data-local: copy-sdk
$(INSTALL) -D $(silk_src_dir)/$(silk_lib) $(DESTDIR)$(prefix)/lib/$(silk_lib)
#
# Makefile for Silk SDK
#
# Makefile for Silk SDK
#
# Copyright (c) 2012, Skype Limited
# All rights reserved.
......@@ -10,7 +10,7 @@
BUILD_OS := $(shell uname | sed -e 's/^.*Darwin.*/MacOS-X/ ; s/^.*CYGWIN.*/Windows/')
BUILD_ARCHITECTURE := $(shell uname -m | sed -e 's/i686/i386/')
EXESUFFIX =
EXESUFFIX =
LIBPREFIX = lib
LIBSUFFIX = .a
OBJSUFFIX = .o
......@@ -25,7 +25,7 @@ cflags-from-includes = $(addprefix -I,$(1))
ldflags-from-ldlibdirs = $(addprefix -L,$(1))
ldlibs-from-libs = $(addprefix -l,$(1))
CFLAGS += -Wall -enable-threads -O3
CFLAGS += -Wall -enable-threads -O3 -fPIC
CFLAGS += $(call cflags-from-defines,$(CDEFINES))
CFLAGS += $(call cflags-from-defines,$(ADDED_DEFINES))
......@@ -34,7 +34,7 @@ LDFLAGS += $(call ldflags-from-ldlibdirs,$(LDLIBDIRS))
LDLIBS += $(call ldlibs-from-libs,$(LIBS))
COMPILE.c.cmdline = $(CC) -c $(CFLAGS) -o $@ $<
LINK.o.cmdline = $(LINK.o) $^ $(LDLIBS) -lm -o $@$(EXESUFFIX)
LINK.o.cmdline = $(LINK.o) $^ $(LDLIBS) -lm -o $@$(EXESUFFIX)
ARCHIVE.cmdline = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@
%$(OBJSUFFIX):%.c
......@@ -48,7 +48,7 @@ CINCLUDES += interface src test
VPATH = ./ \
interface \
src \
test
test
# Variable definitions
LIB_NAME = SKP_SILK_SDK
......@@ -82,13 +82,13 @@ lib: $(TARGET)
$(TARGET): $(OBJS)
$(ARCHIVE.cmdline)
encoder$(EXESUFFIX): $(ENCODER_OBJS)
encoder$(EXESUFFIX): $(ENCODER_OBJS)
$(LINK.o.cmdline)
decoder$(EXESUFFIX): $(DECODER_OBJS)
decoder$(EXESUFFIX): $(DECODER_OBJS)
$(LINK.o.cmdline)
signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS)
signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS)
$(LINK.o.cmdline)
clean:
......
#
# Makefile for Silk SDK
#
# Makefile for Silk SDK
#
# Copyright (c) 2012, Skype Limited
# All rights reserved.
......@@ -10,7 +10,7 @@
BUILD_OS := $(shell uname | sed -e 's/^.*Darwin.*/MacOS-X/ ; s/^.*CYGWIN.*/Windows/')
BUILD_ARCHITECTURE := $(shell uname -m | sed -e 's/i686/i386/')
EXESUFFIX =
EXESUFFIX =
LIBPREFIX = lib
LIBSUFFIX = .a
OBJSUFFIX = .o
......@@ -25,7 +25,7 @@ cflags-from-includes = $(addprefix -I,$(1))
ldflags-from-ldlibdirs = $(addprefix -L,$(1))
ldlibs-from-libs = $(addprefix -l,$(1))
CFLAGS += -Wall -enable-threads -O3
CFLAGS += -Wall -enable-threads -O3 -fPIC
CFLAGS += $(call cflags-from-defines,$(CDEFINES))
CFLAGS += $(call cflags-from-defines,$(ADDED_DEFINES))
......@@ -34,7 +34,7 @@ LDFLAGS += $(call ldflags-from-ldlibdirs,$(LDLIBDIRS))
LDLIBS += $(call ldlibs-from-libs,$(LIBS))
COMPILE.c.cmdline = $(CC) -c $(CFLAGS) -o $@ $<
LINK.o.cmdline = $(LINK.o) $^ $(LDLIBS) -lm -o $@$(EXESUFFIX)
LINK.o.cmdline = $(LINK.o) $^ $(LDLIBS) -lm -o $@$(EXESUFFIX)
ARCHIVE.cmdline = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@
%$(OBJSUFFIX):%.c
......@@ -48,7 +48,7 @@ CINCLUDES += interface src test
VPATH = ./ \
interface \
src \
test
test
# Variable definitions
LIB_NAME = SKP_SILK_SDK
......@@ -82,13 +82,13 @@ lib: $(TARGET)
$(TARGET): $(OBJS)
$(ARCHIVE.cmdline)
encoder$(EXESUFFIX): $(ENCODER_OBJS)
encoder$(EXESUFFIX): $(ENCODER_OBJS)
$(LINK.o.cmdline)
decoder$(EXESUFFIX): $(DECODER_OBJS)
decoder$(EXESUFFIX): $(DECODER_OBJS)
$(LINK.o.cmdline)
signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS)
signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS)
$(LINK.o.cmdline)
clean:
......
#
# Makefile for Silk SDK
#
# Makefile for Silk SDK
#
# Copyright (c) 2012, Skype Limited
# All rights reserved.
......@@ -11,7 +11,7 @@ BUILD_OS := $(shell uname | sed -e 's/^.*Darwin.*/MacOS-X/ ; s/^.*CYGWIN.*/Windo
BUILD_ARCHITECTURE := $(shell uname -m | sed -e 's/i686/i386/')
EXESUFFIX =
EXESUFFIX =
LIBPREFIX = lib
LIBSUFFIX = .a
OBJSUFFIX = .o
......@@ -39,7 +39,7 @@ ifeq (yes,$(MIPSEL))
endif
CFLAGS += -Wall -enable-threads -O3
CFLAGS += -Wall -enable-threads -O3 -fPIC
CFLAGS += $(call cppflags-from-defines,$(CDEFINES))
CFLAGS += $(call cppflags-from-defines,$(ADDED_DEFINES))
......@@ -51,7 +51,7 @@ COMPILE.c.cmdline = $(CC) -c $(CFLAGS) $(ADDED_CFLAGS) -o $@ $<
COMPILE.S.cmdline = $(CC) -c $(CFLAGS) $(ADDED_CFLAGS) -o $@ $<
COMPILE.cpp.cmdline = $(CXX) -c $(CFLAGS) $(ADDED_CFLAGS) -o $@ $<
LINK.o = $(CXX) $(LDPREFLAGS) $(LDFLAGS)
LINK.o.cmdline = $(LINK.o) $^ $(LDLIBS) -o $@$(EXESUFFIX)
LINK.o.cmdline = $(LINK.o) $^ $(LDLIBS) -o $@$(EXESUFFIX)
ARCHIVE.cmdline = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@
%$(OBJSUFFIX):%.c
......@@ -59,9 +59,9 @@ ARCHIVE.cmdline = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@
%$(OBJSUFFIX):%.cpp
$(COMPILE.cpp.cmdline)
%$(OBJSUFFIX):%.S
$(COMPILE.S.cmdline)
$(COMPILE.S.cmdline)
# Directives
......@@ -71,13 +71,13 @@ CINCLUDES += interface src test
VPATH = ./ \
interface \
src \
test
test
# Variable definitions
LIB_NAME = SKP_SILK_SDK
TARGET = $(LIBPREFIX)$(LIB_NAME)$(LIBSUFFIX)
SRCS_C = $(wildcard src/*.c)
SRCS_C = $(wildcard src/*.c)
ifneq (,$(TOOLCHAIN_PREFIX))
SRCS_S = $(wildcard src/*.S)
OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C)) $(patsubst %.S,%$(OBJSUFFIX),$(SRCS_S))
......@@ -109,13 +109,13 @@ lib: $(TARGET)
$(TARGET): $(OBJS)
$(ARCHIVE.cmdline)
encoder$(EXESUFFIX): $(ENCODER_OBJS)
encoder$(EXESUFFIX): $(ENCODER_OBJS)
$(LINK.o.cmdline)
decoder$(EXESUFFIX): $(DECODER_OBJS)
decoder$(EXESUFFIX): $(DECODER_OBJS)
$(LINK.o.cmdline)
signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS)
signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS)
$(LINK.o.cmdline)
clean:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment