Skip to content

Electrostat-Lab/Electrostatic-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Electrostatic-application

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.

Setup the Electrostatic Environment

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.sh

Build the application binary (.elf)

This 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.sh 

Introducing other building routines using Bash

Introducing 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
function compile() {
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 $?
}

Build front-end automata, CMake, and Toolchains

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 the build architecture of the Electrostatic-Sandbox SDK.

About

An executable application utilizing the Electrostatic-Sandbox SDK tech-stack.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages