|
|
|
@ -158,18 +158,6 @@ set_executable_paths() {
|
|
|
|
|
: "${AVR_SIZE:=${COMPILER_PATH}/${COMPILER_PREFIX}size}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
build_version() {
|
|
|
|
|
: "${LIB_PROPERTIES_PATH:="../.."}"
|
|
|
|
|
GIT_VERSION="$(
|
|
|
|
|
cd "${SKETCH_DIR}"
|
|
|
|
|
if [ -d .git ]; then echo -n '-g' && git describe --abbrev=4 --dirty --always; fi
|
|
|
|
|
)"
|
|
|
|
|
LIB_VERSION="$(
|
|
|
|
|
cd "${SKETCH_DIR}"
|
|
|
|
|
(grep version= "${LIB_PROPERTIES_PATH}/library.properties" 2>/dev/null || echo version=0.0.0) | cut -d= -f2
|
|
|
|
|
)${GIT_VERSION}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
build_paths() {
|
|
|
|
|
# We need that echo because we\re piping to cksum
|
|
|
|
|
# shellcheck disable=SC2005
|
|
|
|
@ -192,13 +180,6 @@ build_paths() {
|
|
|
|
|
mkdir -p "$BUILD_PATH"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
build_filenames() {
|
|
|
|
|
: "${OUTPUT_FILE_PREFIX:=${SKETCH_BASE_NAME}-${LIB_VERSION}}"
|
|
|
|
|
: "${HEX_FILE_PATH:=${OUTPUT_PATH}/${OUTPUT_FILE_PREFIX}.hex}"
|
|
|
|
|
: "${HEX_FILE_WITH_BOOTLOADER_PATH:=${OUTPUT_PATH}/${OUTPUT_FILE_PREFIX}-with-bootloader.hex}"
|
|
|
|
|
: "${ELF_FILE_PATH:=${OUTPUT_PATH}/${OUTPUT_FILE_PREFIX}.elf}"
|
|
|
|
|
: "${LIB_FILE_PATH:=${OUTPUT_PATH}/${OUTPUT_FILE_PREFIX}.a}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enable_ccache() {
|
|
|
|
|
if [ -z "${CCACHE_NOT_SUPPORTED}" ] && [ "$(command -v ccache)" ]; then
|
|
|
|
@ -264,12 +245,6 @@ find_sketch() {
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
find_device_vid_pid() {
|
|
|
|
|
: "${VID:=$(_arduino_prop 'build.vid')}"
|
|
|
|
|
: "${SKETCH_PID:=$(_arduino_prop 'build.pid')}"
|
|
|
|
|
: "${BOOTLOADER_PID:=$(_arduino_prop 'bootloader.pid')}"
|
|
|
|
|
: "${BOOTLOADER_VID:=$(_arduino_prop 'bootloader.vid')}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
prompt_before_flashing() {
|
|
|
|
|
flashing_instructions=$(_arduino_prop 'build.flashing_instructions')
|
|
|
|
@ -291,7 +266,11 @@ prompt_before_flashing() {
|
|
|
|
|
flash() {
|
|
|
|
|
compile "$@"
|
|
|
|
|
|
|
|
|
|
find_device_vid_pid
|
|
|
|
|
: "${VID:=$(_arduino_prop 'build.vid')}"
|
|
|
|
|
: "${SKETCH_PID:=$(_arduino_prop 'build.pid')}"
|
|
|
|
|
: "${BOOTLOADER_PID:=$(_arduino_prop 'bootloader.pid')}"
|
|
|
|
|
: "${BOOTLOADER_VID:=$(_arduino_prop 'bootloader.vid')}"
|
|
|
|
|
|
|
|
|
|
# Check to see if we can see a keyboard bootloader port.
|
|
|
|
|
# If we -can-, then we should skip over the "reset to bootloader" thing
|
|
|
|
|
find_bootloader_ports
|
|
|
|
@ -342,10 +321,25 @@ hex_with_bootloader() {
|
|
|
|
|
compile() {
|
|
|
|
|
find_sketch
|
|
|
|
|
set_executable_paths
|
|
|
|
|
build_version
|
|
|
|
|
|
|
|
|
|
: "${LIB_PROPERTIES_PATH:="../.."}"
|
|
|
|
|
GIT_VERSION="$(
|
|
|
|
|
cd "${SKETCH_DIR}"
|
|
|
|
|
if [ -d .git ]; then echo -n '-g' && git describe --abbrev=4 --dirty --always; fi
|
|
|
|
|
)"
|
|
|
|
|
LIB_VERSION="$(
|
|
|
|
|
cd "${SKETCH_DIR}"
|
|
|
|
|
(grep version= "${LIB_PROPERTIES_PATH}/library.properties" 2>/dev/null || echo version=0.0.0) | cut -d= -f2
|
|
|
|
|
)${GIT_VERSION}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build_paths
|
|
|
|
|
build_filenames
|
|
|
|
|
enable_ccache
|
|
|
|
|
: "${OUTPUT_FILE_PREFIX:=${SKETCH_BASE_NAME}-${LIB_VERSION}}"
|
|
|
|
|
: "${HEX_FILE_PATH:=${OUTPUT_PATH}/${OUTPUT_FILE_PREFIX}.hex}"
|
|
|
|
|
: "${HEX_FILE_WITH_BOOTLOADER_PATH:=${OUTPUT_PATH}/${OUTPUT_FILE_PREFIX}-with-bootloader.hex}"
|
|
|
|
|
: "${ELF_FILE_PATH:=${OUTPUT_PATH}/${OUTPUT_FILE_PREFIX}.elf}"
|
|
|
|
|
: "${LIB_FILE_PATH:=${OUTPUT_PATH}/${OUTPUT_FILE_PREFIX}.a}"
|
|
|
|
|
|
|
|
|
|
install -d "${OUTPUT_PATH}"
|
|
|
|
|
|
|
|
|
|