Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed Dec 18, 2024
1 parent cea7821 commit d43cb2c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
18 changes: 13 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,19 @@ else()
message(SEND_ERROR "CAN_PROTOCOL is unknown.")
endif()

# Set build dir based on hardware version and protocol
set(BUILD_ROOT_DIR ${ROOT_DIR}/build)
set(BUILD_TARGET_DIR ${BUILD_ROOT_DIR}/${CAN_PROTOCOL}_${PLATFORM_NAME})
set(BUILD_SRC_DIR ${BUILD_TARGET_DIR}/src)
set(BUILD_OBJ_DIR ${BUILD_TARGET_DIR}/obj)
# Set build dir based on the hardware version and protocol
if(DEFINED BUILD_OBJ_DIR)
cmake_path(GET BUILD_OBJ_DIR PARENT_PATH BUILD_TARGET_DIR)
set(BUILD_SRC_DIR ${BUILD_TARGET_DIR}/src)
else()
set(BUILD_TARGET_DIR ${ROOT_DIR}/build/${CAN_PROTOCOL}_${PLATFORM_NAME})
set(BUILD_SRC_DIR ${BUILD_TARGET_DIR}/src)
set(BUILD_OBJ_DIR ${BUILD_TARGET_DIR}/obj)
endif()

message(STATUS "BUILD_TARGET_DIR is set to ${BUILD_TARGET_DIR}")
message(STATUS "BUILD_OBJ_DIR is set to ${BUILD_OBJ_DIR}")
message(STATUS "BUILD_SRC_DIR is set to ${BUILD_SRC_DIR}")

if(USE_PLATFORM_UBUNTU)
add_definitions(-DLIBPARAMS_PARAMS_DIR="${BUILD_SRC_DIR}")
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@ v3: checks generate_dsdl clean
mkdir -p ${BUILD_DIR}/both_v3/obj
cd ${BUILD_DIR}/both_v3/obj && cmake -DCAN_PROTOCOL=both -DUSE_PLATFORM_NODE_V3=ON -G "Unix Makefiles" ../../.. && make

# Bootloader
bootloader: bootloader_v3
bootloader_v3: generate_dsdl
mkdir -p ${BUILD_DIR}/bootloader_v3/libs/kocherga && \
cd ${BUILD_DIR}/bootloader_v3/libs/kocherga && \
if [ ! -d .git ]; then \
git clone https://github.com/Zubax/kocherga.git . && \
git checkout d806ba1; \
else \
echo "Repository already exists, skipping clone."; \
fi

mkdir -p ${BUILD_DIR}/bootloader_v3/libs/bootloader-ioc && \
cd ${BUILD_DIR}/bootloader_v3/libs/bootloader-ioc && \
if [ ! -d .git ]; then \
git clone https://github.com/RaccoonLabHardware/v3-software-template.git . && \
git checkout dc90159; \
else \
echo "Repository already exists, skipping clone."; \
fi

mkdir -p ${BUILD_DIR}/bootloader_v3/obj
cd ${BUILD_DIR}/bootloader_v3/obj && cmake -DCAN_PROTOCOL=both -DUSE_PLATFORM_NODE_V3=ON -DBUILD_OBJ_DIR=`pwd` -G "Unix Makefiles" ../../.. && make

# Common:
checks:
@python scripts/prebuild_check.py || (echo "Requirements verification failed. Stopping build." && exit 1)
Expand Down
2 changes: 1 addition & 1 deletion cmake/create_binary_with_meaningful_name.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(SOURCE_BIN "${BUILD_OBJ_DIR}/example.bin")
# message(FATAL_ERROR "${SOURCE_BIN}")

# Define the source and destination paths
set(DESTINATION_DIR "${BUILD_ROOT_DIR}/release")
set(DESTINATION_DIR "${BUILD_RELEASE_DIR}")
set(DESTINATION_BIN "${DESTINATION_DIR}/node_${PLATFORM_NAME}_${CAN_PROTOCOL}_${LATEST_COMMIT_DATE}_v${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}_${GIT_HASH_SHORT_8_DIGITS}.bin")

# Create the release directory if it doesn't exist
Expand Down

0 comments on commit d43cb2c

Please sign in to comment.