|
|
@ -60,8 +60,13 @@ set(PERIPHERAL_LIBS)#Declared empty because it will be filled automaticaly after
|
|
|
|
|
|
|
|
|
|
|
|
# Directory for the libraries -> "Common to all CSL"
|
|
|
|
# Directory for the libraries -> "Common to all CSL"
|
|
|
|
set(LIBRARIES_DIR ${CMAKE_SOURCE_DIR}/libraries)
|
|
|
|
set(LIBRARIES_DIR ${CMAKE_SOURCE_DIR}/libraries)
|
|
|
|
set(LIBRARIES_HEADERS_DIR ${CMAKE_SOURCE_DIR}/libraries)
|
|
|
|
set(LIBRARIES_HEADERS_DIR)#Declared empty because it will be filled automaticaly afterwards
|
|
|
|
|
|
|
|
set(LIBRARIES_LIBS)#Declared empty because it will be filled automaticaly afterwards
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Directory for the SYSTEM -> "Common to all CSL"
|
|
|
|
|
|
|
|
set(SYSTEM_DIR ${CMAKE_SOURCE_DIR}/system)
|
|
|
|
|
|
|
|
set(SYSTEM_HEADERS_DIR)#Declared empty because it will be filled automaticaly afterwards
|
|
|
|
|
|
|
|
set(SYSTEM_LIBS)#Declared empty because it will be filled automaticaly afterwards
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
# INCLUDES ####################################################################################################
|
|
|
|
# INCLUDES ####################################################################################################
|
|
|
@ -80,9 +85,15 @@ include(${PROJECT_CONFIG_FILE})
|
|
|
|
# Here is the include fopr the awailable peripheral headers and standart libraries.
|
|
|
|
# Here is the include fopr the awailable peripheral headers and standart libraries.
|
|
|
|
include(${PERIPHERALS_DIR}/CMakeLists.txt)
|
|
|
|
include(${PERIPHERALS_DIR}/CMakeLists.txt)
|
|
|
|
|
|
|
|
|
|
|
|
# Here is the include fopr the awailable peripheral headers and standart libraries.
|
|
|
|
# Here is the include fopr the awailable drivers headers and standart libraries.
|
|
|
|
include(${DRIVERS_DIR}/CMakeLists.txt)
|
|
|
|
include(${DRIVERS_DIR}/CMakeLists.txt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Here is the include fopr the awailable libraries headers and standart libraries.
|
|
|
|
|
|
|
|
include(${LIBRARIES_DIR}/CMakeLists.txt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Here is the include fopr the awailable system headers and standart libraries.
|
|
|
|
|
|
|
|
include(${SYSTEM_DIR}/CMakeLists.txt)
|
|
|
|
|
|
|
|
|
|
|
|
# Include the config fiel where the compilers to use ar defined
|
|
|
|
# Include the config fiel where the compilers to use ar defined
|
|
|
|
include(${COMPILER_DEFS})
|
|
|
|
include(${COMPILER_DEFS})
|
|
|
|
|
|
|
|
|
|
|
@ -91,77 +102,56 @@ include(${COMPILER_DEFS})
|
|
|
|
include(${CSL_CONFIG_FILE})
|
|
|
|
include(${CSL_CONFIG_FILE})
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
# HEADERS : ALL Header Definitions and calls MSUT be made here to be able to propagate them through
|
|
|
|
# HEADERS : ALL Header Definitions and calls MUST be made here to be able to propagate them through
|
|
|
|
# all the modules
|
|
|
|
# all the modules
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
message("${BoldBlue}")
|
|
|
|
message("${BoldBlue}")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("Adding Header Directories")
|
|
|
|
message("Adding Header Directories")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("-->For Drivers")
|
|
|
|
message("|-->For Drivers")
|
|
|
|
createHeaderDirList("${DRIVERS_DIR}" "${DRIVERS_LIST}" "DRIVERS_HEADERS_DIR")
|
|
|
|
createHeaderDirList("${DRIVERS_DIR}" "${DRIVERS_LIST}" "DRIVERS_HEADERS_DIR")
|
|
|
|
message("-->For Peripherals")
|
|
|
|
message("${BoldBlue}|-->For Peripherals")
|
|
|
|
createHeaderDirList("${PERIPHERALS_DIR}" "${PERIPHERALS_LIST}" "PERIPHERALS_HEADERS_DIR")
|
|
|
|
createHeaderDirList("${PERIPHERALS_DIR}" "${PERIPHERALS_LIST}" "PERIPHERALS_HEADERS_DIR")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("${BoldBlue}|-->For Libraries")
|
|
|
|
|
|
|
|
createHeaderDirList("${LIBRARIES_DIR}" "${LIBRARIES_LIST}" "LIBRARIES_HEADERS_DIR")
|
|
|
|
|
|
|
|
message("${BoldBlue}|-->For Project")
|
|
|
|
|
|
|
|
checkDirectories("${PROJECT_HEADERS_DIR}")
|
|
|
|
|
|
|
|
message("${BoldBlue}|-->For System")
|
|
|
|
|
|
|
|
createHeaderDirList("${SYSTEM_DIR}" "${SYSTEM_LIST}" "SYSTEM_HEADERS_DIR")
|
|
|
|
|
|
|
|
message("${BoldBlue}+-------------------------------+${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
|
set (COMMON_HEADERS ${CSL_HEADERS_DIR}
|
|
|
|
set (COMMON_HEADERS ${CSL_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})
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
# Driver definitions
|
|
|
|
# Making Modules
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
message("Cheking Drivers ")
|
|
|
|
message("${BoldBlue}")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
foreach(X IN LISTS DRIVERS_LIST)
|
|
|
|
|
|
|
|
addDriver("${X}" "NEW_DRIVER")
|
|
|
|
|
|
|
|
list(APPEND DRIVER_LIBS ${NEW_DRIVER})
|
|
|
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
# Peripehral definitions
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
message("${BoldYellow}")
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("Cheking Periferals")
|
|
|
|
message("Making Submolues")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("|-->For Drivers")
|
|
|
|
|
|
|
|
makeSubmodules("${DRIVERS_DIR}" "${DRIVERS_LIST}" "DRIVER_LIBS")
|
|
|
|
|
|
|
|
message("${BoldBlue}|-->For Peripherals")
|
|
|
|
makeSubmodules("${PERIPHERALS_DIR}" "${PERIPHERALS_LIST}" "PERIPHERAL_LIBS")
|
|
|
|
makeSubmodules("${PERIPHERALS_DIR}" "${PERIPHERALS_LIST}" "PERIPHERAL_LIBS")
|
|
|
|
|
|
|
|
message("${BoldBlue}|-->For Libraries")
|
|
|
|
|
|
|
|
makeSubmodules("${LIBRARIES_DIR}" "${LIBRARIES_LIST}" "LIBRARIES_LIBS")
|
|
|
|
|
|
|
|
message("${BoldBlue}|-->For Project")
|
|
|
|
|
|
|
|
makeSubmodules("${PROJECT_DIR}" "${PROJECT_SOURCES_DIR_LIST}" "PROJECT_LIBS")
|
|
|
|
|
|
|
|
message("${BoldBlue}|-->For System")
|
|
|
|
|
|
|
|
makeSubmodules("${SYSTEM_DIR}" "${SYSTEM_LIST}" "SYSTEM_LIBS")
|
|
|
|
|
|
|
|
message("${BoldBlue}+-------------------------------+${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("${ColourReset}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
# User's project definitions
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
message("${BoldMagenta}")
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("Cheking User's Project")
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("Included Project Headers :")
|
|
|
|
|
|
|
|
checkDirectories("${PROJECT_HEADERS_DIR}")
|
|
|
|
|
|
|
|
message("Included Project Sources :")
|
|
|
|
|
|
|
|
checkDirectories("${PROJECT_SOURCES_DIR}")
|
|
|
|
|
|
|
|
message("Declared sources :")
|
|
|
|
|
|
|
|
printList("|-->" "${PROJECT_SOURCES_DIR_LIST}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message("Creating Libraries for declared sources :")
|
|
|
|
|
|
|
|
foreach(X IN LISTS PROJECT_SOURCES_DIR_LIST)
|
|
|
|
|
|
|
|
projectAddItem("${X}" "NEW_PROJECT_ITEM")
|
|
|
|
|
|
|
|
list(APPEND PROJECT_LIBS ${NEW_PROJECT_ITEM})
|
|
|
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message("+-------------------------------+")
|
|
|
|
|
|
|
|
message("${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 PROJECT_LIBS PERIPHERAL_LIBS DRIVER_LIBS)
|
|
|
|
foreach(X IN LISTS STARTUP_UCODE PROJECT_LIBS PERIPHERAL_LIBS DRIVER_LIBS LIBRARIES_LIBS SYSTEM_LIBS)
|
|
|
|
list(APPEND GENERATED_LIBRARIES ${X})
|
|
|
|
list(APPEND GENERATED_LIBRARIES ${X})
|
|
|
|
endforeach()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
@ -206,7 +196,7 @@ message("${ColourReset}")
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
# EXECUTABLE
|
|
|
|
# EXECUTABLE
|
|
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
|
|
add_executable(${EXECUTABLE} ${PROJECT_DIR}/main.c)
|
|
|
|
add_executable(${EXECUTABLE} ${PROJECT_DIR}/main.${PL})
|
|
|
|
target_compile_options(${EXECUTABLE} PRIVATE ${MAIN_FLAGS})
|
|
|
|
target_compile_options(${EXECUTABLE} PRIVATE ${MAIN_FLAGS})
|
|
|
|
target_compile_definitions(${EXECUTABLE} PRIVATE ${MAIN_DEFS})
|
|
|
|
target_compile_definitions(${EXECUTABLE} PRIVATE ${MAIN_DEFS})
|
|
|
|
target_include_directories(${EXECUTABLE} PUBLIC ${COMMON_HEADERS})
|
|
|
|
target_include_directories(${EXECUTABLE} PUBLIC ${COMMON_HEADERS})
|
|
|
|