Commit 005ca0fb authored by Simon Morlat's avatar Simon Morlat

simplify and add Makefile for ARM

parent 0285054c
.deps/
INSTALL
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
......
......@@ -43,16 +43,19 @@ case $host in
esac
case $host in
armv6-apple*)
SILK_MAKE_OPTIONS="ADDED_DEFINES+=IPHONE TOOLCHAIN_PREFIX=XXXX"
armv6-apple*)
SILK_MAKE_OPTIONS="ADDED_DEFINES+=IPHONE TOOLCHAIN_PREFIX=XXXX"
CFLAGS="$CFLAGS -mno-thumb"
;;
armv7-apple*)
SILK_MAKE_OPTIONS="USE_NEON=yes ADDED_DEFINES+=IPHONE TOOLCHAIN_PREFIX=XXXX"
;;
armv7-apple*)
SILK_MAKE_OPTIONS="USE_NEON=yes ADDED_DEFINES+=IPHONE TOOLCHAIN_PREFIX=XXXX"
CFLAGS="$CFLAGS -mno-thumb"
;;
*)
;;
;;
armv7*)
SILK_MAKE_OPTIONS="USE_NEON=yes TOOLCHAIN_PREFIX=XXXX"
;;
*)
;;
esac
......@@ -60,35 +63,6 @@ esac
AC_SUBST([SILK_FLAVOUR])
AC_SUBST([SILK_MAKE_OPTIONS])
# Checks for programs.
AC_PATH_PROG([WGET],[wget])
if test -z "$WGET"; then
AC_MSG_ERROR(['wget' is required to build this package])
fi
AC_PATH_PROG([MD5SUM],[md5sum])
if test -z "$MD5SUM"; then
AC_PATH_PROG([MD5SUM],[openssl])
if test -n "$MD5SUM"; then
MD5SUM="$MD5SUM md5"
fi
fi
if test -z "$MD5SUM"; then
AC_MSG_ERROR(['md5sum' is required to build this package])
fi
AC_PATH_PROG([UNZIP],[unzip])
if test -z "$UNZIP"; then
AC_MSG_ERROR(['unzip' is required to build this package])
fi
AC_PATH_PROG([PATCH],[patch])
if test -z "$PATCH"; then
AC_MSG_ERROR(['patch' is required to build this package])
fi
LT_INIT([disable-static])
AC_ARG_WITH([mediastreamer], AS_HELP_STRING([--without-mediastreamer], [Permits to deactivate mediastreamer check for download of SILK code only]))
......
......@@ -4,19 +4,6 @@ silk_flavour_dir = SILK_SDK_SRC_$(SILK_FLAVOUR)_v$(silk_version)
silk_src_dir = $(silk_extracted_directory)/${silk_flavour_dir}
silk_lib = libSKP_SILK_SDK.a
BUILT_SOURCES = $(silk_extracted_directory) $(silk_src_dir)
if BUILD_WIN32
#apply the patch fails under mingw, and it is unuseful.
$(silk_src_dir):
else
$(silk_src_dir):
cp -f $(srcdir)/patch_pic.diff $(silk_src_dir)/.
cd $(silk_src_dir) && $(PATCH) -p0 < patch_pic.diff
rm -f $(silk_src_dir)/patch_pic.diff
endif
extract-sources: $(silk_src_dir)
# Call Skype Makefile to build the library
......@@ -30,4 +17,3 @@ clean-local: $(silk_src_dir)
install-data-local: $(silk_src_dir)
$(INSTALL) -D $(silk_src_dir)/$(silk_lib) $(DESTDIR)$(prefix)/lib/$(silk_lib)
DISTCLEANFILES = $(BUILT_SOURCES)
#
# Makefile for Silk SDK
#
# Copyright (c) 2012, Skype Limited
# All rights reserved.
#
#Platform detection and settings
BUILD_OS := $(shell uname | sed -e 's/^.*Darwin.*/MacOS-X/ ; s/^.*CYGWIN.*/Windows/')
BUILD_ARCHITECTURE := $(shell uname -m | sed -e 's/i686/i386/')
EXESUFFIX =
LIBPREFIX = lib
LIBSUFFIX = .a
OBJSUFFIX = .o
CC = $(TOOLCHAIN_PREFIX)gcc$(TOOLCHAIN_SUFFIX)
CXX = $(TOOLCHAIN_PREFIX)g++$(TOOLCHAIN_SUFFIX)
AR = $(TOOLCHAIN_PREFIX)ar
RANLIB = $(TOOLCHAIN_PREFIX)ranlib
CP = $(TOOLCHAIN_PREFIX)cp
cppflags-from-defines = $(addprefix -D,$(1))
cppflags-from-includes = $(addprefix -I,$(1))
ldflags-from-ldlibdirs = $(addprefix -L,$(1))
ldlibs-from-libs = $(addprefix -l,$(1))
ifneq (,$(TARGET_CPU))
CFLAGS += -mcpu=$(TARGET_CPU)
ifneq (,$(TARGET_TUNE))
CFLAGS += -mtune=$(TARGET_TUNE)
else
CFLAGS += -mtune=$(TARGET_CPU)
endif
endif
ifneq (,$(TARGET_FPU))
CFLAGS += -mfpu=$(TARGET_FPU)
endif
ifneq (,$(TARGET_ARCH))
CFLAGS += -march=$(TARGET_ARCH)
endif
# Helper to make NEON testing easier, when using USE_NEON=yes do not set TARGET_CPU or TARGET_FPU
ifeq (yes,$(USE_NEON))
CFLAGS += -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon
endif
CFLAGS += -Wall -enable-threads -O3 -fPIC
CFLAGS += $(call cppflags-from-defines,$(CDEFINES))
CFLAGS += $(call cppflags-from-defines,$(ADDED_DEFINES))
CFLAGS += $(call cppflags-from-includes,$(CINCLUDES))
LDFLAGS += $(call ldflags-from-ldlibdirs,$(LDLIBDIRS))
LDLIBS += $(call ldlibs-from-libs,$(LIBS))
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)
ARCHIVE.cmdline = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@
%$(OBJSUFFIX):%.c
$(COMPILE.c.cmdline)
%$(OBJSUFFIX):%.cpp
$(COMPILE.cpp.cmdline)
%$(OBJSUFFIX):%.S
$(COMPILE.S.cmdline)
# Directives
CINCLUDES += interface src test
# VPATH e.g. VPATH = src:../headers
VPATH = ./ \
interface \
src \
test
# Variable definitions
LIB_NAME = SKP_SILK_SDK
TARGET = $(LIBPREFIX)$(LIB_NAME)$(LIBSUFFIX)
SRCS_C = $(wildcard src/*.c)
ifneq (,$(TOOLCHAIN_PREFIX))
SRCS_S = $(wildcard src/*.S)
OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C)) $(patsubst %.S,%$(OBJSUFFIX),$(SRCS_S))
else
OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C))
endif
ENCODER_SRCS_C = test/Encoder.c
ENCODER_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(ENCODER_SRCS_C))
DECODER_SRCS_C = test/Decoder.c
DECODER_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(DECODER_SRCS_C))
SIGNALCMP_SRCS_C = test/signalCompare.c
SIGNALCMP_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SIGNALCMP_SRCS_C))
LIBS = \
$(LIB_NAME)
LDLIBDIRS = ./
# Rules
default: all
all: $(TARGET) encoder decoder signalcompare
lib: $(TARGET)
$(TARGET): $(OBJS)
$(ARCHIVE.cmdline)
encoder$(EXESUFFIX): $(ENCODER_OBJS)
$(LINK.o.cmdline)
decoder$(EXESUFFIX): $(DECODER_OBJS)
$(LINK.o.cmdline)
signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS)
$(LINK.o.cmdline)
clean:
$(RM) $(TARGET)* $(OBJS) $(ENCODER_OBJS) $(DECODER_OBJS) \
$(SIGNALCMP_OBJS) $(TEST_OBJS) \
encoder$(EXESUFFIX) decoder$(EXESUFFIX) signalcompare$(EXESUFFIX)
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