I am working on an embedded project with windriver compiler The obj file(crt0.o) has the starting point(contains “main”) as per compiler design. In my project, we have written our own assemlbly file(crt0.s). now i want to compile this into crt0.o and put it for linking. I tried the below way,
file(GLOB src_pbl ${BOOT_DIR}/pbl/src/.c
${BOOT_DIR}/pbl/src/crt0.s
${BOOT_DIR}/common/FlexCAN/.c)
add_executable(pbl ${src_pbl})
But it is not working. The crt0.s file is not getting compiled into crt0.o file. the linker took the crt0.o file from the default compiler path.
am I passing the .s file correctly to the target?
If you haven't already you need to
enable_language(ASM)
for your project, or one of the other assembly compilers ieASM_ATT
orASM_MASM
etc. This has to be done before theproject
function.Also don't use
file(GLOB)
, usetarget_sources
instead.I do it like this: