|
|
@ -79,6 +79,12 @@ include(${CMAKE_CORE_DIR}/cmakeCore.cmake)
|
|
|
|
# For Detailed error messages.
|
|
|
|
# For Detailed error messages.
|
|
|
|
include(${CMAKE_CORE_DIR}/errorHandler.cmake)
|
|
|
|
include(${CMAKE_CORE_DIR}/errorHandler.cmake)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# For Doxygen document generatio
|
|
|
|
|
|
|
|
include(${CMAKE_CORE_DIR}/doxygen.cmake)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# All the library and submodule funtions and definitions are written here
|
|
|
|
|
|
|
|
include(${CMAKE_CORE_DIR}/cmakeProject.cmake)
|
|
|
|
|
|
|
|
|
|
|
|
# Include the project definition defined by the end user implementiogn KED as a submodule
|
|
|
|
# Include the project definition defined by the end user implementiogn KED as a submodule
|
|
|
|
include(${PROJECT_CONFIG_FILE})
|
|
|
|
include(${PROJECT_CONFIG_FILE})
|
|
|
|
|
|
|
|
|
|
|
@ -118,15 +124,16 @@ createHeaderDirList("${DRIVERS_DIR}" "${DRIVERS_LIST}" "DRIVERS_HEADERS_DIR")
|
|
|
|
message("${BoldBlue}|-->For Libraries")
|
|
|
|
message("${BoldBlue}|-->For Libraries")
|
|
|
|
createHeaderDirList("${LIBRARIES_DIR}" "${LIBRARIES_LIST}" "LIBRARIES_HEADERS_DIR")
|
|
|
|
createHeaderDirList("${LIBRARIES_DIR}" "${LIBRARIES_LIST}" "LIBRARIES_HEADERS_DIR")
|
|
|
|
message("${BoldBlue}|-->For Project")
|
|
|
|
message("${BoldBlue}|-->For Project")
|
|
|
|
checkDirectories("${PROJECT_HEADERS_DIR}")
|
|
|
|
createHeaderDirListProject("${PROJECT_ADDITIONAL_DIRS}" "PROJECT_HEADERS_DIR")
|
|
|
|
message("${BoldBlue}+-------------------------------+${ColourReset}")
|
|
|
|
message("${BoldBlue}+-------------------------------+${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Stick all the herade direcotries together for ease of use further down
|
|
|
|
set (COMMON_HEADERS ${CSL_HEADERS_DIR}
|
|
|
|
set (COMMON_HEADERS ${CSL_HEADERS_DIR}
|
|
|
|
|
|
|
|
${SYSTEM_HEADERS_DIR}
|
|
|
|
${PERIPHERALS_HEADERS_DIR}
|
|
|
|
${PERIPHERALS_HEADERS_DIR}
|
|
|
|
${DRIVERS_HEADERS_DIR}
|
|
|
|
${DRIVERS_HEADERS_DIR}
|
|
|
|
${LIBRARIES_HEADERS_DIR}
|
|
|
|
${LIBRARIES_HEADERS_DIR}
|
|
|
|
${PROJECT_HEADERS_DIR}
|
|
|
|
${PROJECT_HEADERS_DIR})
|
|
|
|
${SYSTEM_HEADERS_DIR})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
# Making Modules
|
|
|
|
# Making Modules
|
|
|
@ -144,59 +151,55 @@ makeSubmodules("${DRIVERS_DIR}" "${DRIVERS_LIST}" "DRIVER_LIBS")
|
|
|
|
message("${BoldBlue}|-->For Libraries")
|
|
|
|
message("${BoldBlue}|-->For Libraries")
|
|
|
|
makeSubmodules("${LIBRARIES_DIR}" "${LIBRARIES_LIST}" "LIBRARIES_LIBS")
|
|
|
|
makeSubmodules("${LIBRARIES_DIR}" "${LIBRARIES_LIST}" "LIBRARIES_LIBS")
|
|
|
|
message("${BoldBlue}|-->For Project")
|
|
|
|
message("${BoldBlue}|-->For Project")
|
|
|
|
makeSubmodules("${PROJECT_DIR}" "${PROJECT_SOURCES_DIR_LIST}" "PROJECT_LIBS")
|
|
|
|
makeSubmodulesProject("${PROJECT_ADDITIONAL_DIRS}" "${PROJECT_TO_COMPILE_LIST}" "PROJECT_LIBS")
|
|
|
|
message("${BoldBlue}+-------------------------------+${ColourReset}")
|
|
|
|
message("${BoldBlue}+-------------------------------+${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
# Stick All the libraries together, only for code redability futher down.
|
|
|
|
# Stick All the libraries together, only for code redability futher down.
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
foreach(X IN LISTS STARTUP_UCODE
|
|
|
|
foreach(X IN LISTS STARTUP_UCODE
|
|
|
|
PROJECT_LIBS
|
|
|
|
SYSTEM_LIBS
|
|
|
|
PERIPHERAL_LIBS
|
|
|
|
PERIPHERAL_LIBS
|
|
|
|
DRIVER_LIBS
|
|
|
|
DRIVER_LIBS
|
|
|
|
LIBRARIES_LIBS
|
|
|
|
LIBRARIES_LIBS
|
|
|
|
SYSTEM_LIBS)
|
|
|
|
PROJECT_LIBS )
|
|
|
|
list(APPEND GENERATED_LIBRARIES ${X})
|
|
|
|
list(APPEND GENERATED_LIBRARIES ${X})
|
|
|
|
endforeach()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
# Overview
|
|
|
|
# Overview
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
message("${BoldCyan}")
|
|
|
|
message("${BoldBlue}")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("Project Info")
|
|
|
|
message("Project Info")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message(" |--> Executable's Name\t\t\t : ${EXECUTABLE}")
|
|
|
|
message(" |--> Executable Name:${BoldCyan} ${EXECUTABLE} ${BoldBlue}")
|
|
|
|
message(" |--> Project's directory\t\t : ${PROJECT_DIR}")
|
|
|
|
message(" |--> Startup uCode :${BoldCyan} ${STARTUP_CODE} ${BoldBlue}")
|
|
|
|
message(" |--> Project Configuration\t\t : ${PROJECT_DIR}/project.conf")
|
|
|
|
message(" |--> Linker :${BoldCyan} ${LINKER} ${BoldBlue}")
|
|
|
|
message(" |--> Chip Support Layer Dir.\t\t : ${CSL_DIR}")
|
|
|
|
message(" |--> Project Dir :${BoldCyan} ${PROJECT_DIR} ${BoldBlue}")
|
|
|
|
message(" |--> CLS's cmake configuration\t\t : ${CSL_CONFIG_FILE}")
|
|
|
|
message(" |--> Project Config :${BoldCyan} ${PROJECT_CONFIG_FILE} ${BoldBlue}")
|
|
|
|
message(" |--> Compiler Definition file\t\t : ${COMPILER_DEFS}")
|
|
|
|
message(" |--> CSL Dir :${BoldCyan} ${CSL_DIR} ${BoldBlue}")
|
|
|
|
message(" |--> Driver Dir\t\t\t : ${DRIVERS_DIR}")
|
|
|
|
message(" |--> CSL Config :${BoldCyan} ${CSL_CONFIG_FILE} ${BoldBlue}")
|
|
|
|
message(" |--> Periferal Definition Dir\t\t : ${PERIPHERALS_DIR}")
|
|
|
|
message(" |--> Compiler Config:${BoldCyan} ${COMPILER_DEFS} ${BoldBlue}")
|
|
|
|
message(" |--> Periferal Implementation Dir\t : ${CSL_SOURCES_DIR}")
|
|
|
|
|
|
|
|
message("")
|
|
|
|
message("${BoldBlue}")
|
|
|
|
message(" |--> Startup uCode Submodule:")
|
|
|
|
|
|
|
|
message(" |->${STARTUP_UCODE}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message(" |--> Main Compile Definitions:")
|
|
|
|
|
|
|
|
printList( " | " "${MAIN_DEFS}")
|
|
|
|
|
|
|
|
message(" |--> Main Compile Flags:")
|
|
|
|
|
|
|
|
printList( " | " "${MAIN_FLAGS}")
|
|
|
|
|
|
|
|
message(" |--> Linker Flags:")
|
|
|
|
|
|
|
|
printList( " | " "${LINKER_FLAGS}")
|
|
|
|
|
|
|
|
message(" |--> Periferals which will be implemented:")
|
|
|
|
|
|
|
|
printList( " |-> " "${PERIPHERALS_LIST}")
|
|
|
|
|
|
|
|
message(" |--> Drivers which will be implemented:")
|
|
|
|
|
|
|
|
printList( " |-> " "${DRIVERS_LIST}")
|
|
|
|
|
|
|
|
message(" |--> Project sources to be implemented:")
|
|
|
|
|
|
|
|
printList( " |-> " "${PROJECT_SOURCES_DIR_LIST}")
|
|
|
|
|
|
|
|
message(" |--> Generated Library Submodules ${Red}!!!This list order also defines the compilation \
|
|
|
|
|
|
|
|
order of submodules!!!${ColourReset}${BoldCyan}")
|
|
|
|
|
|
|
|
printList( " |-> " "${GENERATED_LIBRARIES}")
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("${ColourReset}")
|
|
|
|
message("Compiling Info")
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("|--> Main Compile Definitions:")
|
|
|
|
|
|
|
|
printList("${BoldCyan} | " "${MAIN_DEFS}")
|
|
|
|
|
|
|
|
message("${BoldBlue}|--> Main Compile Flags:")
|
|
|
|
|
|
|
|
printList("${BoldCyan} | " "${MAIN_FLAGS}")
|
|
|
|
|
|
|
|
message("${BoldBlue}|--> Linker Flags:")
|
|
|
|
|
|
|
|
printList("${BoldCyan} | " "${LINKER_FLAGS}")
|
|
|
|
|
|
|
|
message("${BoldBlue}|--> Periferals which will be implemented:")
|
|
|
|
|
|
|
|
printList("${BoldCyan} |-> " "${PERIPHERALS_LIST}")
|
|
|
|
|
|
|
|
message("${BoldBlue}|--> Drivers which will be implemented:")
|
|
|
|
|
|
|
|
printList("${BoldCyan} |-> " "${DRIVERS_LIST}")
|
|
|
|
|
|
|
|
message("${BoldBlue}|--> Project sources to be implemented:")
|
|
|
|
|
|
|
|
printList("${BoldCyan} |-> " "${PROJECT_SOURCES_DIR_LIST}")
|
|
|
|
|
|
|
|
message("${BoldBlue}|--> Generated Library Submodules ${Red}!!!This list order also defines the compilation \
|
|
|
|
|
|
|
|
order of submodules!!!${ColourReset}${BoldCyan}")
|
|
|
|
|
|
|
|
printList("${BoldCyan} |-> " "${GENERATED_LIBRARIES}")
|
|
|
|
|
|
|
|
message("${BoldBlue}+-------------------------------+${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
# EXECUTABLE
|
|
|
|
# EXECUTABLE
|
|
|
@ -221,15 +224,15 @@ else ()
|
|
|
|
target_link_libraries(${EXECUTABLE} ${GENERATED_LIBRARIES})
|
|
|
|
target_link_libraries(${EXECUTABLE} ${GENERATED_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
message(" |--> LINKER: ${LINKER}")
|
|
|
|
message(" |-> LINKER : ${LINKER}")
|
|
|
|
message(" |--> CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
|
|
|
|
message(" |-> C_COMPILER : ${CMAKE_C_COMPILER}")
|
|
|
|
message(" |--> CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
|
|
|
|
message(" |-> CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
|
|
|
|
message(" |--> CMAKE_ASM_COMPILER: ${CMAKE_ASM_COMPILER}")
|
|
|
|
message(" |-> ASM_COMPILER: ${CMAKE_ASM_COMPILER}")
|
|
|
|
message(" |--> CMAKE_OBJCOPY: ${CMAKE_OBJCOPY}")
|
|
|
|
message(" |-> OBJCOPY : ${CMAKE_OBJCOPY}")
|
|
|
|
message(" |--> CMAKE_SIZE: ${CMAKE_SIZE}")
|
|
|
|
message(" |-> SIZE : ${CMAKE_SIZE}")
|
|
|
|
|
|
|
|
|
|
|
|
# AS we provide our own linker nad not using the one from the curren OS (system)
|
|
|
|
# AS we provide our own linker nad not using the one from the curren OS (system)
|
|
|
|
message(" |--> CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
message(" |-> LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("${ColourReset}")
|
|
|
|
message("${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
@ -248,32 +251,11 @@ add_custom_command(TARGET ${EXECUTABLE}
|
|
|
|
POST_BUILD
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_SIZE} ${EXECUTABLE})
|
|
|
|
COMMAND ${CMAKE_SIZE} ${EXECUTABLE})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
# DOXYGEN
|
|
|
|
# Documentation generation
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
if(OUTPUT_DOXYGEN)
|
|
|
|
generateDoxygen()
|
|
|
|
find_package(Doxygen)
|
|
|
|
|
|
|
|
if (DOXYGEN_FOUND)
|
|
|
|
|
|
|
|
set(DOXYGEN_IN ${CMAKE_CORE_DIR}/doxyfile.in)
|
|
|
|
|
|
|
|
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
|
|
|
|
|
|
|
|
message("${Green}")
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("Generating Doxygen output")
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# request to configure the file
|
|
|
|
|
|
|
|
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
|
|
|
|
|
|
|
# note the option ALL which allows to build the docs together with the application
|
|
|
|
|
|
|
|
add_custom_target( doc_doxygen ALL
|
|
|
|
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
|
|
|
|
|
|
|
WORKING_DIRECTORY ${DOXYGEN_OUTPUT_DIR}
|
|
|
|
|
|
|
|
COMMENT "Generating API documentation with Doxygen"
|
|
|
|
|
|
|
|
VERBATIM )
|
|
|
|
|
|
|
|
else (DOXYGEN_FOUND)
|
|
|
|
|
|
|
|
message("Doxygen need to be installed to generate the doxygen documentation")
|
|
|
|
|
|
|
|
endif (DOXYGEN_FOUND)
|
|
|
|
|
|
|
|
endif(OUTPUT_DOXYGEN)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
#CUSTOM Comments from dev.
|
|
|
|
#CUSTOM Comments from dev.
|
|
|
|