2014-01-29 09:31:09 +01:00
|
|
|
SRC_PATH=$(word 1, $(dir $(MAKEFILE_LIST)))
|
|
|
|
vpath %.c $(SRC_PATH)
|
|
|
|
vpath %.cc $(SRC_PATH)
|
|
|
|
vpath %.cpp $(SRC_PATH)
|
|
|
|
vpath %.asm $(SRC_PATH)
|
|
|
|
vpath %.S $(SRC_PATH)
|
2015-04-20 10:08:59 +02:00
|
|
|
vpath %.rc $(SRC_PATH)
|
2015-05-28 23:10:45 +02:00
|
|
|
vpath %.pc.in $(SRC_PATH)
|
2014-01-29 09:31:09 +01:00
|
|
|
|
2015-09-12 21:32:00 +02:00
|
|
|
OS=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:]. | sed -E 's/^(net|open|free)bsd/bsd/')
|
2014-01-28 08:05:36 +01:00
|
|
|
ARCH=$(shell uname -m)
|
2013-12-10 09:19:42 +01:00
|
|
|
LIBPREFIX=lib
|
|
|
|
LIBSUFFIX=a
|
2014-02-26 13:31:52 +01:00
|
|
|
CCAS=$(CC)
|
2013-12-17 12:57:27 +01:00
|
|
|
CXX_O=-o $@
|
|
|
|
CXX_LINK_O=-o $@
|
2015-06-26 12:55:15 +02:00
|
|
|
AR_OPTS=cr $@
|
2014-07-02 11:31:55 +02:00
|
|
|
LINK_LOCAL_DIR=-L.
|
2014-01-10 13:19:05 +01:00
|
|
|
LINK_LIB=-l$(1)
|
2013-12-27 23:00:32 +01:00
|
|
|
CFLAGS_OPT=-O3
|
|
|
|
CFLAGS_DEBUG=-g
|
2014-01-23 14:03:15 +01:00
|
|
|
BUILDTYPE=Release
|
2014-01-30 10:32:51 +01:00
|
|
|
V=Yes
|
2014-01-27 13:54:47 +01:00
|
|
|
PREFIX=/usr/local
|
2014-02-19 10:50:45 +01:00
|
|
|
SHARED=-shared
|
2014-03-18 10:21:46 +01:00
|
|
|
OBJ=o
|
2015-01-06 22:24:51 +01:00
|
|
|
DESTDIR=
|
2015-06-19 16:23:34 +02:00
|
|
|
LIBDIR_NAME=lib
|
2014-12-01 13:28:45 +01:00
|
|
|
SHAREDLIB_DIR=$(PREFIX)/lib
|
2014-05-02 17:12:40 +02:00
|
|
|
PROJECT_NAME=openh264
|
2014-06-18 04:54:16 +02:00
|
|
|
MODULE_NAME=gmpopenh264
|
2015-04-03 18:39:02 +02:00
|
|
|
GMP_API_BRANCH=Firefox39
|
2014-05-08 13:02:53 +02:00
|
|
|
CCASFLAGS=$(CFLAGS)
|
2015-01-02 20:54:21 +01:00
|
|
|
STATIC_LDFLAGS=-lstdc++
|
2013-12-12 05:24:55 +01:00
|
|
|
|
2015-11-10 18:50:06 +01:00
|
|
|
VERSION=1.6
|
|
|
|
SHAREDLIBVERSION=2
|
2015-04-22 08:14:47 +02:00
|
|
|
|
2014-01-29 09:31:09 +01:00
|
|
|
ifeq (,$(wildcard $(SRC_PATH)gmp-api))
|
2014-06-18 04:54:16 +02:00
|
|
|
HAVE_GMP_API=No
|
|
|
|
else
|
|
|
|
HAVE_GMP_API=Yes
|
|
|
|
endif
|
|
|
|
|
2014-01-29 09:31:09 +01:00
|
|
|
ifeq (,$(wildcard $(SRC_PATH)gtest))
|
2013-12-12 05:24:55 +01:00
|
|
|
HAVE_GTEST=No
|
|
|
|
else
|
2013-12-12 03:56:52 +01:00
|
|
|
HAVE_GTEST=Yes
|
2013-12-12 05:24:55 +01:00
|
|
|
endif
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2013-12-10 11:57:32 +01:00
|
|
|
# Configurations
|
|
|
|
ifeq ($(BUILDTYPE), Release)
|
2013-12-27 23:00:32 +01:00
|
|
|
CFLAGS += $(CFLAGS_OPT)
|
2013-12-10 11:57:32 +01:00
|
|
|
USE_ASM = Yes
|
2015-12-04 02:15:27 +01:00
|
|
|
ifeq ($(DEBUGSYMBOLS), True)
|
|
|
|
CFLAGS += -g
|
|
|
|
CXXFLAGS += -g
|
|
|
|
endif
|
2013-12-10 11:57:32 +01:00
|
|
|
else
|
2015-01-16 12:49:52 +01:00
|
|
|
CFLAGS += $(CFLAGS_DEBUG)
|
2013-12-10 11:57:32 +01:00
|
|
|
USE_ASM = No
|
|
|
|
endif
|
2014-01-03 07:49:45 +01:00
|
|
|
|
2014-01-09 19:25:15 +01:00
|
|
|
ifeq ($(USE_ASAN), Yes)
|
|
|
|
CFLAGS += -fsanitize=address
|
|
|
|
LDFLAGS += -fsanitize=address
|
|
|
|
endif
|
|
|
|
|
2015-12-08 02:52:03 +01:00
|
|
|
STRIP_FLAGS := -S
|
|
|
|
ifeq (linux, $((OS)))
|
|
|
|
STRIP_FLAGS := -g
|
|
|
|
endif
|
|
|
|
|
2015-04-22 08:20:31 +02:00
|
|
|
# Make sure the all target is the first one
|
|
|
|
all: libraries binaries
|
|
|
|
|
2014-01-29 09:31:09 +01:00
|
|
|
include $(SRC_PATH)build/platform-$(OS).mk
|
2013-12-13 12:50:04 +01:00
|
|
|
|
2015-11-18 12:47:39 +01:00
|
|
|
MODULE := $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX)
|
2013-12-10 11:57:32 +01:00
|
|
|
|
2014-12-16 11:18:54 +01:00
|
|
|
CFLAGS += -DGENERATED_VERSION_HEADER
|
2013-12-10 11:57:32 +01:00
|
|
|
LDFLAGS +=
|
|
|
|
|
2014-03-13 09:38:33 +01:00
|
|
|
ifeq (Yes, $(GCOV))
|
|
|
|
CFLAGS += -fprofile-arcs -ftest-coverage
|
|
|
|
LDFLAGS += -lgcov
|
|
|
|
endif
|
2013-12-10 11:57:32 +01:00
|
|
|
|
|
|
|
#### No user-serviceable parts below this line
|
2014-01-30 10:32:51 +01:00
|
|
|
ifneq ($(V),Yes)
|
2015-04-22 08:23:08 +02:00
|
|
|
QUIET_CXX = @printf "CXX\t$@\n";
|
|
|
|
QUIET_CC = @printf "CC\t$@\n";
|
2014-02-26 13:31:52 +01:00
|
|
|
QUIET_CCAS = @printf "CCAS\t$@\n";
|
2015-04-22 08:23:08 +02:00
|
|
|
QUIET_ASM = @printf "ASM\t$@\n";
|
|
|
|
QUIET_AR = @printf "AR\t$@\n";
|
|
|
|
QUIET_RC = @printf "RC\t$@\n";
|
|
|
|
QUIET = @
|
2014-01-30 10:32:51 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2015-05-29 14:51:58 +02:00
|
|
|
INCLUDES += -I$(SRC_PATH)codec/api/svc -I$(SRC_PATH)codec/common/inc -Icodec/common/inc
|
2013-12-10 11:57:32 +01:00
|
|
|
|
2014-07-02 11:27:28 +02:00
|
|
|
DECODER_INCLUDES += \
|
2014-01-29 09:31:09 +01:00
|
|
|
-I$(SRC_PATH)codec/decoder/core/inc \
|
|
|
|
-I$(SRC_PATH)codec/decoder/plus/inc
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2014-07-02 11:27:28 +02:00
|
|
|
ENCODER_INCLUDES += \
|
2014-01-29 09:31:09 +01:00
|
|
|
-I$(SRC_PATH)codec/encoder/core/inc \
|
|
|
|
-I$(SRC_PATH)codec/encoder/plus/inc \
|
|
|
|
-I$(SRC_PATH)codec/processing/interface
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2014-07-02 11:27:28 +02:00
|
|
|
PROCESSING_INCLUDES += \
|
2014-01-29 09:31:09 +01:00
|
|
|
-I$(SRC_PATH)codec/processing/interface \
|
|
|
|
-I$(SRC_PATH)codec/processing/src/common \
|
2014-07-22 07:06:34 +02:00
|
|
|
-I$(SRC_PATH)codec/processing/src/adaptivequantization \
|
2014-08-27 09:40:14 +02:00
|
|
|
-I$(SRC_PATH)codec/processing/src/downsample \
|
2014-08-27 07:53:18 +02:00
|
|
|
-I$(SRC_PATH)codec/processing/src/scrolldetection \
|
|
|
|
-I$(SRC_PATH)codec/processing/src/vaacalc
|
2014-02-19 13:39:43 +01:00
|
|
|
|
2014-02-20 11:07:57 +01:00
|
|
|
GTEST_INCLUDES += \
|
2014-01-29 09:31:09 +01:00
|
|
|
-I$(SRC_PATH)gtest \
|
|
|
|
-I$(SRC_PATH)gtest/include
|
2014-01-19 15:54:10 +01:00
|
|
|
|
2014-02-20 11:07:57 +01:00
|
|
|
CODEC_UNITTEST_INCLUDES += \
|
2014-01-29 09:31:09 +01:00
|
|
|
-I$(SRC_PATH)gtest/include \
|
|
|
|
-I$(SRC_PATH)codec/common/inc \
|
2015-02-01 23:07:46 +01:00
|
|
|
-I$(SRC_PATH)test
|
2014-01-17 08:55:21 +01:00
|
|
|
|
2014-07-02 11:27:28 +02:00
|
|
|
CONSOLE_COMMON_INCLUDES += \
|
2014-01-29 09:31:09 +01:00
|
|
|
-I$(SRC_PATH)codec/console/common/inc
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2014-01-29 09:31:09 +01:00
|
|
|
H264DEC_INCLUDES += $(DECODER_INCLUDES) $(CONSOLE_COMMON_INCLUDES) -I$(SRC_PATH)codec/console/dec/inc
|
2014-07-02 11:31:55 +02:00
|
|
|
H264DEC_LDFLAGS = $(LINK_LOCAL_DIR) $(call LINK_LIB,decoder) $(call LINK_LIB,common) $(call LINK_LIB,console_common)
|
2014-06-29 18:20:12 +02:00
|
|
|
H264DEC_DEPS = $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX) $(LIBPREFIX)console_common.$(LIBSUFFIX)
|
|
|
|
|
2014-01-29 09:31:09 +01:00
|
|
|
H264ENC_INCLUDES += $(ENCODER_INCLUDES) $(CONSOLE_COMMON_INCLUDES) -I$(SRC_PATH)codec/console/enc/inc
|
2014-07-02 11:31:55 +02:00
|
|
|
H264ENC_LDFLAGS = $(LINK_LOCAL_DIR) $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common) $(call LINK_LIB,console_common)
|
2014-06-29 18:20:12 +02:00
|
|
|
H264ENC_DEPS = $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX) $(LIBPREFIX)console_common.$(LIBSUFFIX)
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2014-07-02 11:31:55 +02:00
|
|
|
CODEC_UNITTEST_LDFLAGS = $(LINK_LOCAL_DIR) $(call LINK_LIB,gtest) $(call LINK_LIB,decoder) $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common) $(CODEC_UNITTEST_LDFLAGS_SUFFIX)
|
2014-01-09 11:42:42 +01:00
|
|
|
CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
|
2015-02-01 23:07:46 +01:00
|
|
|
DECODER_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(DECODER_INCLUDES)
|
|
|
|
ENCODER_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(ENCODER_INCLUDES)
|
|
|
|
PROCESSING_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(PROCESSING_INCLUDES)
|
|
|
|
API_TEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES)
|
2015-02-02 11:20:40 +01:00
|
|
|
COMMON_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES)
|
2014-01-29 09:31:09 +01:00
|
|
|
MODULE_INCLUDES += -I$(SRC_PATH)gmp-api
|
2014-06-18 04:54:16 +02:00
|
|
|
|
2015-01-16 09:33:06 +01:00
|
|
|
DECODER_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
|
|
|
ENCODER_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
|
|
|
PROCESSING_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
|
|
|
API_TEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
|
|
|
COMMON_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
|
|
|
|
2015-01-02 20:56:38 +01:00
|
|
|
.PHONY: test gtest-bootstrap clean $(PROJECT_NAME).pc $(PROJECT_NAME)-static.pc
|
2013-12-13 22:09:59 +01:00
|
|
|
|
2014-07-23 23:26:42 +02:00
|
|
|
generate-version:
|
2015-05-29 14:51:58 +02:00
|
|
|
$(QUIET)sh $(SRC_PATH)codec/common/generate_version.sh $(SRC_PATH)
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2014-07-23 23:26:42 +02:00
|
|
|
codec/decoder/plus/src/welsDecoderExt.$(OBJ): | generate-version
|
|
|
|
codec/encoder/plus/src/welsEncoderExt.$(OBJ): | generate-version
|
2014-07-23 23:24:12 +02:00
|
|
|
|
2013-12-10 09:19:42 +01:00
|
|
|
clean:
|
2014-06-03 05:21:10 +02:00
|
|
|
ifeq (android,$(OS))
|
2014-06-05 03:23:19 +02:00
|
|
|
clean: clean_Android
|
2014-06-03 05:21:10 +02:00
|
|
|
endif
|
2016-01-21 09:23:34 +01:00
|
|
|
$(QUIET)rm -f $(OBJS) $(OBJS:.$(OBJ)=.d) $(OBJS:.$(OBJ)=.obj) $(LIBRARIES) $(BINARIES) *.lib *.a *.dylib *.dll *.so *.exe *.pdb *.exp *.pc *.res *.map
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2014-06-18 04:54:16 +02:00
|
|
|
gmp-bootstrap:
|
2014-07-09 23:51:16 +02:00
|
|
|
if [ ! -d gmp-api ] ; then git clone https://github.com/mozilla/gmp-api gmp-api ; fi
|
|
|
|
cd gmp-api && git fetch origin && git checkout $(GMP_API_BRANCH)
|
2014-06-18 04:54:16 +02:00
|
|
|
|
2013-12-12 05:24:55 +01:00
|
|
|
gtest-bootstrap:
|
|
|
|
svn co https://googletest.googlecode.com/svn/trunk/ gtest
|
2013-12-10 11:57:32 +01:00
|
|
|
|
2014-01-12 13:08:56 +01:00
|
|
|
ifeq ($(HAVE_GTEST),Yes)
|
2014-05-20 08:19:23 +02:00
|
|
|
|
2014-06-05 10:40:28 +02:00
|
|
|
ifneq (android,$(OS))
|
2014-06-05 10:20:50 +02:00
|
|
|
ifneq (ios,$(OS))
|
2015-04-17 14:04:26 +02:00
|
|
|
ifneq (msvc-wp,$(OS))
|
2015-04-17 14:51:14 +02:00
|
|
|
BUILD_UT_EXE=Yes
|
|
|
|
endif
|
2014-05-20 08:19:23 +02:00
|
|
|
endif
|
2014-06-05 10:20:50 +02:00
|
|
|
endif
|
2015-04-17 14:51:14 +02:00
|
|
|
|
|
|
|
test: codec_unittest$(EXEEXT)
|
|
|
|
ifeq ($(BUILD_UT_EXE), Yes)
|
|
|
|
./codec_unittest
|
2015-04-17 14:04:26 +02:00
|
|
|
endif
|
2014-06-05 10:20:50 +02:00
|
|
|
|
2014-01-12 13:08:56 +01:00
|
|
|
else
|
2014-01-17 10:05:33 +01:00
|
|
|
test:
|
2015-04-22 08:18:19 +02:00
|
|
|
@echo "./gtest: No such file or directory."
|
2014-01-12 13:08:56 +01:00
|
|
|
@echo "You do not have gtest. Run make gtest-bootstrap to get gtest"
|
|
|
|
endif
|
2013-12-13 22:09:59 +01:00
|
|
|
|
2014-01-29 09:31:09 +01:00
|
|
|
include $(SRC_PATH)codec/common/targets.mk
|
|
|
|
include $(SRC_PATH)codec/decoder/targets.mk
|
|
|
|
include $(SRC_PATH)codec/encoder/targets.mk
|
|
|
|
include $(SRC_PATH)codec/processing/targets.mk
|
2014-02-19 02:54:27 +01:00
|
|
|
|
2014-06-18 04:54:16 +02:00
|
|
|
ifeq ($(HAVE_GMP_API),Yes)
|
2014-01-29 09:31:09 +01:00
|
|
|
include $(SRC_PATH)module/targets.mk
|
2014-06-18 04:54:16 +02:00
|
|
|
endif
|
|
|
|
|
2014-02-19 02:54:27 +01:00
|
|
|
ifneq (android, $(OS))
|
2014-03-01 16:24:15 +01:00
|
|
|
ifneq (ios, $(OS))
|
2015-04-17 08:10:12 +02:00
|
|
|
ifneq (msvc-wp, $(OS))
|
2014-01-29 09:31:09 +01:00
|
|
|
include $(SRC_PATH)codec/console/dec/targets.mk
|
|
|
|
include $(SRC_PATH)codec/console/enc/targets.mk
|
|
|
|
include $(SRC_PATH)codec/console/common/targets.mk
|
2014-02-19 02:54:27 +01:00
|
|
|
endif
|
2014-03-01 16:24:15 +01:00
|
|
|
endif
|
2015-04-17 08:10:12 +02:00
|
|
|
endif
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2015-04-17 14:36:33 +02:00
|
|
|
libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX)
|
|
|
|
|
|
|
|
# No point in building dylib for ios
|
2014-06-05 10:20:50 +02:00
|
|
|
ifneq (ios, $(OS))
|
2015-04-17 14:36:33 +02:00
|
|
|
libraries: $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX)
|
2015-04-17 08:10:12 +02:00
|
|
|
endif
|
2015-04-17 14:36:33 +02:00
|
|
|
|
2014-11-13 14:18:33 +01:00
|
|
|
LIBRARIES += $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
|
2014-01-27 13:42:36 +01:00
|
|
|
|
2014-05-02 17:12:40 +02:00
|
|
|
$(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
2014-02-18 09:33:09 +01:00
|
|
|
$(QUIET)rm -f $@
|
|
|
|
$(QUIET_AR)$(AR) $(AR_OPTS) $+
|
2015-12-08 02:52:03 +01:00
|
|
|
ifeq (True, $(DEBUGSYMBOLS))
|
|
|
|
strip $(STRIP_FLAGS) $@ -o $(LIBPREFIX)$(PROJECT_NAME)_stripped.$(LIBSUFFIX)
|
|
|
|
endif
|
2014-01-27 13:42:36 +01:00
|
|
|
|
2014-11-13 14:18:33 +01:00
|
|
|
$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
2014-02-19 10:47:09 +01:00
|
|
|
$(QUIET)rm -f $@
|
2014-10-22 08:40:16 +02:00
|
|
|
$(QUIET_CXX)$(CXX) $(SHARED) $(CXX_LINK_O) $+ $(LDFLAGS) $(SHLDFLAGS)
|
2015-12-08 02:52:03 +01:00
|
|
|
ifeq (True, $(DEBUGSYMBOLS))
|
|
|
|
strip $(STRIP_FLAGS) $@ -o $(LIBPREFIX)$(PROJECT_NAME)_stripped.$(SHAREDLIBSUFFIXVER)
|
|
|
|
endif
|
2014-12-01 13:22:56 +01:00
|
|
|
|
|
|
|
ifneq ($(SHAREDLIBSUFFIXVER),$(SHAREDLIBSUFFIX))
|
|
|
|
$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX): $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
|
|
|
|
$(QUIET)ln -sfn $+ $@
|
|
|
|
endif
|
2014-02-19 02:54:27 +01:00
|
|
|
|
2014-06-18 04:54:16 +02:00
|
|
|
ifeq ($(HAVE_GMP_API),Yes)
|
2015-11-18 12:47:39 +01:00
|
|
|
plugin: $(MODULE)
|
2014-11-13 14:18:33 +01:00
|
|
|
LIBRARIES += $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER)
|
2014-06-18 04:54:16 +02:00
|
|
|
else
|
|
|
|
plugin:
|
2015-04-22 08:18:19 +02:00
|
|
|
@echo "./gmp-api: No such file or directory."
|
2014-06-18 04:54:16 +02:00
|
|
|
@echo "You do not have gmp-api. Run make gmp-bootstrap to get the gmp-api headers."
|
|
|
|
endif
|
|
|
|
|
2015-11-18 12:47:39 +01:00
|
|
|
echo-plugin-name:
|
|
|
|
@echo $(MODULE)
|
|
|
|
|
2014-11-13 14:18:33 +01:00
|
|
|
$(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER): $(MODULE_OBJS) $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
2014-06-18 04:54:16 +02:00
|
|
|
$(QUIET)rm -f $@
|
2014-10-22 08:40:16 +02:00
|
|
|
$(QUIET_CXX)$(CXX) $(SHARED) $(CXX_LINK_O) $+ $(LDFLAGS) $(SHLDFLAGS) $(MODULE_LDFLAGS)
|
2015-12-08 02:52:03 +01:00
|
|
|
ifeq (True, $(DEBUGSYMBOLS))
|
|
|
|
strip $(STRIP_FLAGS) $@ -o $(LIBPREFIX)$(MODULE_NAME)_stripped.$(SHAREDLIBSUFFIXVER)
|
|
|
|
endif
|
2014-12-01 13:22:56 +01:00
|
|
|
|
|
|
|
ifneq ($(SHAREDLIBSUFFIXVER),$(SHAREDLIBSUFFIX))
|
2015-11-18 12:47:39 +01:00
|
|
|
$(MODULE): $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER)
|
2014-12-01 13:22:56 +01:00
|
|
|
$(QUIET)ln -sfn $+ $@
|
2015-12-08 02:52:03 +01:00
|
|
|
ifeq (True, $(DEBUGSYMBOLS))
|
|
|
|
$(QUIET)ln -sfn $(LIBPREFIX)$(MODULE_NAME)_stripped.$(SHAREDLIBSUFFIXVER) $(LIBPREFIX)$(MODULE_NAME)_stripped.$(SHAREDLIBSUFFIX)
|
|
|
|
endif
|
2014-12-01 13:22:56 +01:00
|
|
|
endif
|
2014-06-18 04:54:16 +02:00
|
|
|
|
2015-05-28 23:10:45 +02:00
|
|
|
$(PROJECT_NAME).pc: $(PROJECT_NAME).pc.in
|
2015-05-25 13:02:12 +02:00
|
|
|
@sed -e 's;@prefix@;$(PREFIX);' -e 's;@VERSION@;$(VERSION);' -e 's;@LIBS@;;' -e 's;@LIBS_PRIVATE@;$(STATIC_LDFLAGS);' < $< > $@
|
2015-01-02 20:56:38 +01:00
|
|
|
|
2015-05-28 23:10:45 +02:00
|
|
|
$(PROJECT_NAME)-static.pc: $(PROJECT_NAME).pc.in
|
2015-05-25 13:02:12 +02:00
|
|
|
@sed -e 's;@prefix@;$(PREFIX);' -e 's;@VERSION@;$(VERSION);' -e 's;@LIBS@;$(STATIC_LDFLAGS);' -e 's;@LIBS_PRIVATE@;;' < $< > $@
|
2014-10-26 23:25:15 +01:00
|
|
|
|
2014-03-07 14:10:46 +01:00
|
|
|
install-headers:
|
2015-03-16 14:47:32 +01:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/include/wels
|
2015-05-25 13:02:12 +02:00
|
|
|
install -m 644 $(SRC_PATH)/codec/api/svc/codec*.h $(DESTDIR)$(PREFIX)/include/wels
|
2014-03-07 14:10:46 +01:00
|
|
|
|
2015-01-02 20:56:38 +01:00
|
|
|
install-static-lib: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) install-headers
|
2015-06-19 16:23:34 +02:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/$(LIBDIR_NAME)
|
|
|
|
install -m 644 $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(DESTDIR)$(PREFIX)/$(LIBDIR_NAME)
|
2014-03-07 14:10:46 +01:00
|
|
|
|
2015-01-02 20:56:38 +01:00
|
|
|
install-static: install-static-lib $(PROJECT_NAME)-static.pc
|
2015-06-19 16:23:34 +02:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/$(LIBDIR_NAME)/pkgconfig
|
|
|
|
install -m 644 $(PROJECT_NAME)-static.pc $(DESTDIR)$(PREFIX)/$(LIBDIR_NAME)/pkgconfig/$(PROJECT_NAME).pc
|
2015-01-02 20:56:38 +01:00
|
|
|
|
2014-12-01 13:22:56 +01:00
|
|
|
install-shared: $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) install-headers $(PROJECT_NAME).pc
|
2015-03-16 14:47:32 +01:00
|
|
|
mkdir -p $(DESTDIR)$(SHAREDLIB_DIR)
|
|
|
|
install -m 755 $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER) $(DESTDIR)$(SHAREDLIB_DIR)
|
2014-12-01 13:19:13 +01:00
|
|
|
if [ "$(SHAREDLIBSUFFIXVER)" != "$(SHAREDLIBSUFFIX)" ]; then \
|
2015-03-16 14:47:32 +01:00
|
|
|
cp -a $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR); \
|
2014-11-13 14:18:33 +01:00
|
|
|
fi
|
2015-06-19 16:23:34 +02:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/$(LIBDIR_NAME)/pkgconfig
|
|
|
|
install -m 644 $(PROJECT_NAME).pc $(DESTDIR)$(PREFIX)/$(LIBDIR_NAME)/pkgconfig
|
2014-02-19 12:12:52 +01:00
|
|
|
ifneq ($(EXTRA_LIBRARY),)
|
2015-06-19 16:23:34 +02:00
|
|
|
install -m 644 $(EXTRA_LIBRARY) $(DESTDIR)$(PREFIX)/$(LIBDIR_NAME)
|
2014-02-19 12:12:52 +01:00
|
|
|
endif
|
2014-03-07 14:10:46 +01:00
|
|
|
|
2015-01-02 20:56:38 +01:00
|
|
|
install: install-static-lib install-shared
|
2014-03-07 14:10:46 +01:00
|
|
|
@:
|
2014-01-27 13:42:36 +01:00
|
|
|
|
2015-04-17 14:56:56 +02:00
|
|
|
ifneq ($(HAVE_GTEST),Yes)
|
|
|
|
binaries:
|
|
|
|
@:
|
|
|
|
else
|
2014-01-29 09:31:09 +01:00
|
|
|
include $(SRC_PATH)build/gtest-targets.mk
|
|
|
|
include $(SRC_PATH)test/api/targets.mk
|
|
|
|
include $(SRC_PATH)test/decoder/targets.mk
|
|
|
|
include $(SRC_PATH)test/encoder/targets.mk
|
|
|
|
include $(SRC_PATH)test/processing/targets.mk
|
|
|
|
include $(SRC_PATH)test/common/targets.mk
|
2014-05-20 08:19:23 +02:00
|
|
|
|
2014-06-06 11:44:22 +02:00
|
|
|
LIBRARIES += $(LIBPREFIX)ut.$(LIBSUFFIX)
|
2014-06-12 03:37:30 +02:00
|
|
|
$(LIBPREFIX)ut.$(LIBSUFFIX): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(COMMON_UNITTEST_OBJS) $(API_TEST_OBJS)
|
2014-06-05 10:20:50 +02:00
|
|
|
$(QUIET)rm -f $@
|
|
|
|
$(QUIET_AR)$(AR) $(AR_OPTS) $+
|
|
|
|
|
2014-05-20 08:19:23 +02:00
|
|
|
|
|
|
|
LIBRARIES +=$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX)
|
2015-04-17 14:46:15 +02:00
|
|
|
$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) $(COMMON_UNITTEST_OBJS) $(CODEC_UNITTEST_DEPS)
|
2014-05-20 08:19:23 +02:00
|
|
|
$(QUIET)rm -f $@
|
2015-04-17 08:10:12 +02:00
|
|
|
$(QUIET_CXX)$(CXX) $(SHARED) $(CXX_LINK_O) $+ $(LDFLAGS) $(UTSHLDFLAGS) $(CODEC_UNITTEST_LDFLAGS)
|
2014-05-20 08:19:23 +02:00
|
|
|
|
2014-03-25 04:11:53 +01:00
|
|
|
binaries: codec_unittest$(EXEEXT)
|
|
|
|
BINARIES += codec_unittest$(EXEEXT)
|
2014-05-20 08:19:23 +02:00
|
|
|
|
2015-04-17 14:51:14 +02:00
|
|
|
ifeq ($(BUILD_UT_EXE), Yes)
|
|
|
|
# Build a normal command line executable
|
|
|
|
codec_unittest$(EXEEXT): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) $(COMMON_UNITTEST_OBJS) $(CODEC_UNITTEST_DEPS) | res
|
|
|
|
$(QUIET)rm -f $@
|
|
|
|
$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $+ $(CODEC_UNITTEST_LDFLAGS) $(LDFLAGS)
|
|
|
|
|
|
|
|
res:
|
|
|
|
$(QUIET)if [ ! -e res ]; then ln -s $(SRC_PATH)res .; fi
|
|
|
|
else
|
|
|
|
|
|
|
|
# Build the unit test suite into a library that is included in a project file
|
2014-06-05 10:20:50 +02:00
|
|
|
ifeq (ios,$(OS))
|
2014-06-10 15:10:48 +02:00
|
|
|
codec_unittest$(EXEEXT): $(LIBPREFIX)ut.$(LIBSUFFIX) $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX)
|
2014-06-05 10:20:50 +02:00
|
|
|
else
|
2015-04-17 14:51:14 +02:00
|
|
|
codec_unittest$(EXEEXT): $(LIBPREFIX)ut.$(SHAREDLIBSUFFIX)
|
|
|
|
endif
|
|
|
|
|
2014-06-05 10:20:50 +02:00
|
|
|
ifeq (android,$(OS))
|
2014-01-29 09:31:09 +01:00
|
|
|
ifeq (./,$(SRC_PATH))
|
2015-04-17 14:51:14 +02:00
|
|
|
codec_unittest$(EXEEXT):
|
2014-05-20 08:19:23 +02:00
|
|
|
cd ./test/build/android && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug
|
|
|
|
|
2014-06-05 03:23:19 +02:00
|
|
|
clean_Android: clean_Android_ut
|
2014-06-03 05:21:10 +02:00
|
|
|
clean_Android_ut:
|
2014-07-02 12:41:27 +02:00
|
|
|
-cd ./test/build/android && $(NDKROOT)/ndk-build APP_ABI=$(APP_ABI) clean && ant clean
|
2014-01-29 09:31:09 +01:00
|
|
|
endif
|
2015-04-17 08:10:12 +02:00
|
|
|
endif
|
2014-01-29 09:31:09 +01:00
|
|
|
|
2014-05-20 08:19:23 +02:00
|
|
|
endif
|
2014-06-05 10:20:50 +02:00
|
|
|
endif
|
|
|
|
|
2014-03-18 10:21:46 +01:00
|
|
|
-include $(OBJS:.$(OBJ)=.d)
|
2014-01-29 09:31:09 +01:00
|
|
|
|
|
|
|
OBJDIRS = $(sort $(dir $(OBJS)))
|
|
|
|
|
|
|
|
$(OBJDIRS):
|
|
|
|
$(QUIET)mkdir -p $@
|
|
|
|
|
|
|
|
$(OBJS): | $(OBJDIRS)
|