- Notifications
You must be signed in to change notification settings - Fork1
An executable application utilizing the Electrostatic-Sandbox SDK tech-stack.
License
Electrostat-Lab/Electrostatic-application
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
An executable template utilizing the Electrostatic-Sandbox SDK
This is a template that builds a cross-platform native executable application for Linux variants, Android variants, and AVR MCU variants utilizing the Electrostatic-Sandbox SDK libraries.
- A GNU/Linux System or a WSL System.
- A minimum of 1GB RAM, and 4GB Disk Space.
- If planned Microcontroller development; ATMega32 and/or ATMega328p are the currently supported ones.
- If planned Android development; all Android variants are supported.
This will install missing dependencies (CLI tools and toolchains) in/opt/electrostatic-sandbox that shall be utilized by the SDK build front-end and CMake to build the applications.
chmod +rwx ./helper-scripts/setup-environment/setup-sandbox.sh&& \ ./helper-scripts/setup-environment/setup-sandbox.shThis will build the application binary to all supported platforms; usually if a new build routine is to be built, it has to go here.
chmod +x ./helper-scripts/project-impl/compile-all.sh&& \ ./helper-scripts/project-impl/compile-all.shIntroducing other building routines is far easy. However, it's mostly dependent on whether the original SDK is supporting those platforms. If not yet, you will have to build a pre-compilation header that excludes the SDK for those unsupported systems or else you will get linking errors.
Usually the build routines will look like that in general:
| # pre-compilation automata | |
| source"./helper-scripts/project-impl/variables.sh" | |
| source_module="${app_src}/" | |
| electrostatic_sdk="${app_libs}" | |
| # compilation automata | |
| ./helper-scripts/project-impl/compile-electrostatic-app.sh \ | |
| "${COMMISSION_EXE}""${GCC_BIN_x86}""${GPP_BIN_x86}""-O3 -fPIC" \ | |
| "${TARGET_x86_64}""${TOOLCHAIN_INCLUDES_x86};${app_headers}""${source_module}" \ | |
| "${electrostatic_sdk}/linux/x86-64/""m;pthread;dl""." \ | |
| "linux""${x86_64}" |
They are dependent on that abstraction:
| #!/bin/bash | |
| functioncompile() { | |
| local COMMISSION_OUTPUT=${1} | |
| local GCC_BIN=${2} | |
| local GPP_BIN=${3} | |
| local INPUT_COMPILER_OPTIONS=${4} | |
| local TARGET=${5} | |
| local HEADERS=${6} | |
| local SOURCES_DIR=${7} | |
| local PROJECT_SOURCES=${8} | |
| local DEPENDENCIES=${9} | |
| local BUILD_DIR=${10} | |
| local CMAKE_DIR=${11} | |
| local TEMP=$(pwd) | |
| cd"${CMAKE_DIR}"||exit$? | |
| cmake-3.19"-DCOMMISSION_OUTPUT=${COMMISSION_OUTPUT}" \ | |
| "-DGCC_BIN=${GCC_BIN}" \ | |
| "-DGPP_BIN=${GPP_BIN}" \ | |
| "-DINPUT_COMPILER_OPTIONS=${INPUT_COMPILER_OPTIONS}" \ | |
| "-DTARGET=${TARGET}" \ | |
| "-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}"||exit$? | |
| cd"${TEMP}"||exit$? | |
| } |
This could be attained by changing the variableCOMMISSION_EXE in the./helper-scripts/project-impl/variables.sh:
| COMMISSION_EXE="electrostatic-app" |
Add your dependencies in thelibs directory with the system directory of choice if required (in case of platform-dependent binaries); the build script finds all libraries listed under this directory through this code snippet:
Electrostatic-application/helper-scripts/project-impl/compile-electrostatic-app.sh
Lines 27 to 43 in4963fe7
| if ["${DEPENDENCIES_MODULES[*]}"!="${NULL}" ];then | |
| if ["${DYNAMIC_LINKING}"=="true" ];then | |
| echo -e"--------- Deferring Linking to runtime ---------" | |
| dependencies=$(find${DEPENDENCIES_MODULES[*]} -name*.so| tr'\n'';') | |
| else | |
| echo -e"--------- Performing Static Linking ---------" | |
| dependencies=$(find${DEPENDENCIES_MODULES[*]} -name*.a -o -name*.ar| tr'\n'';') | |
| fi | |
| fi | |
| # compile scripts | |
| compile"${COMMISSION_OUTPUT}""${GCC_BIN}""${GPP_BIN}" \ | |
| "${COMPILER_OPTIONS}" \ | |
| "${TARGET_MACHINE}""${HEADERS}" \ | |
| "${SOURCE_DIR}""${sources}""${dependencies};${BUILTIN_LIBS}" \ | |
| "${SYSTEM_DIR}/${BUILD_DIR}"".""${SOURCE_DIR}" | |
Essentially, the build architecture of the Electrostatic-Sandbox SDK is based on the idea of creating a front-end scripted API that creates a building automata, which entails taking an input and passing into a chain of states, and eventually ending with a terminal state; thus the recognition of the machine to the building holds if the terminal state is being reached by the program counter. The initial input to the automata is mainly a building routine instruction and the outputs are proceeded and could be found at the filesystems cmake-build and build, where the terminal output is produced.
The build of the Electrostatic-applications is much simpler than the SDK; it's literally a subset of it.
For more; refer to thebuild architecture of the Electrostatic-Sandbox SDK.
About
An executable application utilizing the Electrostatic-Sandbox SDK tech-stack.
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.