diff --git a/.studio-run-configs/flash-gpio-write-m328p.run.xml b/.studio-run-configs/flash-gpio-write-m328p.run.xml
index 3767095..a3d1407 100644
--- a/.studio-run-configs/flash-gpio-write-m328p.run.xml
+++ b/.studio-run-configs/flash-gpio-write-m328p.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.studio-run-configs/flash-hello-uart-m328p.run.xml b/.studio-run-configs/flash-hello-uart-m328p.run.xml
index ad8b3cb..dbab561 100644
--- a/.studio-run-configs/flash-hello-uart-m328p.run.xml
+++ b/.studio-run-configs/flash-hello-uart-m328p.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.studio-run-configs/flash-joystick-adc-m32.run.xml b/.studio-run-configs/flash-joystick-adc-m32.run.xml
index e983fb0..f763e3e 100644
--- a/.studio-run-configs/flash-joystick-adc-m32.run.xml
+++ b/.studio-run-configs/flash-joystick-adc-m32.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/.studio-run-configs/generate-doxy-config.run.xml b/.studio-run-configs/generate-docs.run.xml
similarity index 89%
rename from .studio-run-configs/generate-doxy-config.run.xml
rename to .studio-run-configs/generate-docs.run.xml
index da6b78e..1add729 100644
--- a/.studio-run-configs/generate-doxy-config.run.xml
+++ b/.studio-run-configs/generate-docs.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.studio-run-configs/hello_switching_mux.run.xml b/.studio-run-configs/hello_switching_mux.run.xml
index c98c8ef..8de02ec 100644
--- a/.studio-run-configs/hello_switching_mux.run.xml
+++ b/.studio-run-configs/hello_switching_mux.run.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/electrostatic-sandbox-framework/CMakeLists.txt b/electrostatic-sandbox-framework/CMakeLists.txt
index dc6642f..6a26d79 100644
--- a/electrostatic-sandbox-framework/CMakeLists.txt
+++ b/electrostatic-sandbox-framework/CMakeLists.txt
@@ -6,54 +6,71 @@ project(electrostatic-sandbox VERSION 1.0)
# To generate compile_commands.json for your project,
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+###################### CMake Predefined Variables ######################
+############################################################
+
message(STATUS "Project: electrostatic-sandbox")
-message(STATUS "Current Library in-comission: ${COMMISSION_LIB}")
+message(STATUS "Current Output in-comission: ${COMMISSION_OUTPUT}")
message(STATUS "GCC: ${GCC_BIN}")
message(STATUS "GPP: ${GPP_BIN}")
+message(STATUS "Build Static Library: ${BUILD_STATIC}")
message(STATUS "Build Shared Library: ${BUILD_SHARED}")
+message(STATUS "Build Executable binary: ${BUILD_EXE}")
message(STATUS "Compiler Options: ${INPUT_COMPILER_OPTIONS}")
message(STATUS "Target architecture: ${TARGET}")
-message(STATUS "Toolchain Headers: ${TOOLCHAIN_HEADERS}")
+message(STATUS "Toolchain Headers: ${HEADERS}")
message(STATUS "Source Directory: ${SOURCES_DIR}")
message(STATUS "Project sources: ${PROJECT_SOURCES}")
message(STATUS "Dependencies: ${DEPENDENCIES}")
message(STATUS "Building the binaries to: ${BUILD_DIR}")
+###################### CMake Variables ######################
+############################################################
+
set(PROJECT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${SOURCES_DIR}")
-# Cmake variables
-set(library_so "${COMMISSION_LIB}")
-set(library_a "${COMMISSION_LIB}-a")
+set(commission_so "${COMMISSION_OUTPUT}")
+set(commission_a "${COMMISSION_OUTPUT}-a")
+set(commission_exe "${COMMISSION_OUTPUT}.elf")
set(CMAKE_C_COMPILER "${GCC_BIN}")
set(CMAKE_CXX_COMPILER "${GPP_BIN}")
set(COMPILER_OPTIONS "${TARGET} ${INPUT_COMPILER_OPTIONS}")
-set(headers "${TOOLCHAIN_HEADERS}"
- "${PROJECT_SOURCE_DIR}/dependencies/include/"
- "${PROJECT_SOURCE_DIR}/src/include/")
-
-set(libelectrostatic "${PROJECT_SOURCES}")
-
-# add a library target
-add_library(${library_a} STATIC ${libelectrostatic})
-
-# set both COMPILE_FLAGS and LINK_FLAGS to the specified binary architecture
-set_target_properties(${library_a} PROPERTIES COMPILE_FLAGS "${COMPILER_OPTIONS}" LINK_FLAGS "${COMPILER_OPTIONS}")
+set(headers "${HEADERS}")
-# include headers for the target
-target_include_directories(${library_a} PUBLIC ${headers})
+###################### Build routines ######################
+############################################################
-target_link_libraries(${library_a} PUBLIC "${DEPENDENCIES}")
+# build an executable
+if (BUILD_EXE)
+ # add a library target
+ add_executable(${commission_exe}) # executable based on the static archive
+ set_target_properties(${commission_exe} PROPERTIES COMPILE_FLAGS "${COMPILER_OPTIONS}" LINK_FLAGS "${COMPILER_OPTIONS}")
+ # include headers for the target
+ target_include_directories(${commission_exe} PUBLIC ${lib_headers} ${headers})
+ target_link_libraries(${commission_exe} PUBLIC "${DEPENDENCIES}")
+ # Start building the target
+ target_sources(${commission_exe} PUBLIC "${PROJECT_SOURCES}")
+endif ()
-# Start building the target
-target_sources(${library_a} PUBLIC ${libelectrostatic})
+if (BUILD_STATIC)
+ # add a library target
+ add_library(${commission_a} STATIC)
+ # set both COMPILE_FLAGS and LINK_FLAGS to the specified binary architecture
+ set_target_properties(${commission_a} PROPERTIES COMPILE_FLAGS "${COMPILER_OPTIONS}" LINK_FLAGS "${COMPILER_OPTIONS}")
+ # include headers for the target
+ target_include_directories(${commission_a} PUBLIC ${headers})
+ target_link_libraries(${commission_a} PUBLIC "${DEPENDENCIES}")
+ # Start building the target
+ target_sources(${commission_a} PUBLIC "${PROJECT_SOURCES}")
+endif ()
# build a shared library version
if (BUILD_SHARED)
- add_library(${library_so} SHARED ${libelectrostatic})
- set_target_properties(${library_so} PROPERTIES COMPILE_FLAGS "${COMPILER_OPTIONS}" LINK_FLAGS "${COMPILER_OPTIONS}")
- target_include_directories(${library_so} PUBLIC ${headers})
- target_link_libraries(${library_so} PUBLIC "${DEPENDENCIES}")
- target_sources(${library_so} PUBLIC ${libelectrostatic})
-endif()
\ No newline at end of file
+ add_library(${commission_so} SHARED)
+ set_target_properties(${commission_so} PROPERTIES COMPILE_FLAGS "${COMPILER_OPTIONS}" LINK_FLAGS "${COMPILER_OPTIONS}")
+ target_include_directories(${commission_so} PUBLIC ${headers})
+ target_link_libraries(${commission_so} PUBLIC "${DEPENDENCIES}")
+ target_sources(${commission_so} PUBLIC "${PROJECT_SOURCES}")
+endif()
diff --git a/electrostatic-sandbox-framework/docs/doxygen/DOC-CONFIG b/electrostatic-sandbox-framework/docs/doxygen/DOC-CONFIG
index 4dc529d..058147c 100644
--- a/electrostatic-sandbox-framework/docs/doxygen/DOC-CONFIG
+++ b/electrostatic-sandbox-framework/docs/doxygen/DOC-CONFIG
@@ -943,7 +943,7 @@ WARN_LOGFILE = ./warn.log
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = ../../
+INPUT = ../../ ../../../helper-scripts/
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -1032,6 +1032,8 @@ FILE_PATTERNS = *.c \
*.vhdl \
*.ucf \
*.qsf \
+ *.sh \
+ *.bash \
*.ice
# The RECURSIVE tag can be used to specify whether or not subdirectories should
diff --git a/electrostatic-sandbox-framework/electrostatic-examples/CMakeLists.txt b/electrostatic-sandbox-framework/electrostatic-examples/CMakeLists.txt
deleted file mode 100644
index 9f2f57c..0000000
--- a/electrostatic-sandbox-framework/electrostatic-examples/CMakeLists.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-cmake_minimum_required(VERSION 3.18.1)
-
-# define a project with a version
-project(electrostatic-examples VERSION 1.0)
-
-# display external options
-message(STATUS "Project: electrostatic-examples")
-message(STATUS "GCC: ${GCC_BIN}")
-message(STATUS "GPP: ${GPP_BIN}")
-message(STATUS "Build Shared Library: ${SHARED_LIB}")
-message(STATUS "Compiler Options: ${INPUT_COMPILER_OPTIONS}")
-message(STATUS "Target architecture: ${TARGET}")
-message(STATUS "Toolchain Includes: ${TOOLCHAIN_INCLUDES}")
-message(STATUS "Dependencies: ${DEPENDENCIES}")
-message(STATUS "Runnable-example: ${EXAMPLE}")
-message(STATUS "Executable Suffix: ${EXECUTABLE_SUFFIX}")
-message(STATUS "Building the binaries to: ${BUILD_DIR}")
-
-# Cmake variables
-set(executable_a "techdemo-${EXECUTABLE_SUFFIX}-a.elf") # target for archive-linked binary
-set(executable_so "techdemo-${EXECUTABLE_SUFFIX}.elf") # target for shared-linked binary
-set(library_so "techdemo-${EXECUTABLE_SUFFIX}-shared")
-
-set(CMAKE_C_COMPILER "${GCC_BIN}")
-set(CMAKE_CXX_COMPILER "${GPP_BIN}")
-set(COMPILER_OPTIONS "${TARGET} ${INPUT_COMPILER_OPTIONS}")
-
-set(lib_headers "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/include")
-set(headers "${TOOLCHAIN_INCLUDES}")
-
-# C sources
-set(sources "${CMAKE_CURRENT_SOURCE_DIR}/src/${EXAMPLE}")
-
-# add a library target
-add_executable(${executable_a}) # executable based on the static archive
-
-if (SHARED_LIB)
- add_executable(${executable_so}) # executable based on the dynamic library
- add_library(${library_so} SHARED ${sources})
- set_target_properties(${executable_so} PROPERTIES COMPILE_FLAGS "${COMPILER_OPTIONS}" LINK_FLAGS "${COMPILER_OPTIONS}")
- target_include_directories(${library_so} PUBLIC ${lib_headers} ${headers})
- target_link_libraries(${library_so} "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libs/${BUILD_DIR}/libelectrostatic-a.a" "${DEPENDENCIES}")
- target_sources(${library_so} PUBLIC ${sources})
-endif ()
-
-# set both COMPILE_FLAGS and LINK_FLAGS to the specified binary architecture
-set_target_properties(${executable_a} PROPERTIES COMPILE_FLAGS "${COMPILER_OPTIONS}" LINK_FLAGS "${COMPILER_OPTIONS}")
-
-# include headers for the target
-target_include_directories(${executable_a} PUBLIC ${lib_headers} ${headers})
-
-target_link_libraries(${executable_a} "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libs/${BUILD_DIR}/libelectrostatic-a.a" "${DEPENDENCIES}")
-
-# Start building the target
-target_sources(${executable_a} PUBLIC ${sources})
\ No newline at end of file
diff --git a/helper-scripts/abstract/abstract-compile-examples.sh b/helper-scripts/abstract/abstract-compile-examples.sh
deleted file mode 100644
index 57d6e7e..0000000
--- a/helper-scripts/abstract/abstract-compile-examples.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-function compile() {
- local GCC_BIN=${1}
- local GPP_BIN=${2}
- local BUILD_SHARED=${3}
- local INPUT_COMPILER_OPTIONS=${4}
- local TARGET=${5}
- local TOOLCHAIN_INCLUDES=${6}
- local ELECTROSTATIC_CORE=${7}
- local EXAMPLE=${8}
- local EXECUTABLE_SUFFIX=${9}
- local BUILD_DIR=${10}
- local SOURCE_DIR=${11}
-
- local TEMP=$(pwd)
- cd ${SOURCE_DIR}
-
- cmake-3.19 "-DGCC_BIN=${GCC_BIN}" \
- "-DGPP_BIN=${GPP_BIN}" \
- "-DBUILD_SHARED=${BUILD_SHARED}" \
- "-DINPUT_COMPILER_OPTIONS=${INPUT_COMPILER_OPTIONS}" \
- "-DTARGET=${TARGET}" \
- "-DTOOLCHAIN_INCLUDES=${TOOLCHAIN_INCLUDES}" \
- "-DELECTROSTATIC_CORE=${ELECTROSTATIC_CORE}" \
- "-DEXAMPLE=${EXAMPLE}" \
- "-DEXECUTABLE_SUFFIX=${EXECUTABLE_SUFFIX}" \
- "-DBUILD_DIR=${BUILD_DIR}" \
- -S . -B "$(pwd)/build/${BUILD_DIR}"
-
- cmake-3.19 --build "$(pwd)/build/${BUILD_DIR}"
- cd ${TEMP}
-}
-
diff --git a/helper-scripts/abstract/abstract-compile.sh b/helper-scripts/abstract/abstract-compile.sh
index 1be549f..1451fa2 100644
--- a/helper-scripts/abstract/abstract-compile.sh
+++ b/helper-scripts/abstract/abstract-compile.sh
@@ -1,37 +1,42 @@
#!/bin/bash
function compile() {
- local COMMISSION_LIB=${1}
+ local COMMISSION_OUTPUT=${1}
local GCC_BIN=${2}
local GPP_BIN=${3}
- local BUILD_SHARED=${4}
- local INPUT_COMPILER_OPTIONS=${5}
- local TARGET=${6}
- local TOOLCHAIN_HEADERS=${7}
- local BUILD_DIR=${8}
- local CMAKE_DIR=${9}
+ local BUILD_STATIC=${4}
+ local BUILD_SHARED=${5}
+ local BUILD_EXE=${6}
+ local INPUT_COMPILER_OPTIONS=${7}
+ local TARGET=${8}
+ local HEADERS=${9}
local SOURCES_DIR=${10}
local PROJECT_SOURCES=${11}
local DEPENDENCIES=${12}
-
+ local BUILD_DIR=${13}
+ local CMAKE_DIR=${14}
+
local TEMP=$(pwd)
- cd ${CMAKE_DIR}
+ cd "${CMAKE_DIR}" || exit $?
- cmake-3.19 "-DCOMMISSION_LIB=${COMMISSION_LIB}" \
+ cmake-3.19 "-DCOMMISSION_OUTPUT=${COMMISSION_OUTPUT}" \
"-DGCC_BIN=${GCC_BIN}" \
"-DGPP_BIN=${GPP_BIN}" \
+ "-DBUILD_STATIC=${BUILD_STATIC}" \
"-DBUILD_SHARED=${BUILD_SHARED}" \
+ "-DBUILD_EXE=${BUILD_EXE}" \
"-DINPUT_COMPILER_OPTIONS=${INPUT_COMPILER_OPTIONS}" \
"-DTARGET=${TARGET}" \
- "-DTOOLCHAIN_HEADERS=${TOOLCHAIN_HEADERS}" \
- "-DBUILD_DIR=${BUILD_DIR}" \
+ "-DHEADERS=${HEADERS}" \
"-DSOURCES_DIR=${SOURCES_DIR}" \
"-DPROJECT_SOURCES=${PROJECT_SOURCES}" \
"-DDEPENDENCIES=${DEPENDENCIES}" \
+ "-DBUILD_DIR=${BUILD_DIR}" \
-S . -B "$(pwd)/${SOURCES_DIR}/cmake-build/${BUILD_DIR}"
- cmake-3.19 --build "$(pwd)/${SOURCES_DIR}/cmake-build/${BUILD_DIR}"
- cd ${TEMP}
+ cmake-3.19 --build "$(pwd)/${SOURCES_DIR}/cmake-build/${BUILD_DIR}" || exit $?
+
+ cd "${TEMP}" || exit $?
}
diff --git a/helper-scripts/ci-cd/compile-electrostatic.sh b/helper-scripts/ci-cd/compile-electrostatic.sh
index 30d42e4..8b2d1fd 100644
--- a/helper-scripts/ci-cd/compile-electrostatic.sh
+++ b/helper-scripts/ci-cd/compile-electrostatic.sh
@@ -4,5 +4,4 @@ PRIMER="${1}"
./helper-scripts/project-impl/compile-all.sh "${PRIMER}"
./helper-scripts/project-impl/compile-all-android.sh "${PRIMER}"
-
./helper-scripts/project-impl/compile-all-mcu.sh "${PRIMER}"
diff --git a/helper-scripts/ci-cd/test-electrostatic-mcu.sh b/helper-scripts/ci-cd/test-electrostatic-mcu.sh
index f8f10fe..1ff4d21 100644
--- a/helper-scripts/ci-cd/test-electrostatic-mcu.sh
+++ b/helper-scripts/ci-cd/test-electrostatic-mcu.sh
@@ -3,15 +3,15 @@
source "./helper-scripts/project-impl/variables.sh"
example="${1}"
-executable_suffix="${2}"
+executable="${2}"
target="${3}"
chip_alias=${4}
build_dir="${5}"
./helper-scripts/project-impl/compile-examples-mcu.sh "-mmcu=${target}" \
- "${example}" "${executable_suffix}" "${build_dir}" "${target}" "OFF"
+ "${example}" "${executable}" "${build_dir}" "${target}" "OFF"
root_build_path="$(pwd)/electrostatic-sandbox-framework/electrostatic-examples"
-./helper-scripts/project-impl/upload-hex.sh "techdemo-${executable_suffix}-a.elf" \
- "${root_build_path}/build/${build_dir}/${target}" "${chip_alias}" ""
\ No newline at end of file
+./helper-scripts/project-impl/upload-hex.sh "${executable}.elf" \
+ "${root_build_path}/cmake-build/${build_dir}/${target}" "${chip_alias}" ""
\ No newline at end of file
diff --git a/helper-scripts/ci-cd/test-electrostatic.sh b/helper-scripts/ci-cd/test-electrostatic.sh
index cced7e1..5634ac5 100644
--- a/helper-scripts/ci-cd/test-electrostatic.sh
+++ b/helper-scripts/ci-cd/test-electrostatic.sh
@@ -3,11 +3,9 @@
source "./helper-scripts/project-impl/variables.sh"
example="${1}"
-executable_suffix="${2}"
+exe="${2}"
./helper-scripts/project-impl/compile-examples.sh "${TARGET_x86_64}" \
- "${example}" "${executable_suffix}" "linux" "${x86_64}" "OFF"
-#./helper-scripts/project-impl/compile-examples.sh "${TARGET_x86}" "${example}" "linux" "${x86}"
+ "${example}" "${exe}" "linux" "${x86_64}"
-./electrostatic-sandbox-framework/electrostatic-examples/build/linux/x86-64/techdemo-${executable_suffix}-a.elf
-#./electrostatic-examples/build/linux/x86/${example}.elf
\ No newline at end of file
+./electrostatic-sandbox-framework/electrostatic-examples/cmake-build/linux/x86-64/${exe}.elf
diff --git a/helper-scripts/project-impl/compile-all-android.sh b/helper-scripts/project-impl/compile-all-android.sh
index a6bf445..10f6c21 100644
--- a/helper-scripts/project-impl/compile-all-android.sh
+++ b/helper-scripts/project-impl/compile-all-android.sh
@@ -16,21 +16,21 @@ algorithm_module="${electronetsoft}/algorithm/"
util_module="${electronetsoft}/util/"
./helper-scripts/project-impl/compile-electrostatic.sh \
- "${CLANG_BIN}" "${CLANGPP_BIN}" "ON" \
- "-target ${ARM_64}" "${NDK_TOOLCHAIN_INCLUDES}" "${platform_module} ${comm_module} \
- ${algorithm_module} ${util_module}" "NULL" "android" "${ARM_64}"
+ "${COMMISSION_LIB}" "${CLANG_BIN}" "${CLANGPP_BIN}" "ON" "ON" "OFF" "-O3 -fPIC" \
+ "-target ${ARM_64}" "${NDK_TOOLCHAIN_INCLUDES};${electrostatic_core_headers}" "${platform_module} ${comm_module} \
+ ${algorithm_module} ${util_module}" "${NULL}" "m;pthread;dl" "${source_dir}" "android" "${ARM_64}" "${POST_COMPILE_TRUE}"
./helper-scripts/project-impl/compile-electrostatic.sh \
- "${CLANG_BIN}" "${CLANGPP_BIN}" "ON" \
- "-target ${ARM_32}" "${NDK_TOOLCHAIN_INCLUDES}" "${platform_module} ${comm_module} \
- ${algorithm_module} ${util_module}" "NULL" "android" "${ARM_32}" "${PRIMER}"
+ "${COMMISSION_LIB}" "${CLANG_BIN}" "${CLANGPP_BIN}" "ON" "ON" "OFF" "-O3 -fPIC" \
+ "-target ${ARM_32}" "${NDK_TOOLCHAIN_INCLUDES};${electrostatic_core_headers}" "${platform_module} ${comm_module} \
+ ${algorithm_module} ${util_module}" "${NULL}" "m;pthread;dl" "${source_dir}" "android" "${ARM_32}" "${POST_COMPILE_TRUE}"
./helper-scripts/project-impl/compile-electrostatic.sh \
- "${CLANG_BIN}" "${CLANGPP_BIN}" "ON" \
- "-target ${ANDROID_x86}" "${NDK_TOOLCHAIN_INCLUDES}" "${platform_module} ${comm_module} \
- ${algorithm_module} ${util_module}" "NULL" "android" "${ANDROID_x86}"
+ "${COMMISSION_LIB}" "${CLANG_BIN}" "${CLANGPP_BIN}" "ON" "ON" "OFF" "-O3 -fPIC" \
+ "-target ${ANDROID_x86}" "${NDK_TOOLCHAIN_INCLUDES};${electrostatic_core_headers}" "${platform_module} ${comm_module} \
+ ${algorithm_module} ${util_module}" "${NULL}" "m;pthread;dl" "${source_dir}" "android" "${ANDROID_x86}" "${POST_COMPILE_TRUE}"
./helper-scripts/project-impl/compile-electrostatic.sh \
- "${CLANG_BIN}" "${CLANGPP_BIN}" "ON" \
- "-target ${ANDROID_x86_64}" "${NDK_TOOLCHAIN_INCLUDES}" "${platform_module} ${comm_module} \
- ${algorithm_module} ${util_module}" "NULL" "android" "${ANDROID_x86_64}"
+ "${COMMISSION_LIB}" "${CLANG_BIN}" "${CLANGPP_BIN}" "ON" "ON" "OFF" "-O3 -fPIC" \
+ "-target ${ANDROID_x86_64}" "${NDK_TOOLCHAIN_INCLUDES};${electrostatic_core_headers}" "${platform_module} ${comm_module} \
+ ${algorithm_module} ${util_module}" "${NULL}" "m;pthread;dl" "${source_dir}" "android" "${ANDROID_x86_64}" "${POST_COMPILE_TRUE}"
diff --git a/helper-scripts/project-impl/compile-all-mcu.sh b/helper-scripts/project-impl/compile-all-mcu.sh
index 9836f36..ab42f38 100644
--- a/helper-scripts/project-impl/compile-all-mcu.sh
+++ b/helper-scripts/project-impl/compile-all-mcu.sh
@@ -18,15 +18,12 @@ algorithm_module="${electronetsoft}/algorithm/"
util_module="${electronetsoft}/util/"
electromio_module="${electroio}/electromio/"
-# override the input options
-INPUT_COMPILER_OPTIONS="-O2"
-
./helper-scripts/project-impl/compile-electrostatic.sh \
- "${AVR_GCC_BIN}" "${AVR_GPP_BIN}" "OFF" \
- "-mmcu=atmega32 -D_ELECTRO_MIO" "${AVR_TOOLCHAIN_INCLUDES}" "${platform_module} \
- ${comm_module} ${algorithm_module} ${util_module} ${electromio_module}" "NULL" "avr-mcu" "atmega32"
+ "${COMMISSION_LIB}" "${AVR_GCC_BIN}" "${AVR_GPP_BIN}" "ON" "OFF" "OFF" "-O2" \
+ "-mmcu=atmega32 -D_ELECTRO_MIO" "${AVR_TOOLCHAIN_INCLUDES};${electrostatic_core_headers}" "${platform_module} \
+ ${comm_module} ${algorithm_module} ${util_module} ${electromio_module}" "${NULL}" "m" "${source_dir}" "avr-mcu" "atmega32" "${POST_COMPILE_TRUE}"
./helper-scripts/project-impl/compile-electrostatic.sh \
- "${AVR_GCC_BIN}" "${AVR_GPP_BIN}" "OFF" \
- "-mmcu=atmega328p -D_ELECTRO_MIO" "${AVR_TOOLCHAIN_INCLUDES}" "${platform_module} \
- ${comm_module} ${algorithm_module} ${util_module} ${electromio_module}" "NULL" "avr-mcu" "atmega328p"
+ "${COMMISSION_LIB}" "${AVR_GCC_BIN}" "${AVR_GPP_BIN}" "ON" "OFF" "OFF" "-O2" \
+ "-mmcu=atmega328p -D_ELECTRO_MIO" "${AVR_TOOLCHAIN_INCLUDES};${electrostatic_core_headers}" "${platform_module} \
+ ${comm_module} ${algorithm_module} ${util_module} ${electromio_module}" "${NULL}" "m" "${source_dir}" "avr-mcu" "atmega328p" "${POST_COMPILE_TRUE}"
diff --git a/helper-scripts/project-impl/compile-all.sh b/helper-scripts/project-impl/compile-all.sh
index 6decfd6..3b4d557 100644
--- a/helper-scripts/project-impl/compile-all.sh
+++ b/helper-scripts/project-impl/compile-all.sh
@@ -17,11 +17,13 @@ algorithm_module="${electronetsoft}/algorithm/"
util_module="${electronetsoft}/util/"
./helper-scripts/project-impl/compile-electrostatic.sh \
- "${GCC_BIN_x86}" "${GPP_BIN_x86}" "ON" \
- "${TARGET_x86_64}" "${TOOLCHAIN_INCLUDES}" "${platform_module} \
- ${comm_module} ${algorithm_module} ${util_module}" "NULL" "linux" "${x86_64}"
+ "${COMMISSION_LIB}" "${GCC_BIN_x86}" "${GPP_BIN_x86}" "ON" "ON" "OFF" "-O3 -fPIC" \
+ "${TARGET_x86_64}" "${TOOLCHAIN_INCLUDES_x86};${electrostatic_core_headers}" "${platform_module} \
+ ${comm_module} ${algorithm_module} ${util_module}" "${NULL}" "m;pthread;dl" "${source_dir}" \
+ "linux" "${x86_64}" "${POST_COMPILE_TRUE}"
./helper-scripts/project-impl/compile-electrostatic.sh \
- "${GCC_BIN_x86}" "${GPP_BIN_x86}" "ON" \
- "${TARGET_x86}" "${TOOLCHAIN_INCLUDES}" "${platform_module} \
- ${comm_module} ${algorithm_module} ${util_module}" "NULL" "linux" "${x86}"
+ "${COMMISSION_LIB}" "${GCC_BIN_x86}" "${GPP_BIN_x86}" "ON" "ON" "OFF" "-O3 -fPIC" \
+ "${TARGET_x86}" "${TOOLCHAIN_INCLUDES_x86};${electrostatic_core_headers}" "${platform_module} \
+ ${comm_module} ${algorithm_module} ${util_module}" "${NULL}" "m;pthread;dl" "${source_dir}" \
+ "linux" "${x86}" "${POST_COMPILE_TRUE}"
diff --git a/helper-scripts/project-impl/compile-electrostatic.sh b/helper-scripts/project-impl/compile-electrostatic.sh
index fb5f3fb..cbf4d77 100644
--- a/helper-scripts/project-impl/compile-electrostatic.sh
+++ b/helper-scripts/project-impl/compile-electrostatic.sh
@@ -4,28 +4,42 @@ source "./helper-scripts/abstract/abstract-compile.sh"
source "./helper-scripts/abstract/abstract-util.sh"
source "./helper-scripts/project-impl/variables.sh"
-cd "${project_root}/${electrostatic_sandbox}" || exit
-
-GCC_BIN="${1}"
-GPP_BIN="${2}"
-BUILD_SHARED="${3}"
-TARGET_MACHINE="${4}"
-TOOLCHAIN_HEADERS="${5}"
-CODEBASE_MODULES=("${6}")
-DEPENDENCIES_MODULES=("${7}")
-SYSTEM_DIR="${8}"
-BUILD_DIR="${9}"
+cd "${project_root}/${electrostatic_sandbox}" || exit $?
+
+COMMISSION_OUTPUT="${1}"
+GCC_BIN="${2}"
+GPP_BIN="${3}"
+BUILD_STATIC="${4}"
+BUILD_SHARED="${5}"
+BUILD_EXE="${6}"
+COMPILER_OPTIONS="${7}"
+TARGET_MACHINE="${8}"
+HEADERS="${9}"
+CODEBASE_MODULES=("${10}")
+DEPENDENCIES_MODULES=("${11}")
+BUILTIN_LIBS="${12}"
+SOURCE_DIR="${13}"
+SYSTEM_DIR="${14}"
+BUILD_DIR="${15}"
+RUN_POST_COMPILE_SCRIPTS="${16}"
# precompile scripts
sources=$(find ${CODEBASE_MODULES[*]} -name *.c -o -name *.cpp -o -name *.cxx | tr '\n' ';')
-dependencies=$(find ${DEPENDENCIES_MODULES[*]} -name *.a -o -name *.so -o -name *.ar | tr '\n' ';')
+
+if [ "${DEPENDENCIES_MODULES[*]}" != "${NULL}" ]; then
+ dependencies=$(find ${DEPENDENCIES_MODULES[*]} -name *.a -o -name *.so -o -name *.ar | tr '\n' ';')
+fi
# compile scripts
-compile "${COMMISSION_LIB}" "${GCC_BIN}" "${GPP_BIN}" "${BUILD_SHARED}" "${INPUT_COMPILER_OPTIONS}" \
- "${TARGET_MACHINE}" "${TOOLCHAIN_HEADERS}" \
- "${SYSTEM_DIR}/${BUILD_DIR}" "." "${source_dir}" "${sources}" "${dependencies};m;pthread;dl"
+compile "${COMMISSION_OUTPUT}" "${GCC_BIN}" "${GPP_BIN}" "${BUILD_STATIC}" "${BUILD_SHARED}" \
+ "${BUILD_EXE}" "${COMPILER_OPTIONS}" \
+ "${TARGET_MACHINE}" "${HEADERS}" \
+ "${SOURCE_DIR}" "${sources}" "${dependencies};${BUILTIN_LIBS}" \
+ "${SYSTEM_DIR}/${BUILD_DIR}" "." "${SOURCE_DIR}"
-cd ${project_root}
+cd ${project_root} || exit $?
-# post compile scripts
-./helper-scripts/project-impl/post-compile/post-compile-electrostatic.sh "${SYSTEM_DIR}" "${BUILD_DIR}" || exit
+if [ "${RUN_POST_COMPILE_SCRIPTS}" == "${POST_COMPILE_TRUE}" ]; then
+ # post compile scripts
+ ./helper-scripts/project-impl/post-compile/post-compile-electrostatic.sh "${SYSTEM_DIR}" "${BUILD_DIR}" || exit
+fi
diff --git a/helper-scripts/project-impl/compile-electrostatic4j.sh b/helper-scripts/project-impl/compile-electrostatic4j.sh
index 54b00a4..22d5f26 100644
--- a/helper-scripts/project-impl/compile-electrostatic4j.sh
+++ b/helper-scripts/project-impl/compile-electrostatic4j.sh
@@ -27,11 +27,14 @@ dependencies=$(find "$(pwd)/${project_dir}/dependencies/libs/${system_dir}/${bui
getCurrentSystem
-JNI_HEADERS_SYSTEM="${JNI_HEADERS}/${system}"
-
-compile "${commission_lib}" "${GCC_BIN}" "${GPP_BIN}" "${BUILD_SHARED}" "${INPUT_COMPILER_OPTIONS}" \
- "${target}" "${TOOLCHAIN_HEADERS};${JNI_HEADERS};${JNI_HEADERS_SYSTEM}" "${system_dir}/${build_dir}" \
- "." "${project_dir}" "${sources}" "${dependencies};m;pthread;dl"
+JNI_HEADERS_SYSTEM="${JNI_HEADERS}/${system_dir}"
+PROJECT_HEADERS="$(pwd)/${project_dir}/src/include/"
+ELECTROSTATIC_HEADERS="$(pwd)/${project_dir}/dependencies/include/"
+
+compile "${commission_lib}" "${GCC_BIN}" "${GPP_BIN}" "ON" "${BUILD_SHARED}" "OFF" "${INPUT_COMPILER_OPTIONS}" \
+ "${target}" "${TOOLCHAIN_HEADERS};${JNI_HEADERS};${JNI_HEADERS_SYSTEM};${PROJECT_HEADERS};${ELECTROSTATIC_HEADERS}" \
+ "${project_dir}" "${sources}" "${dependencies};m;pthread;dl" "${system_dir}/${build_dir}" \
+ "." "${project_dir}"
moveFile "${project_dir}/cmake-build/${system_dir}/${build_dir}/lib${commission_lib}.so" \
"${project_dir}/build/lib/${system_dir}/${build_dir}/"
diff --git a/helper-scripts/project-impl/compile-examples-mcu.sh b/helper-scripts/project-impl/compile-examples-mcu.sh
index afb813d..6c515eb 100644
--- a/helper-scripts/project-impl/compile-examples-mcu.sh
+++ b/helper-scripts/project-impl/compile-examples-mcu.sh
@@ -1,19 +1,23 @@
#!/bin/bash
-source "./helper-scripts/abstract/abstract-compile-examples.sh"
+source "./helper-scripts/abstract/abstract-compile.sh"
source "./helper-scripts/project-impl/variables.sh"
TARGET_MACHINE="${1}"
EXAMPLE="${2}"
-EXECUTABLE_SUFFIX="${3}"
+EXECUTABLE="${3}"
SYSTEM_DIR="${4}"
BUILD_DIR="${5}"
-SHARED_LIB="${6}"
cd "${project_root}/${electrostatic_sandbox}" || exit
-compile "${AVR_GCC_BIN}" "${AVR_GPP_BIN}" "${SHARED_LIB}" "-D_ELECTRO_MIO" \
- "${TARGET_MACHINE}" "${AVR_TOOLCHAIN_INCLUDES}" "${source_dir}" \
- "${EXAMPLE}" "${EXECUTABLE_SUFFIX}" "${SYSTEM_DIR}/${BUILD_DIR}" "${examples_dir}"
+sources="$(pwd)/${examples_dir}/src/${EXAMPLE}"
+dependencies="$(pwd)/${examples_dir}/dependencies/libs/${SYSTEM_DIR}/${BUILD_DIR}/libelectrostatic-a.a"
+
+compile "${EXECUTABLE}" "${AVR_GCC_BIN}" "${AVR_GPP_BIN}" \
+ "OFF" "OFF" "ON" "${INPUT_COMPILER_OPTIONS}" \
+ "${TARGET_MACHINE}" "${AVR_TOOLCHAIN_INCLUDES};${electrostatic_core_headers}" \
+ "${examples_dir}" "${sources}" "${dependencies};m" \
+ "${SYSTEM_DIR}/${BUILD_DIR}" "."
cd "${project_root}" || exit
diff --git a/helper-scripts/project-impl/compile-examples.sh b/helper-scripts/project-impl/compile-examples.sh
index 9d205ec..0715b6a 100644
--- a/helper-scripts/project-impl/compile-examples.sh
+++ b/helper-scripts/project-impl/compile-examples.sh
@@ -1,19 +1,23 @@
#!/bin/bash
-source "./helper-scripts/abstract/abstract-compile-examples.sh"
+source "./helper-scripts/abstract/abstract-compile.sh"
source "./helper-scripts/project-impl/variables.sh"
TARGET_MACHINE="${1}"
EXAMPLE="${2}"
-EXECUTABLE_SUFFIX="${3}"
+EXECUTABLE="${3}"
SYSTEM_DIR="${4}"
BUILD_DIR="${5}"
-SHARED_LIB="${6}"
-cd "${project_root}/${electrostatic_sandbox}" || exit
+cd "${project_root}/${electrostatic_sandbox}" || exit $?
-compile "${GCC_BIN_x86}" "${GPP_BIN_x86}" "${SHARED_LIB}" "${INPUT_COMPILER_OPTIONS}" \
- "${TARGET_MACHINE}" "${TOOLCHAIN_INCLUDES_x86}" "${source_dir}" \
- "${EXAMPLE}" "${EXECUTABLE_SUFFIX}" "${SYSTEM_DIR}/${BUILD_DIR}" "${examples_dir}"
+sources="$(pwd)/${examples_dir}/src/${EXAMPLE}"
+dependencies="$(pwd)/${examples_dir}/dependencies/libs/${SYSTEM_DIR}/${BUILD_DIR}/libelectrostatic-a.a"
-cd "${project_root}" || exit
+compile "${EXECUTABLE}" "${GCC_BIN_x86}" "${GPP_BIN_x86}" \
+ "OFF" "OFF" "ON" "${INPUT_COMPILER_OPTIONS}" \
+ "${TARGET_MACHINE}" "${TOOLCHAIN_INCLUDES_x86};${electrostatic_core_headers}" \
+ "${examples_dir}" "${sources}" "${dependencies};m;pthread;dl" \
+ "${SYSTEM_DIR}/${BUILD_DIR}" "."
+
+cd "${project_root}" || exit $?
diff --git a/helper-scripts/project-impl/variables.sh b/helper-scripts/project-impl/variables.sh
index 9056c0e..9c714e3 100644
--- a/helper-scripts/project-impl/variables.sh
+++ b/helper-scripts/project-impl/variables.sh
@@ -2,6 +2,7 @@
project_root=$(pwd)
electrostatic_sandbox="electrostatic-sandbox-framework"
+NULL="NULL"
sandbox_path="/opt/electrostatic-sandbox"
COMMISSION_LIB="electrostatic"
@@ -41,6 +42,9 @@ TARGET_x86="-m32"
source_dir="electrostatic-core"
examples_dir="electrostatic-examples"
+electrostatic_core_headers="$(pwd)/electrostatic-sandbox-framework/electrostatic-core/src/include"
+POST_COMPILE_TRUE="POST_COMPILE_TRUE"
+
e4j_dir="electrostatic4j/electrostatic4j-native"
serial4j_dir="electrostatic4j/serial4j"