From rules.vxWorks:

partialImage.o: $(PRJ_OBJS) version.o ....
    $(LD_PARTIAL) $(PRJ_OBJS) .... -o ${@}

vxWorks: partialImage.o  ..... 
    $(LD) $(LFFLAGS) $(PRJ_OBJS) \
       -defsym _VX_DATA_ALIGN=16 \
       -T link.RAM \
       -o ${@}

In one of my projects I separated the partialImage and vxWorks to separate dir levels, as I wanted to add few more things to the partailImage.o.

So my question is, in the vxWorks target, can i just specify the partialImage.o instead of PRJ_OBJS?

Why not the existing vxWorks rules doesn't do it that way?

1

There are 1 best solutions below

0
On

I tested this. We can either use partialImage.o or PRJ_OBJS.

In my case using partialImage.o was helpful. Because I separated the targets partialImage.o and vxworks to different make levels. (partialImage.o in lower level).

So while generating the partialImag.o, I can add more object files(like dataSegPad.o, usrEntry.o, version.o etc) apart from the PRJ_OBJS.

And later use this partialImage.o on higher level make to generate vxworks image.o. This avoids explicitly adding the files (dataSegPad.o, usrEntry.o, version.o) to the vxworks target (as they are already included in the partialImage.

PS: Be mindful partialImage.o is a relocatable file, so don't include files like ctdt.o, symTbl.o as they have to be included only when generating an executable