File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323# You should have received a copy of the GNU General Public License
2424# along with this program; if not, see <http://www.gnu.org/licenses/>
2525
26- # Function to link the Miosix libraries to a target and register the build command
26+ # Function to create a Miosix process
27+ #
28+ # miosix_add_process(<target> <source1> <source2> ...)
29+ #
30+ # What is does:
31+ # - Create an executable target with the given sources
32+ # - Link the libraries required by processes
33+ # - Tell the linker to produce a map file
34+ # - Run strip and mx-postlinker on the executable
2735function (miosix_add_process TARGET SOURCES )
2836 # Define the executable with its sources
2937 add_executable (${TARGET} ${SOURCES} )
Original file line number Diff line number Diff line change @@ -32,6 +32,20 @@ ExternalProject_Add(buildromfs
3232 INSTALL_COMMAND "" # Skip install
3333)
3434
35+ # Create a target that builds the romfs image and combines it the kernel into a single binary image
36+ #
37+ # miosix_add_romfs_image(
38+ # IMAGE_NAME <name>
39+ # KERNEL <kernel>
40+ # DIR_NAME <dir_name>
41+ # PROCESSES <process1> <process2> ...
42+ # )
43+ #
44+ # What it does:
45+ # - Copies all processes binaries to a single directory named <dir_name>
46+ # - Creates a romfs image with of the directory <dir_name>
47+ # - Combines the kernel and the romfs image into a single binary image
48+ # - Registers a custom target (named <dir_name>) with to run the above steps
3549function (miosix_add_romfs_image )
3650 cmake_parse_arguments (ROMFS "" "IMAGE_NAME;KERNEL;DIR_NAME" "PROCESSES" ${ARGN} )
3751
Original file line number Diff line number Diff line change 2323# You should have received a copy of the GNU General Public License
2424# along with this program; if not, see <http://www.gnu.org/licenses/>
2525
26+ # Copies processes binaries into a single directory
27+ #
28+ # miosix_create_processes_dir(
29+ # DIR_NAME <dir_name>
30+ # PROCESSES <process1> <process2> ...
31+ # )
32+ #
33+ # This function addresses two use cases:
34+ # - When you need to build a romfs image, you need all processes into a single directory
35+ # - If you want to load processes on to an SD card for example, is useful to have all processes grouped togheter
2636function (miosix_create_processes_dir )
2737 cmake_parse_arguments (PROCS "" "DIR_NAME" "PROCESSES" ${ARGN} )
2838
Original file line number Diff line number Diff line change @@ -40,6 +40,14 @@ function(miosix_add_program_target TARGET)
4040endfunction ()
4141
4242# Function to link the Miosix libraries to a target and register the build command
43+ #
44+ # miosix_link_target(<target>)
45+ #
46+ # What it does:
47+ # - Links the Miosix libraries to the target
48+ # - Tells the linker to generate the map file
49+ # - Registers custom targets to create the hex and bin files (${TARGET}_bin and ${TARGET}_hex)
50+ # - Registers a custom target to flash the program to the board (${TARGET}_program)
4351function (miosix_link_target TARGET )
4452 if (NOT TARGET miosix)
4553 message (FATAL_ERROR "The board you selected is not supported" )
You can’t perform that action at this time.
0 commit comments