mirror of
https://github.com/muccc/WomoLIN.git
synced 2026-02-20 02:21:18 +01:00
cleanup CMake
This commit is contained in:
@@ -15,3 +15,10 @@ add_executable(${PROJECT_NAME}
|
||||
|
||||
target_link_libraries (${PROJECT_NAME} target womolin)
|
||||
|
||||
add_custom_command(OUTPUT ${PROJECT_NAME}.bin
|
||||
COMMAND "${CMAKE_OBJCOPY} ARGS -O ihex ${PROJECT_NAME} ${PROJECT_NAME}.hex"
|
||||
DEPENDS ${PROJECT_NAME}
|
||||
COMMENT "objcopying ${PROJECT_NAME} to ${PROJECT_NAME}.hex")
|
||||
|
||||
add_custom_target(${PROJECT_NAME}.hex ALL DEPENDS ${PROJECT_NAME})
|
||||
|
||||
|
||||
@@ -2,5 +2,16 @@ SET(WOMOLIN_TARGET "TARGET_MAINUNIT")
|
||||
|
||||
SET(CMAKE_C_COMPILER /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc)
|
||||
SET(CMAKE_CXX_COMPILER "/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-g++")
|
||||
SET(CMAKE_OBJCOPY "/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-objcopy")
|
||||
SET(CMAKE_CXX_FLAGS -D${WOMOLIN_TARGET})
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-specs=nosys.specs")
|
||||
|
||||
SET(CPU "cortex-m4")
|
||||
|
||||
SET(COMMON_COMPILE_FLAGS "-mcpu=${CPU} -mthumb -DSTM32L476xx -DUSE_HAL_DRIVER")
|
||||
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILE_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS}")
|
||||
|
||||
ADD_COMPILE_OPTIONS("-Tdrv/system/cmsis/STM32L476RGTx_FLASH.ld")
|
||||
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
SET(LIB_NAME "target")
|
||||
project(${LIB_NAME})
|
||||
|
||||
set(DEFINITIONS "${DEFINITIONS} -DSTM32L476xx")
|
||||
set(DEFINITIONS "${DEFINITIONS} -DUSE_HAL_DRIVER")
|
||||
|
||||
set(CMAKE_C_FLAGS "${DEFINITIONS}")
|
||||
set(CMAKE_CXX_FLAGS "${DEFINITIONS}")
|
||||
|
||||
#TODO das muss raus
|
||||
include_directories(drv/system/cmsis/inc drv/system/hal/inc drv/inc)
|
||||
|
||||
add_compile_options("-Tdrv/system/cmsis/STM32L476RGTx_FLASH.ld")
|
||||
|
||||
add_subdirectory(drv/system/cmsis/src)
|
||||
add_subdirectory(drv/system/hal/src)
|
||||
add_subdirectory(drv/src)
|
||||
add_subdirectory(drv)
|
||||
|
||||
add_library(${LIB_NAME}
|
||||
hwinit
|
||||
@@ -22,5 +13,6 @@ add_library(${LIB_NAME}
|
||||
unit
|
||||
)
|
||||
|
||||
#TODO nur driver lib moeglich?
|
||||
target_link_libraries( ${LIB_NAME} driver hal cmsis)
|
||||
|
||||
|
||||
2
Software/firmware/target/mainunit/drv/CMakeLists.txt
Normal file
2
Software/firmware/target/mainunit/drv/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(system)
|
||||
add_subdirectory(src)
|
||||
@@ -8,8 +8,8 @@
|
||||
#ifndef INC_UART_HPP_
|
||||
#define INC_UART_HPP_
|
||||
|
||||
#include "stm32l476xx.h"
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include "../system/cmsis/inc/stm32l476xx.h"
|
||||
#include "../system/hal/inc/stm32l4xx_hal.h"
|
||||
|
||||
#include "circularbuffer.hpp"
|
||||
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
SET(LIB_NAME "driver")
|
||||
project(${LIB_NAME})
|
||||
|
||||
set(DEFINITIONS "${DEFINITIONS} -DSTM32L476xx")
|
||||
set(DEFINITIONS "${DEFINITIONS} -DUSE_HAL_DRIVER")
|
||||
|
||||
set(CMAKE_C_FLAGS "${DEFINITIONS}")
|
||||
set(CMAKE_CXX_FLAGS "${DEFINITIONS}")
|
||||
|
||||
include_directories(../inc ../system/cmsis/inc ../system/hal/inc)
|
||||
|
||||
add_library(${LIB_NAME}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(cmsis)
|
||||
add_subdirectory(hal)
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(src)
|
||||
@@ -226,7 +226,7 @@ typedef enum
|
||||
*/
|
||||
|
||||
#if defined (USE_HAL_DRIVER)
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include "../../hal/inc/stm32l4xx_hal.h"
|
||||
#endif /* USE_HAL_DRIVER */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
SET(LIB_NAME "cmsis")
|
||||
project(${LIB_NAME})
|
||||
|
||||
set(DEFINITIONS "${DEFINITIONS} -DSTM32L476xx")
|
||||
set(DEFINITIONS "${DEFINITIONS} -DUSE_HAL_DRIVER")
|
||||
|
||||
set(CMAKE_C_FLAGS "${DEFINITIONS}")
|
||||
set(CMAKE_CXX_FLAGS "${DEFINITIONS}")
|
||||
|
||||
include_directories(../inc)
|
||||
|
||||
enable_language(ASM)
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "stm32l4xx.h"
|
||||
#include "../inc/stm32l4xx.h"
|
||||
|
||||
#if !defined (HSE_VALUE)
|
||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(src)
|
||||
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32l4xx_hal_conf.h"
|
||||
#include "../../../inc/stm32l4xx_hal_conf.h"
|
||||
|
||||
/** @addtogroup STM32L4xx_HAL_Driver
|
||||
* @{
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
SET(LIB_NAME "hal")
|
||||
project(${LIB_NAME})
|
||||
|
||||
set(CPU "cortex-m4")
|
||||
|
||||
set(COMMON_COMPILE_FLAGS "-mcpu=${CPU} -mthumb")
|
||||
|
||||
set(DEFINITIONS "${DEFINITIONS} -DSTM32L476xx")
|
||||
set(DEFINITIONS "${DEFINITIONS} -DUSE_HAL_DRIVER")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILE_FLAGS} ${DEFINITIONS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS} ${DEFINITIONS}")
|
||||
|
||||
include_directories(../inc ../../../inc ../../cmsis/inc)
|
||||
|
||||
add_library(${LIB_NAME}
|
||||
|
||||
Reference in New Issue
Block a user