|
| 1 | +# Electrostatic-application |
| 2 | +> An executable template utilizing the Electrostatic-Sandbox SDK |
| 3 | +
|
| 4 | +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. |
| 5 | + |
| 6 | +## System Requirements |
| 7 | +1) A GNU/Linux System or a WSL System. |
| 8 | +2) A minimum of 1GB RAM, and 4GB Disk Space. |
| 9 | +3) If planned Microcontroller development; ATMega32 and/or ATMega328p are the currently supported ones. |
| 10 | +4) If planned Android development; all Android variants are supported. |
| 11 | + |
| 12 | +## Setup the Electrostatic Environment |
| 13 | +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. |
| 14 | + |
| 15 | +```bash |
| 16 | +chmod +rwx ./helper-scripts/setup-environment/setup-sandbox.sh && \ |
| 17 | + ./helper-scripts/setup-environment/setup-sandbox.sh |
| 18 | +``` |
| 19 | + |
| 20 | +## Build the application binary (.elf) |
| 21 | +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. |
| 22 | + |
| 23 | +```bash |
| 24 | +chmod +x ./helper-scripts/project-impl/compile-all.sh && \ |
| 25 | + ./helper-scripts/project-impl/compile-all.sh |
| 26 | +``` |
| 27 | + |
| 28 | +## Introducing other building routines using Bash |
| 29 | +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. |
| 30 | + |
| 31 | +Usually the build routines will look like that in general: |
| 32 | +https://github.com/Electrostat-Lab/Electrostatic-application/blob/0a4d1cb1635df59e5753aad2e2fad8a380d87706/helper-scripts/project-impl/compile-all.sh#L3-L14 |
| 33 | + |
| 34 | +They are dependent on that abstraction: |
| 35 | +https://github.com/Electrostat-Lab/Electrostatic-application/blob/0a4d1cb1635df59e5753aad2e2fad8a380d87706/helper-scripts/abstract/abstract-compile.sh#L1-L35 |
| 36 | + |
| 37 | +## Changing the project output name |
| 38 | +This could be attained by changing the variable `COMMISSION_EXE` in the `./helper-scripts/project-impl/variables.sh`: |
| 39 | +https://github.com/Electrostat-Lab/Electrostatic-application/blob/4963fe780fbb90f48d0fe2448488f006e202e88e/helper-scripts/project-impl/variables.sh#L9 |
| 40 | + |
| 41 | +## Adding new dependencies |
| 42 | +Add your dependencies in the `libs` 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: |
| 43 | +https://github.com/Electrostat-Lab/Electrostatic-application/blob/4963fe780fbb90f48d0fe2448488f006e202e88e/helper-scripts/project-impl/compile-electrostatic-app.sh#L27-L43 |
| 44 | + |
| 45 | +## Build front-end automata, CMake, and Toolchains |
| 46 | +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. |
| 47 | + |
| 48 | +The build of the Electrostatic-applications is much simpler than the SDK; it's literally a subset of it. |
| 49 | + |
| 50 | +For more; refer to the [build architecture of the Electrostatic-Sandbox SDK](https://github.com/Electrostat-Lab/Electrostatic-Sandbox/blob/master/electrostatic-sandbox-framework/docs/system-build/architecture.md). |
0 commit comments