diff options
-rwxr-xr-x | build.sh | 81 | ||||
-rw-r--r-- | can-config-generator.sln | 22 | ||||
-rw-r--r-- | can-config-generator.vcxproj | 87 |
3 files changed, 190 insertions, 0 deletions
diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..b6d9216a --- /dev/null +++ b/build.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +function build { + echo "ACTION: build" + if [ ! -d "$1/$2" ]; then + echo "INFO: build dir ($1/$2) doesn't exist, created it!" + mkdir -p "$1/$2" + fi + pushd "$1/$2" + #cd "$1/$2" + cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$3 $1 + make + popd +} + +function clean { + echo "ACTION: clean" + if [ -d "$1/$2" ]; then + rm -vrf "$1/$2" + fi +} + +function rebuild { + clean $1 $2 + build $1 $2 $3 +} + +function printhelp { + echo "Usage: build.sh <action> <subdir> [config]" + echo " action: can be one of the following" + echo " build: build this project." + echo " rebuild: rebuild this project." + echo " clean: clean the previous build." + echo " install: install the build result." + echo " subdir: the subdir into which the build is done." + echo " config: can be Debug or Release. Ignored if the action is 'clean'." +} + +function checkparams { + if [ "$#" -ne "$(($1+1))" ]; then + echo "ERROR: Wrong number of parameters, expected $1 but got $(($#-1))" + printhelp + exit 1 + fi +} + +function main { + CURRENT_DIR=$( dirname "$(readlink -f "$0")" ) + echo "Current script: $CURRENT_DIR" + + if [ "$#" -lt "1" ]; then + echo "ERROR: At least <action> must be specified!" + exit 1 + fi + + case "$1" in + "build") + checkparams 3 $* + build $CURRENT_DIR $2 $3 + ;; + "rebuild") + checkparams 3 $* + rebuild $CURRENT_DIR $2 $3 + ;; + "clean") + checkparams 2 $* + clean $CURRENT_DIR $2 + ;; + "install") + checkparams 3 $* + echo "ERROR: Not implemented yet!" + ;; + *) + echo "ERROR: Unknown action '$3'!" + exit 1 + ;; + esac +} + +main $* + diff --git a/can-config-generator.sln b/can-config-generator.sln new file mode 100644 index 00000000..aa58f4a2 --- /dev/null +++ b/can-config-generator.sln @@ -0,0 +1,22 @@ +
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26228.4
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "can-config-generator", "can-config-generator.vcxproj", "{9DCC61FB-6E10-4D4C-A66D-D694238D4169}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {9DCC61FB-6E10-4D4C-A66D-D694238D4169}.Debug|x64.ActiveCfg = Debug|x64
+ {9DCC61FB-6E10-4D4C-A66D-D694238D4169}.Debug|x64.Build.0 = Debug|x64
+ {9DCC61FB-6E10-4D4C-A66D-D694238D4169}.Release|x64.ActiveCfg = Release|x64
+ {9DCC61FB-6E10-4D4C-A66D-D694238D4169}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/can-config-generator.vcxproj b/can-config-generator.vcxproj new file mode 100644 index 00000000..3a2b5c9b --- /dev/null +++ b/can-config-generator.vcxproj @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="build.sh" />
+ <None Include="LICENSE" />
+ <None Include="README.md" />
+ <None Include="tests\signals.json" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="3rdparty\json\json.hpp" />
+ <ClInclude Include="src\openxc\can_bus.hpp" />
+ <ClInclude Include="src\openxc\can_message.hpp" />
+ <ClInclude Include="src\openxc\command.hpp" />
+ <ClInclude Include="src\openxc\diagnostic_message.hpp" />
+ <ClInclude Include="src\openxc\mapping.hpp" />
+ <ClInclude Include="src\openxc\message_set.hpp" />
+ <ClInclude Include="src\openxc\signal.hpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\main.cpp" />
+ <ClCompile Include="src\openxc\can_bus.cpp" />
+ <ClCompile Include="src\openxc\can_message.cpp" />
+ <ClCompile Include="src\openxc\command.cpp" />
+ <ClCompile Include="src\openxc\diagnostic_message.cpp" />
+ <ClCompile Include="src\openxc\mapping.cpp" />
+ <ClCompile Include="src\openxc\message_set.cpp" />
+ <ClCompile Include="src\openxc\signal.cpp" />
+ <ClCompile Include="tests\generated.cpp" />
+ <ClCompile Include="tests\handlers.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <Text Include="CMakeLists.txt" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{9dcc61fb-6e10-4d4c-a66d-d694238d4169}</ProjectGuid>
+ <Keyword>Linux</Keyword>
+ <RootNamespace>can_config_generator</RootNamespace>
+ <MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
+ <ApplicationType>Linux</ApplicationType>
+ <ApplicationTypeRevision>1.0</ApplicationTypeRevision>
+ <TargetLinuxPlatform>Generic</TargetLinuxPlatform>
+ <LinuxProjectType>{FC1A4D80-50E9-41DA-9192-61C0DBAA00D2}</LinuxProjectType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <ConfigurationType>Makefile</ConfigurationType>
+ <RemoteRootDir>~/agl/projects</RemoteRootDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <ConfigurationType>Makefile</ConfigurationType>
+ <RemoteRootDir>~/agl/projects</RemoteRootDir>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings" />
+ <ImportGroup Label="Shared" />
+ <ImportGroup Label="PropertySheets" />
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalRemoteCopySources>false</LocalRemoteCopySources>
+ <NMakeIncludeSearchPath>D:\home\ctxnop\agl\sdk\porter\sysroots\cortexa15hf-neon-agl-linux-gnueabi\usr\include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <RemoteBuildCommandLine>$(RemoteProjectDir)/build.sh build bin/$(PlatformTarget)/$(Configuration) $(Configuration)</RemoteBuildCommandLine>
+ <RemoteReBuildCommandLine>$(RemoteProjectDir)/build.sh rebuild bin/$(PlatformTarget)/$(Configuration) $(Configuration)</RemoteReBuildCommandLine>
+ <RemoteCleanCommandLine>$(RemoteProjectDir)/build.sh clean bin/$(PlatformTarget)/$(Configuration)</RemoteCleanCommandLine>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalRemoteCopySources>false</LocalRemoteCopySources>
+ <NMakeIncludeSearchPath>D:\home\ctxnop\agl\sdk\porter\sysroots\cortexa15hf-neon-agl-linux-gnueabi\usr\include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <RemoteBuildCommandLine>$(RemoteProjectDir)/build.sh build bin/$(PlatformTarget)/$(Configuration) $(Configuration)</RemoteBuildCommandLine>
+ <RemoteReBuildCommandLine>$(RemoteProjectDir)/build.sh rebuild bin/$(PlatformTarget)/$(Configuration) $(Configuration)</RemoteReBuildCommandLine>
+ <RemoteCleanCommandLine>$(RemoteProjectDir)/build.sh clean bin/$(PlatformTarget)/$(Configuration)</RemoteCleanCommandLine>
+ </PropertyGroup>
+ <ItemDefinitionGroup />
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets" />
+</Project>
\ No newline at end of file |