-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·36 lines (32 loc) · 908 Bytes
/
init.sh
File metadata and controls
executable file
·36 lines (32 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
# @file init.sh
# @brief Script to set up the build system with CMake.
#
# @author Chris Vig (chris@invictus.so)
# @date 2025-07-21
#
# @warning Any existing build system will be deleted.
#
# Variables
SOURCE_DIR=./
BUILD_DIR=${SOURCE_DIR}/build
CMAKE_ARGS=
# Delete and recreate build directory
rm -rf ${BUILD_DIR}
# Define function to make an MCU-specific build directory
make_build_dir() {
# Create directory
local THIS_BUILD_DIR=${BUILD_DIR}/$1
mkdir -p "${THIS_BUILD_DIR}"
# Initialize build system
cmake ${CMAKE_ARGS} \
-S "${SOURCE_DIR}" \
-B "${THIS_BUILD_DIR}" \
-DDEVICE_MCU:STRING=${1} \
-DDEVICE_F_CPU:STRING=${2}UL \
-DDEVICE_BAUD:STRING=${3}
}
# Make all required directories
make_build_dir atmega328p 16000000 9600
make_build_dir atmega2560 16000000 9600