2013-12-20 14:43:30 +01:00
|
|
|
UNAME=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:].)
|
2013-12-10 09:19:42 +01:00
|
|
|
LIBPREFIX=lib
|
|
|
|
LIBSUFFIX=a
|
2013-12-12 05:24:55 +01:00
|
|
|
CP=cp
|
2013-12-10 09:19:42 +01:00
|
|
|
ROOTDIR=$(PWD)
|
2013-12-12 05:24:55 +01:00
|
|
|
|
2014-01-03 07:49:45 +01:00
|
|
|
|
2014-01-09 19:25:15 +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
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2013-12-10 11:57:32 +01:00
|
|
|
# Configurations
|
|
|
|
ifeq ($(BUILDTYPE), Release)
|
|
|
|
CFLAGS += -O3
|
|
|
|
USE_ASM = Yes
|
|
|
|
else
|
|
|
|
CFLAGS = -g
|
|
|
|
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
|
|
|
|
|
2013-12-15 05:37:33 +01:00
|
|
|
ifeq ($(ENABLE64BIT), Yes)
|
|
|
|
CFLAGS += -m64
|
|
|
|
LDFLAGS += -m64
|
2014-01-03 07:49:45 +01:00
|
|
|
ASMFLAGS += -DUNIX64
|
2013-12-15 05:37:33 +01:00
|
|
|
else
|
|
|
|
CFLAGS += -m32
|
|
|
|
LDFLAGS += -m32
|
2014-01-03 07:49:45 +01:00
|
|
|
ASMFLAGS += -DX86_32
|
2013-12-15 05:37:33 +01:00
|
|
|
endif
|
2014-01-03 07:49:45 +01:00
|
|
|
|
2013-12-13 12:50:04 +01:00
|
|
|
include build/platform-$(UNAME).mk
|
|
|
|
|
2013-12-10 11:57:32 +01:00
|
|
|
ifeq ($(USE_ASM),Yes)
|
2013-12-11 15:51:26 +01:00
|
|
|
CFLAGS += -DX86_ASM
|
2013-12-10 11:57:32 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
CFLAGS += -DNO_DYNAMIC_VP -DHAVE_CACHE_LINE_ALIGN
|
|
|
|
LDFLAGS +=
|
2013-12-17 14:13:21 +01:00
|
|
|
ASMFLAGS += -DNO_DYNAMIC_VP
|
2013-12-10 11:57:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
#### No user-serviceable parts below this line
|
2013-12-12 03:56:52 +01:00
|
|
|
INCLUDES = -Icodec/api/svc -Icodec/common -Igtest/include
|
2014-01-03 07:49:45 +01:00
|
|
|
#ASM_INCLUDES = -Iprocessing/src/asm/
|
|
|
|
ASM_INCLUDES = -Icodec/common/
|
2013-12-10 11:57:32 +01:00
|
|
|
|
2013-12-11 15:51:26 +01:00
|
|
|
COMMON_INCLUDES = \
|
|
|
|
-Icodec/decoder/core/inc
|
|
|
|
|
2013-12-10 09:19:42 +01:00
|
|
|
DECODER_INCLUDES = \
|
|
|
|
-Icodec/decoder/core/inc \
|
|
|
|
-Icodec/decoder/plus/inc
|
|
|
|
|
|
|
|
ENCODER_INCLUDES = \
|
|
|
|
-Icodec/encoder/core/inc \
|
|
|
|
-Icodec/encoder/plus/inc \
|
|
|
|
-Icodec/WelsThreadLib/api
|
|
|
|
|
|
|
|
PROCESSING_INCLUDES = \
|
|
|
|
-Icodec/encoder/core/inc \
|
|
|
|
-Icodec/encoder/plus/inc
|
|
|
|
|
|
|
|
H264DEC_INCLUDES = $(DECODER_INCLUDES) -Icodec/console/dec/inc
|
2013-12-11 15:51:26 +01:00
|
|
|
H264DEC_LDFLAGS = -L. -ldecoder -lcommon
|
2014-01-08 15:18:01 +01:00
|
|
|
H264DEC_DEPS = $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
|
2013-12-10 09:19:42 +01:00
|
|
|
|
|
|
|
H264ENC_INCLUDES = $(ENCODER_INCLUDES) -Icodec/console/enc/inc
|
2013-12-11 15:51:26 +01:00
|
|
|
H264ENC_LDFLAGS = -L. -lencoder -lprocessing -lcommon
|
2014-01-08 15:18:01 +01:00
|
|
|
H264ENC_DEPS = $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
|
2013-12-10 09:19:42 +01:00
|
|
|
|
2014-01-07 03:23:44 +01:00
|
|
|
CODEC_UNITTEST_LDFLAGS = -L. -lgtest -ldecoder -lcrypto -lencoder -lprocessing -lcommon
|
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)
|
2013-12-12 03:56:52 +01:00
|
|
|
|
2013-12-13 22:09:59 +01:00
|
|
|
.PHONY: test
|
|
|
|
|
2013-12-12 06:12:20 +01:00
|
|
|
all: libraries binaries
|
2013-12-10 09:19:42 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS) $(LIBRARIES) $(BINARIES)
|
2013-12-12 06:12:20 +01:00
|
|
|
echo $(HAVE_GTEST)
|
2013-12-10 09:19:42 +01: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-09 11:44:32 +01:00
|
|
|
test: codec_unittest
|
2013-12-13 22:09:59 +01:00
|
|
|
./codec_unittest
|
|
|
|
|
2013-12-11 15:51:26 +01:00
|
|
|
include codec/common/targets.mk
|
2013-12-10 09:19:42 +01:00
|
|
|
include codec/decoder/targets.mk
|
|
|
|
include codec/encoder/targets.mk
|
2014-01-03 07:49:45 +01:00
|
|
|
include codec/processing/targets.mk
|
2013-12-10 09:19:42 +01:00
|
|
|
include codec/console/dec/targets.mk
|
|
|
|
include codec/console/enc/targets.mk
|
|
|
|
|
2013-12-12 05:24:55 +01:00
|
|
|
ifeq ($(HAVE_GTEST),Yes)
|
|
|
|
include build/gtest-targets.mk
|
2013-12-12 03:56:52 +01:00
|
|
|
include test/targets.mk
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-10 09:19:42 +01:00
|
|
|
|
|
|
|
|
2013-12-12 05:24:55 +01:00
|
|
|
|