Fixup for windows release builds.
Adds in Linux build for the echo_test decoder and necessary updates to test makefile and master makefiles.
Signed-off-by: Mike Leach mike.leach@linaro.org --- decoder/build/linux/makefile | 1 + decoder/build/linux/rctdl_c_api_lib/makefile | 3 +- decoder/source/c_api/ocsd_c_api_custom_obj.cpp | 4 +- .../build/linux/c_api_pkt_print_test/makefile | 4 +- .../tests/build/linux/echo_test_dcd_lib/makefile | 83 ++++++++++++++++++++++ .../c_api_pkt_print_test.vcxproj | 6 +- .../ext_dcd_echo_test/ext_dcd_echo_test.vcxproj | 4 ++ 7 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 decoder/tests/build/linux/echo_test_dcd_lib/makefile
diff --git a/decoder/build/linux/makefile b/decoder/build/linux/makefile index b86fafe..23c6911 100644 --- a/decoder/build/linux/makefile +++ b/decoder/build/linux/makefile @@ -155,6 +155,7 @@ $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so: $(LIB_BASE_NAME)_lib
.PHONY: tests tests: libs + cd $(OCSD_ROOT)/tests/build/linux/echo_test_dcd_lib && make cd $(OCSD_ROOT)/tests/build/linux/snapshot_parser_lib && make cd $(OCSD_ROOT)/tests/build/linux/trc_pkt_lister && make cd $(OCSD_ROOT)/tests/build/linux/simple_pkt_print_c_api && make diff --git a/decoder/build/linux/rctdl_c_api_lib/makefile b/decoder/build/linux/rctdl_c_api_lib/makefile index dfebe09..6f4c0e7 100644 --- a/decoder/build/linux/rctdl_c_api_lib/makefile +++ b/decoder/build/linux/rctdl_c_api_lib/makefile @@ -50,7 +50,8 @@ CPP_INCLUDES= \ -I$(OCSD_SOURCE)/c_api
OBJECTS=$(BUILD_DIR)/ocsd_c_api.o \ - $(BUILD_DIR)/ocsd_c_api_deprc_fn.o + $(BUILD_DIR)/ocsd_c_api_deprc_fn.o \ + $(BUILD_DIR)/ocsd_c_api_custom_obj.o
all: build_dir $(OBJECTS) diff --git a/decoder/source/c_api/ocsd_c_api_custom_obj.cpp b/decoder/source/c_api/ocsd_c_api_custom_obj.cpp index f06e1c0..70330e2 100644 --- a/decoder/source/c_api/ocsd_c_api_custom_obj.cpp +++ b/decoder/source/c_api/ocsd_c_api_custom_obj.cpp @@ -308,9 +308,9 @@ void LogErrorCB(const void *lib_context, const ocsd_err_severity_t filter_level, if (lib_context) { if(pMsg) - ((CustomDecoderWrapper *)lib_context)->LogError(&ocsdError(filter_level, code, idx, chan_id, std::string(pMsg))); + ((CustomDecoderWrapper *)lib_context)->LogError(ocsdError(filter_level, code, idx, chan_id, std::string(pMsg))); else - ((CustomDecoderWrapper *)lib_context)->LogError(&ocsdError(filter_level, code, idx, chan_id)); + ((CustomDecoderWrapper *)lib_context)->LogError(ocsdError(filter_level, code, idx, chan_id)); } }
diff --git a/decoder/tests/build/linux/c_api_pkt_print_test/makefile b/decoder/tests/build/linux/c_api_pkt_print_test/makefile index 01d4660..1139af6 100644 --- a/decoder/tests/build/linux/c_api_pkt_print_test/makefile +++ b/decoder/tests/build/linux/c_api_pkt_print_test/makefile @@ -45,11 +45,13 @@ VPATH = $(OCSD_TESTS)/source
CC_INCLUDES = \ -I$(OCSD_TESTS)/source \ + -I$(OCSD_TESTS)/ext_dcd_test_eg/c_api_echo_test \ -I$(OCSD_INCLUDE)
OBJECTS = $(BUILD_DIR)/c_api_pkt_print_test.o
-LIBS = -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME) -l$(LIB_CAPI_NAME) +LIBS = -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME) -l$(LIB_CAPI_NAME) \ + -L$(LIB_TEST_TARGET_DIR) -l_echo_test_dcd
all: build_dir test_app copy_libs
diff --git a/decoder/tests/build/linux/echo_test_dcd_lib/makefile b/decoder/tests/build/linux/echo_test_dcd_lib/makefile new file mode 100644 index 0000000..54d7353 --- /dev/null +++ b/decoder/tests/build/linux/echo_test_dcd_lib/makefile @@ -0,0 +1,83 @@ +######################################################## +# Copyright 2016 ARM Limited. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +################################################################################# +# OpenCSD - makefile for external echo_test decoder. +# + +CC := $(MASTER_CC) +LINKER := $(MASTER_LINKER) +LIB := $(MASTER_LIB) + +CC_FLAGS := $(MASTER_CC_FLAGS) -fpic -Wno-switch +LIB_FLAGS := $(MASTER_LIB_FLAGS) +LINKER_FLAGS := $(MASTER_LINKER_FLAGS) -shared + +LIB_NAME = lib_echo_test_dcd + +BUILD_DIR=./$(PLAT_DIR) + +ECHO_TEST_PATH=$(OCSD_TESTS)/ext_dcd_test_eg/c_api_echo_test + +VPATH = $(ECHO_TEST_PATH) + +CC_INCLUDES = \ + -I$(ECHO_TEST_PATH) \ + -I$(OCSD_INCLUDE) + +OBJECTS = $(BUILD_DIR)/ext_dcd_echo_test.o \ + $(BUILD_DIR)/ext_dcd_echo_test_fact.o + +all: build_dir $(OBJECTS) $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a + +test_app: $(OBJECTS) $(BIN_TEST_TARGET_DIR)/$(PROG) + +$(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a: + mkdir -p $(LIB_TEST_TARGET_DIR) + $(LIB) $(LIB_FLAGS) $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS) + +build_dir: + mkdir -p $(BUILD_DIR) + +.PHONY: copy_libs + +copy_libs: + cp $(LIB_TARGET_DIR)/*.so $(BIN_TEST_TARGET_DIR)/. + + +#### build rules +$(BUILD_DIR)/%.o : %.c + $(CC) $(CC_FLAGS) $(CC_INCLUDES) $< -o $@ + +#### clean +.PHONY: clean +clean: + rm -f $(OBJECTS) + rm -f $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a + +# end of file makefile diff --git a/decoder/tests/build/win-vs2015/c_api_pkt_print_test/c_api_pkt_print_test.vcxproj b/decoder/tests/build/win-vs2015/c_api_pkt_print_test/c_api_pkt_print_test.vcxproj index beb583b..2de00d4 100644 --- a/decoder/tests/build/win-vs2015/c_api_pkt_print_test/c_api_pkt_print_test.vcxproj +++ b/decoder/tests/build/win-vs2015/c_api_pkt_print_test/c_api_pkt_print_test.vcxproj @@ -250,15 +250,15 @@ <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;OCSD_USE_STATIC_C_API;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>........\include</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>........\include;........\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> - <AdditionalLibraryDirectories>........\lib\win$(PlatformArchitecture)\rel</AdditionalLibraryDirectories> - <AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;lib$(LIB_BASE_NAME).lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>........\lib\win$(PlatformArchitecture)\rel;........\tests\lib\win$(PlatformArchitecture)\rel</AdditionalLibraryDirectories> + <AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;lib$(LIB_BASE_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'"> diff --git a/decoder/tests/build/win-vs2015/ext_dcd_echo_test/ext_dcd_echo_test.vcxproj b/decoder/tests/build/win-vs2015/ext_dcd_echo_test/ext_dcd_echo_test.vcxproj index 7d1aaa7..faf8aaa 100644 --- a/decoder/tests/build/win-vs2015/ext_dcd_echo_test/ext_dcd_echo_test.vcxproj +++ b/decoder/tests/build/win-vs2015/ext_dcd_echo_test/ext_dcd_echo_test.vcxproj @@ -72,6 +72,9 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <OutDir>......\lib\win$(PlatformArchitecture)\dbg</OutDir> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <OutDir>......\lib\win$(PlatformArchitecture)\rel</OutDir> + </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <PrecompiledHeader> @@ -109,6 +112,7 @@ <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>........\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Windows</SubSystem>