clean up some make targets

tmp/arduino-cli-pre-rebase
Jesse Vincent 4 years ago
parent d1154635be
commit 4c23591a1f
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -61,6 +61,7 @@ cmd_flash() {
echo "When you're ready to proceed, press 'Enter'."
# We do not want to permit line continuations here. We just want a newline.
# shellcheck disable=SC2162
read
@ -68,39 +69,6 @@ cmd_flash() {
}
cmd_compile() {
install -d "${OUTPUT_PATH}"
echo "Building ${SKETCH_FILE_PATH}"
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
# shellcheck disable=SC2086
_run_arduino_cli compile \
--fqbn "${FQBN}" \
--libraries "${KALEIDOSCOPE_DIR}/.." \
--build-path "${BUILD_PATH}" \
--output-dir "${OUTPUT_PATH}" \
--build-cache-path "${CORE_CACHE_PATH}" \
--build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}" \
--warnings all ${ARDUINO_VERBOSE} \
"${SKETCH_FILE_PATH}"
if [ -z "${LIBONLY}" ]; then
cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.hex" "${HEX_FILE_PATH}"
cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.elf" "${ELF_FILE_PATH}"
ln -sf "${OUTPUT_FILE_PREFIX}.hex" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.hex"
ln -sf "${OUTPUT_FILE_PREFIX}.elf" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.elf"
else
cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.a" "${LIB_FILE_PATH}"
ln -sf "${OUTPUT_FILE_PREFIX}.a" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.a"
fi
if [ "${ARDUINO_VERBOSE}" == "--verbose" ]; then
echo "Build artifacts can be found in ${BUILD_PATH}"
fi
}
cmd_help() {

@ -194,6 +194,33 @@ clean:
rm -rf -- "${OUTPUT_PATH}/*"
_do_compile:
compile:
install -d "${OUTPUT_PATH}"
@echo "Building ${SKETCH_FILE_PATH}"
$(ARDUINO_CLI) compile \
--fqbn "${FQBN}" \
--libraries "${KALEIDOSCOPE_DIR}/.." \
--build-path "${BUILD_PATH}" \
--output-dir "${OUTPUT_PATH}" \
--build-cache-path "${CORE_CACHE_PATH}" \
--build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}" \
--warnings all ${ARDUINO_VERBOSE} \
"${SKETCH_FILE_PATH}"
ifeq ($(LIBONLY),)
cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.hex" "${HEX_FILE_PATH}"
cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.elf" "${ELF_FILE_PATH}"
ln -sf "${OUTPUT_FILE_PREFIX}.hex" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.hex"
ln -sf "${OUTPUT_FILE_PREFIX}.elf" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.elf"
else
cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.a" "${LIB_FILE_PATH}"
ln -sf "${OUTPUT_FILE_PREFIX}.a" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.a"
endif
@echo "Build artifacts can be found in ${BUILD_PATH}"
%:
$(KALEIDOSCOPE_BIN_DIR)/kaleidoscope-builder $@

Loading…
Cancel
Save