openh264/Makefile

176 lines
5.0 KiB
Makefile
Raw Normal View History

2014-02-19 02:54:27 +01:00
OS=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:].)
ARCH=$(shell uname -m)
LIBPREFIX=lib
LIBSUFFIX=a
CCAS=$(CC)
CXX_O=-o $@
CXX_LINK_O=-o $@
AR_OPTS=cr $@
LINK_LIB=-l$(1)
CFLAGS_OPT=-O3
CFLAGS_DEBUG=-g
BUILDTYPE=Release
V=Yes
2014-01-27 13:54:47 +01:00
PREFIX=/usr/local
SHARED=-shared
OBJ=o
PROJECT_NAME=openh264
2013-12-12 05:24:55 +01:00
2013-12-12 06:12:20 +01:00
ifeq (,$(wildcard ./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
# Configurations
ifeq ($(BUILDTYPE), Release)
CFLAGS += $(CFLAGS_OPT)
USE_ASM = Yes
else
CFLAGS = $(CFLAGS_DEBUG)
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
2014-02-19 02:54:27 +01:00
include build/platform-$(OS).mk
CFLAGS +=
LDFLAGS +=
ifeq (Yes, $(GCOV))
CFLAGS += -fprofile-arcs -ftest-coverage
LDFLAGS += -lgcov
endif
#### No user-serviceable parts below this line
ifneq ($(V),Yes)
QUIET_CXX = @printf "CXX\t$@\n";
QUIET_CC = @printf "CC\t$@\n";
QUIET_CCAS = @printf "CCAS\t$@\n";
QUIET_ASM = @printf "ASM\t$@\n";
QUIET_AR = @printf "AR\t$@\n";
QUIET = @
endif
2014-03-19 03:47:26 +01:00
INCLUDES = -Icodec/api/svc -Icodec/common/inc
DECODER_INCLUDES = \
-Icodec/decoder/core/inc \
-Icodec/decoder/plus/inc
ENCODER_INCLUDES = \
-Icodec/encoder/core/inc \
-Icodec/encoder/plus/inc \
-Icodec/processing/interface
PROCESSING_INCLUDES = \
-Icodec/processing/interface \
Squashed commit of the following: commit f73d6cf0fcae5f401fc2817ab736af996113ca09 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 15:02:21 2014 +0800 remove comments commit 75416c2cf6c1ebb7aabf9e8c52d8c7163a8009b7 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 14:52:09 2014 +0800 for test commit 7dfb65ce514edcff892bfb3919921cadcce1d055 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 14:12:31 2014 +0800 for test commit eff771645e8c349dc4e454ab1751530b3cef18ed Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 10:51:34 2014 +0800 for test commit 9c42b9a7a04068e70be94529941f549b58e63780 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 17:46:59 2014 +0800 update cpu_flag commit cce3fccc0a4249b82ab2e0e92fe53579ef942799 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 17:26:56 2014 +0800 for test commit 3d292995b3c4437a2674a687cc4e8da1b5fb83f5 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:45:57 2014 +0800 remove space commit c608c2ba7cf010f1dcf8c0344f68536c48e181cb Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:42:43 2014 +0800 remove tabs commit 3b769342a06e25ad23a2c86f23a94d0d7ca1a4c8 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:33:55 2014 +0800 refine UT case commit 89b869f0c8f8c9bbd61e9de32caa77877aeae064 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Tue Apr 22 13:40:50 2014 +0800 Squashed commit of the following: commit abe55494134ef8342ffe9566df4e1b3265fe21b6 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Tue Apr 22 10:50:07 2014 +0800 set MV range commit 8c7f70c351e50d945c29118bed8b3781c22b7dbc Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Mon Apr 21 16:53:10 2014 +0800 refinement commit bf35f19a7dc88743aacf8e89e681e0ef3302d40a Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 17:24:31 2014 +0800 correct tabs commit 130b7f895d7020bfc571d910966891da93150242 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 17:17:06 2014 +0800 correct format commit 0429703b0844363559dd2b3d44e45034232a9d8f Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 15:12:44 2014 +0800 add scroll UT
2014-04-24 09:12:49 +02:00
-Icodec/processing/src/common \
-Icodec/processing/src/scrolldetection
GTEST_INCLUDES += \
2014-01-19 15:54:10 +01:00
-Igtest \
-Igtest/include
CODEC_UNITTEST_INCLUDES += \
2014-03-14 09:40:02 +01:00
-Igtest/include \
2014-03-19 03:47:26 +01:00
-Icodec/common/inc \
H264DEC_INCLUDES = $(DECODER_INCLUDES) -Icodec/console/dec/inc
H264DEC_LDFLAGS = -L. $(call LINK_LIB,decoder) $(call LINK_LIB,common)
H264DEC_DEPS = $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
H264ENC_INCLUDES = $(ENCODER_INCLUDES) -Icodec/console/enc/inc
H264ENC_LDFLAGS = -L. $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common)
H264ENC_DEPS = $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
CODEC_UNITTEST_LDFLAGS = -L. $(call LINK_LIB,gtest) $(call LINK_LIB,decoder) $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common) $(CODEC_UNITTEST_LDFLAGS_SUFFIX)
CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
2014-03-25 02:21:45 +01:00
DECODER_UNITTEST_INCLUDES = $(CODEC_UNITTEST_INCLUDES) $(DECODER_INCLUDES) -Itest -Itest/decoder
ENCODER_UNITTEST_INCLUDES = $(CODEC_UNITTEST_INCLUDES) $(ENCODER_INCLUDES) -Itest -Itest/encoder
Squashed commit of the following: commit f73d6cf0fcae5f401fc2817ab736af996113ca09 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 15:02:21 2014 +0800 remove comments commit 75416c2cf6c1ebb7aabf9e8c52d8c7163a8009b7 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 14:52:09 2014 +0800 for test commit 7dfb65ce514edcff892bfb3919921cadcce1d055 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 14:12:31 2014 +0800 for test commit eff771645e8c349dc4e454ab1751530b3cef18ed Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 10:51:34 2014 +0800 for test commit 9c42b9a7a04068e70be94529941f549b58e63780 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 17:46:59 2014 +0800 update cpu_flag commit cce3fccc0a4249b82ab2e0e92fe53579ef942799 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 17:26:56 2014 +0800 for test commit 3d292995b3c4437a2674a687cc4e8da1b5fb83f5 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:45:57 2014 +0800 remove space commit c608c2ba7cf010f1dcf8c0344f68536c48e181cb Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:42:43 2014 +0800 remove tabs commit 3b769342a06e25ad23a2c86f23a94d0d7ca1a4c8 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:33:55 2014 +0800 refine UT case commit 89b869f0c8f8c9bbd61e9de32caa77877aeae064 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Tue Apr 22 13:40:50 2014 +0800 Squashed commit of the following: commit abe55494134ef8342ffe9566df4e1b3265fe21b6 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Tue Apr 22 10:50:07 2014 +0800 set MV range commit 8c7f70c351e50d945c29118bed8b3781c22b7dbc Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Mon Apr 21 16:53:10 2014 +0800 refinement commit bf35f19a7dc88743aacf8e89e681e0ef3302d40a Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 17:24:31 2014 +0800 correct tabs commit 130b7f895d7020bfc571d910966891da93150242 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 17:17:06 2014 +0800 correct format commit 0429703b0844363559dd2b3d44e45034232a9d8f Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 15:12:44 2014 +0800 add scroll UT
2014-04-24 09:12:49 +02:00
PROCESSING_UNITTEST_INCLUDES = $(CODEC_UNITTEST_INCLUDES) $(PROCESSING_INCLUDES) -Itest -Itest/processing
2014-03-25 02:21:45 +01:00
API_TEST_INCLUDES = $(CODEC_UNITTEST_INCLUDES) -Itest -Itest/api
.PHONY: test gtest-bootstrap clean
2013-12-13 22:09:59 +01:00
2013-12-12 06:12:20 +01:00
all: libraries binaries
clean:
$(QUIET)rm -f $(OBJS) $(OBJS:.$(OBJ)=.d) $(LIBRARIES) $(BINARIES)
2013-12-12 05:24:55 +01:00
gtest-bootstrap:
svn co https://googletest.googlecode.com/svn/trunk/ gtest
ifeq ($(HAVE_GTEST),Yes)
test: codec_unittest$(EXEEXT)
2013-12-13 22:09:59 +01:00
./codec_unittest
else
test:
@echo "./gtest : No such file or directory."
@echo "You do not have gtest. Run make gtest-bootstrap to get gtest"
endif
2013-12-13 22:09:59 +01:00
include codec/common/targets.mk
include codec/decoder/targets.mk
include codec/encoder/targets.mk
2014-01-03 07:49:45 +01:00
include codec/processing/targets.mk
2014-02-19 02:54:27 +01:00
ifneq (android, $(OS))
ifneq (ios, $(OS))
include codec/console/dec/targets.mk
include codec/console/enc/targets.mk
2014-02-19 02:54:27 +01:00
endif
endif
libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX)
LIBRARIES += $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX)
$(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
$(QUIET)rm -f $@
$(QUIET_AR)$(AR) $(AR_OPTS) $+
$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
$(QUIET)rm -f $@
$(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+ $(SHLDFLAGS)
2014-02-19 02:54:27 +01:00
install-headers:
2014-01-27 13:54:47 +01:00
mkdir -p $(PREFIX)/include/wels
install -m 644 codec/api/svc/codec*.h $(PREFIX)/include/wels
install-static: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) install-headers
mkdir -p $(PREFIX)/lib
install -m 644 $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(PREFIX)/lib
install-shared: $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) install-headers
mkdir -p $(PREFIX)/lib
install -m 755 $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) $(PREFIX)/lib
ifneq ($(EXTRA_LIBRARY),)
install -m 644 $(EXTRA_LIBRARY) $(PREFIX)/lib
endif
install: install-static install-shared
@:
2013-12-12 05:24:55 +01:00
ifeq ($(HAVE_GTEST),Yes)
include build/gtest-targets.mk
2014-03-25 02:21:45 +01:00
include test/api/targets.mk
include test/decoder/targets.mk
include test/encoder/targets.mk
Squashed commit of the following: commit f73d6cf0fcae5f401fc2817ab736af996113ca09 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 15:02:21 2014 +0800 remove comments commit 75416c2cf6c1ebb7aabf9e8c52d8c7163a8009b7 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 14:52:09 2014 +0800 for test commit 7dfb65ce514edcff892bfb3919921cadcce1d055 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 14:12:31 2014 +0800 for test commit eff771645e8c349dc4e454ab1751530b3cef18ed Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 10:51:34 2014 +0800 for test commit 9c42b9a7a04068e70be94529941f549b58e63780 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 17:46:59 2014 +0800 update cpu_flag commit cce3fccc0a4249b82ab2e0e92fe53579ef942799 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 17:26:56 2014 +0800 for test commit 3d292995b3c4437a2674a687cc4e8da1b5fb83f5 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:45:57 2014 +0800 remove space commit c608c2ba7cf010f1dcf8c0344f68536c48e181cb Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:42:43 2014 +0800 remove tabs commit 3b769342a06e25ad23a2c86f23a94d0d7ca1a4c8 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:33:55 2014 +0800 refine UT case commit 89b869f0c8f8c9bbd61e9de32caa77877aeae064 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Tue Apr 22 13:40:50 2014 +0800 Squashed commit of the following: commit abe55494134ef8342ffe9566df4e1b3265fe21b6 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Tue Apr 22 10:50:07 2014 +0800 set MV range commit 8c7f70c351e50d945c29118bed8b3781c22b7dbc Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Mon Apr 21 16:53:10 2014 +0800 refinement commit bf35f19a7dc88743aacf8e89e681e0ef3302d40a Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 17:24:31 2014 +0800 correct tabs commit 130b7f895d7020bfc571d910966891da93150242 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 17:17:06 2014 +0800 correct format commit 0429703b0844363559dd2b3d44e45034232a9d8f Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 15:12:44 2014 +0800 add scroll UT
2014-04-24 09:12:49 +02:00
include test/processing/targets.mk
2014-03-25 04:11:53 +01:00
binaries: codec_unittest$(EXEEXT)
BINARIES += codec_unittest$(EXEEXT)
Squashed commit of the following: commit f73d6cf0fcae5f401fc2817ab736af996113ca09 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 15:02:21 2014 +0800 remove comments commit 75416c2cf6c1ebb7aabf9e8c52d8c7163a8009b7 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 14:52:09 2014 +0800 for test commit 7dfb65ce514edcff892bfb3919921cadcce1d055 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 14:12:31 2014 +0800 for test commit eff771645e8c349dc4e454ab1751530b3cef18ed Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Thu Apr 24 10:51:34 2014 +0800 for test commit 9c42b9a7a04068e70be94529941f549b58e63780 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 17:46:59 2014 +0800 update cpu_flag commit cce3fccc0a4249b82ab2e0e92fe53579ef942799 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 17:26:56 2014 +0800 for test commit 3d292995b3c4437a2674a687cc4e8da1b5fb83f5 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:45:57 2014 +0800 remove space commit c608c2ba7cf010f1dcf8c0344f68536c48e181cb Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:42:43 2014 +0800 remove tabs commit 3b769342a06e25ad23a2c86f23a94d0d7ca1a4c8 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Wed Apr 23 16:33:55 2014 +0800 refine UT case commit 89b869f0c8f8c9bbd61e9de32caa77877aeae064 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Tue Apr 22 13:40:50 2014 +0800 Squashed commit of the following: commit abe55494134ef8342ffe9566df4e1b3265fe21b6 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Tue Apr 22 10:50:07 2014 +0800 set MV range commit 8c7f70c351e50d945c29118bed8b3781c22b7dbc Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Mon Apr 21 16:53:10 2014 +0800 refinement commit bf35f19a7dc88743aacf8e89e681e0ef3302d40a Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 17:24:31 2014 +0800 correct tabs commit 130b7f895d7020bfc571d910966891da93150242 Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 17:17:06 2014 +0800 correct format commit 0429703b0844363559dd2b3d44e45034232a9d8f Author: lyao2 <lyao2@LYAO2-WS01.cisco.com> Date: Fri Apr 18 15:12:44 2014 +0800 add scroll UT
2014-04-24 09:12:49 +02:00
codec_unittest$(EXEEXT): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) $(CODEC_UNITTEST_DEPS)
2014-03-25 03:58:52 +01:00
$(QUIET)rm -f $@
$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $+ $(CODEC_UNITTEST_LDFLAGS) $(LDFLAGS)
else
binaries:
@:
2014-03-26 02:01:00 +01:00
endif
-include $(OBJS:.$(OBJ)=.d)