diff --git a/docker/build.sh b/docker/build.sh index 3a467b9f..ed70df44 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -74,7 +74,7 @@ CmakeGenerate() { CmakeBuild() { local target="$1" [ -n "$target" ] && target="--target $target" - cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target -- -j$(nproc) + cmake --build "$BUILD_DIR" --config $BUILD_TYPE --DBUILD_DFU=1 $target -- -j$(nproc) BUILD_RESULT=$? return $BUILD_RESULT } diff --git a/docker/post_build.sh.in b/docker/post_build.sh.in index 5d82f3be..7e9ad975 100755 --- a/docker/post_build.sh.in +++ b/docker/post_build.sh.in @@ -8,14 +8,30 @@ export PROJECT_VERSION="@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT mkdir -p "$OUTPUT_DIR" -cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin -cp "$BUILD_DIR/src/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin" -cp "$BUILD_DIR/src/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" - -cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" -cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" - -cp "$BUILD_DIR/src/resources/infinitime-resources-$PROJECT_VERSION.zip" "$OUTPUT_DIR/infinitime-resources-$PROJECT_VERSION.zip" +if test -f "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin; then + echo "copying bootloader" + cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin +fi +if test -f "$BUILD_DIR/src/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin"; then + echo "copying pinetime-mcuboot-app-image....bin" + cp "$BUILD_DIR/src/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin" +fi +if test -f "$BUILD_DIR/src/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip"; then + echo "copying pinetime-mcuboot-app-dfu....zip" + cp "$BUILD_DIR/src/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" +fi +if test -f "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin"; then + echo "copying pinetime-mcuboot-recovery-loader-image....bin" + cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" +fi +if test -f "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip"; then + echo "copying pinetime-mcuboot-recovery-loader-dfu....zip" + cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" +fi +if test -f "$BUILD_DIR/src/resources/infinitime-resources-$PROJECT_VERSION.zip"; then + echo "copying infinitime-resources....zip" + cp "$BUILD_DIR/src/resources/infinitime-resources-$PROJECT_VERSION.zip" "$OUTPUT_DIR/infinitime-resources-$PROJECT_VERSION.zip" +fi mkdir -p "$OUTPUT_DIR/src" cp $BUILD_DIR/src/*.bin "$OUTPUT_DIR/src/" @@ -23,4 +39,5 @@ cp $BUILD_DIR/src/*.hex "$OUTPUT_DIR/src/" cp $BUILD_DIR/src/*.out "$OUTPUT_DIR/src/" cp $BUILD_DIR/src/*.map "$OUTPUT_DIR/src/" -ls -RUv1 "$OUTPUT_DIR" | sed 's;^\([^/]\); \1;g' \ No newline at end of file +ls -RUv1 "$OUTPUT_DIR" | sed 's;^\([^/]\); \1;g' + diff --git a/docker/runBuild b/docker/runBuild new file mode 100755 index 00000000..35ad0548 --- /dev/null +++ b/docker/runBuild @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Build just the pinetime mcuboot app (with DFU version) by executing: +# ./docker/runBuild pinetime-mcuboot-app +# from the main InfiniTime repository folder +# +#docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime-build +docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime-build /opt/build.sh $1 + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd8ece62..511be23c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.10) project(pinetime-app C CXX ASM) - # define some variables just for this example to determine file locations set(NRF_PROJECT_NAME pinetime-app) set(NRF_BOARD pca10040) @@ -771,6 +770,10 @@ link_directories( ) +set_source_files_properties(displayapp/screens/SystemInfo.cpp PROPERTIES + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Version.h +) + set(COMMON_FLAGS -MP -MD -mthumb -mabi=aapcs -ftree-vrp -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin -fshort-enums -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fstack-usage -fno-exceptions -fno-non-call-exceptions) set(WARNING_FLAGS -Wall -Wextra -Warray-bounds=2 -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-nonliteral -Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-expansion-to-defined -Wreturn-type -Werror=return-type -Werror) set(DEBUG_FLAGS -Og -g3)