openh264/Makefile

138 lines
3.1 KiB
Makefile
Raw Normal View History

2013-12-20 14:43:30 +01:00
UNAME=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:].)
ARCH=$(shell uname -m)
LIBPREFIX=lib
LIBSUFFIX=a
CXX_O=-o $@
CXX_LINK_O=-o $@
AR_OPTS=cr $@
LINK_LIB=-l$(1)
CFLAGS_OPT=-O3
CFLAGS_DEBUG=-g
CFLAGS_M32=-m32
CFLAGS_M64=-m64
BUILDTYPE=Release
V=Yes
2013-12-12 05:24:55 +01:00
ifeq (, $(ENABLE64BIT))
ifeq ($(ARCH), x86_64)
ENABLE64BIT=Yes
endif
endif
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
# 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
2013-12-15 05:37:33 +01:00
ifeq ($(ENABLE64BIT), Yes)
CFLAGS += $(CFLAGS_M64)
LDFLAGS += $(CFLAGS_M64)
ASMFLAGS_PLATFORM = -DUNIX64
2013-12-15 05:37:33 +01:00
else
CFLAGS += $(CFLAGS_M32)
LDFLAGS += $(CFLAGS_M32)
ASMFLAGS_PLATFORM = -DX86_32
2013-12-15 05:37:33 +01:00
endif
2014-01-03 07:49:45 +01:00
include build/platform-$(UNAME).mk
ifeq ($(USE_ASM),Yes)
CFLAGS += -DX86_ASM
endif
CFLAGS += -DNO_DYNAMIC_VP
LDFLAGS +=
ASMFLAGS += $(ASMFLAGS_PLATFORM) -DNO_DYNAMIC_VP
#### No user-serviceable parts below this line
ifneq ($(V),Yes)
QUIET_CXX = @printf "CXX\t$@\n";
QUIET_ASM = @printf "ASM\t$@\n";
QUIET_AR = @printf "AR\t$@\n";
QUIET = @
endif
2014-01-19 15:54:10 +01:00
INCLUDES = -Icodec/api/svc -Icodec/common
2014-01-03 07:49:45 +01:00
#ASM_INCLUDES = -Iprocessing/src/asm/
ASM_INCLUDES = -Icodec/common/
DECODER_INCLUDES = \
-Icodec/decoder/core/inc \
-Icodec/decoder/plus/inc
ENCODER_INCLUDES = \
-Icodec/encoder/core/inc \
2014-01-25 20:06:55 +01:00
-Icodec/encoder/plus/inc
PROCESSING_INCLUDES = \
-Icodec/encoder/core/inc \
-Icodec/encoder/plus/inc
GTEST_INCLUDES = \
2014-01-19 15:54:10 +01:00
-Igtest \
-Igtest/include
CODEC_UNITTEST_INCLUDES = \
-Igtest/include
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)
2014-01-07 03:23:44 +01:00
CODEC_UNITTEST_LDFLAGS = -L. -lgtest -ldecoder -lcrypto -lencoder -lprocessing -lcommon
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
.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:.o=.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
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
-include $(OBJS:.o=.d)