some chibios experiments

This commit is contained in:
Jack Humbert
2023-04-05 18:27:47 -04:00
parent a1cb005981
commit cc22d67b32
22 changed files with 299 additions and 211 deletions
+9 -4
View File
@@ -12,14 +12,19 @@ function(ParseMakefile MKFile)
endfunction()
macro(_ParseMakefile MKFile)
message(STATUS "Parsing ${MKFile}")
file(READ "${MKFile}" FileContents)
string(REPLACE "\\\n" "" FileContents ${FileContents})
string(REPLACE "\n" ";" FileLines ${FileContents})
string(REGEX REPLACE "\\\\\r?\n *" " " FileContents ${FileContents})
string(REGEX REPLACE "\r?\n" ";" FileLines ${FileContents})
list(REMOVE_ITEM FileLines "")
foreach(line ${FileLines})
# if(line MATCHES "$\\((.+)\\)")
# string(REPLACE "(${CMAKE_MATCH_1})" "{${CMAKE_MATCH_1}}" line ${line})
# if(line MATCHES "\\$\\((.+)\\)")
# set(MAKE_VARIABLE "${CMAKE_MATCH_1}")
# string(REPLACE "$(${MAKE_VARIABLE})" "${${MAKE_VARIABLE}}" line ${line})
# endif()
# message(STATUS "From: ${line}")
string(REGEX REPLACE "\\$\\(([^\\(\\)]+)\\)" "${CHIBIOS}" line ${line})
# message(STATUS "To : ${line}")
# if(line MATCHES "^include (.+)$")
# set(MAKE_CHILD ${CMAKE_MATCH_1})
# message(STATUS "Reading ${MAKE_CHILD}")