none
how to structure my sources file for WinCE RRS feed

  • Question

  • Hello Gentlemen,

    I'm a beginner on WinCE. I have a question about "sources".

    I'm trying to build a dll that depends on several libs (.lib) in my sources I have the following:

    TARGETLIBS= \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Storeapi.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Ceshell.lib \
        $(_WINCEROOT)\others\wcetk\tux\lib\$(_TGTCPU)\RETAIL\kato.lib \
        
    ARM_SOURCES= \
        arm\CFaultIndicator.cpp \
        arm\swtst.cpp \

    X86_SOURCES= \
        x86\faultindicator.cpp \
        x86\swtst.cpp \
        

    How can I tell builder to use a specific set of libs for ARM and a specific set of libs for x86 which aren't common?

    I'm looking for something like:

    TARGETLIBS_ARM =

    TARGETLIBS_x86 = 

    Thanks very much for your time and patience.

    GM

    Monday, February 3, 2014 3:19 PM

Answers

  • Of course, based on your existing SOURCES file - you do not have different LIB files.   So what is the problem that you are trying to solve?   It looks like you might need to have different INCLUDES for different _TGTCPU.

    The easiest solution for the INCLUDES would be to create similar folders under x86 and use $(_TGTCPU) in the path.   Another solution would be to move the header files to a more common folder, like $(_TARGETPLATROOT)\src\inc.   In either solution, you will then be able, and must, remove the IF/ELSE.

    But, if you insist on making this difficult, then replace your IF/ELSE with:

    TARGETLIBS= \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Storeapi.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Ceshell.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Oleaut32.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\ole32.lib \
        $(_TARGETPLATROOT)\SRC\TESTS\COMMON\LIBS\kato\$(_WINCEOSVER)\$(_TGTCPUFAMILY)\kato.lib \

    INCLUDES= \
        $(INCLUDES); \
        $(_WINCEROOT)\public\common\sdk\inc; \
        $(_WINCEROOT)\PUBLIC\OSTEST\SDK\INC; \
        $(_WINCEROOT)\public\common\sdk\inc; \
        $(_TARGETPLATROOT)\src\inc\atl; \
        $(_TARGETPLATROOT)\src\tests\inc; \

    !INCLUDE sources.$(_TGTCPU)

    -----------------------

    Then in your newly created sources.ARM:

    INCLUDES= \
        $(INCLUDES); \
        $(_TARGETPLATROOT)\SRC\bootloader\BBC\ARM\INC; \
        $(_TARGETPLATROOT)\SRC\bootloader\BBC\COMMON\INC; \
        $(_TARGETPLATROOT)\SRC\TESTS\FILESYS\FUP\FUPTST\builddll\$(_TGTCPUFAMILY); \

    -------------------------

    Then in your newly created sources.x86, all you need is a blank file.




    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com



    • Edited by Bruce EitmanModerator Thursday, February 6, 2014 2:27 PM sarcastic remark removed
    • Marked as answer by Gil Motta Thursday, February 6, 2014 9:08 PM
    Thursday, February 6, 2014 2:24 PM
    Moderator

All replies

  • There isn't really a good way to do that from within a single file, but with include files....

    !INCLUDE sources.$(_TGTCPU)

    Now you can have souces.x86 and sources.ARM.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com


    Monday, February 3, 2014 9:31 PM
    Moderator
  • Hello Bruce,

    Thanks for your reply. I'm not sure I understood your answer let's see:

    you propose that in the top folder (the one that contains arm & x86) there is a sources file in there then I should edit it and replace

    TARGETLIBS= \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Storeapi.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Ceshell.lib \

    with 

    !INCLUDE sources.$(_TGTCPU)

    Then inside arm folder I will have a sources file that contains TARGETLIBS and inside of x86 another sources file that contains TARGETLIBS also.

    if this is what what you proposed I think it makes sense. Please confirm.

    Thank you.

    Gil


    Thanks much, -GM

    Tuesday, February 4, 2014 3:35 PM
  • Well no, that doesn't make any sense does it?  I believe that your question had to do with LIB files that have different names based on the CPU.  So none of those meet the criteria.  Instead within the sources.$(_TGTCPU) file you would want to extend TARGETLIBS, something like:

        TARGETLIBS=$(TARGETLIBS) SomePath\MYLIBwithACPUspecificNAME.LIB

    Also, I did not go into details on your use of folders, or show the use of folders, so that is up to you.  Discussing them only complicates your question, and would complicate my answer.

    Like I suggest often, try it. Often it takes less time to try it than to ask for clarification.

    NOTE:  Your question does totally ignore the _CPUINDPATH part of the lib folder paths.   That handles the SAME lib file names by putting them in CPU specific folders.   See how much simpler it is to do that?


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com

    Tuesday, February 4, 2014 6:09 PM
    Moderator
  • Well no, that doesn't make any sense does it?  I believe that your question had to do with LIB files that have different names based on the CPU.  So none of those meet the criteria.  Instead within the sources.$(_TGTCPU) file you would want to extend TARGETLIBS, something like:

        TARGETLIBS=$(TARGETLIBS) SomePath\MYLIBwithACPUspecificNAME.LIB

    Also, I did not go into details on your use of folders, or show the use of folders, so that is up to you.  Discussing them only complicates your question, and would complicate my answer.

    Like I suggest often, try it. Often it takes less time to try it than to ask for clarification.

    I don't follow your answer or you did not understand my question. I don't have two sources files like you suggested sources.$(_TGTCPU) i.e. one for ARM and one for x86.


    Yes, I do have different lib names for ARM and x86. it was not my choice.

    I only have one source file. here it is:

    TARGETNAME=FOO
    TARGETTYPE=DYNLINK
    #DLLENTRY=_DllMainCRTStartup

    !IF "$(_TGTCPUFAMILY)"=="ARM"
    TARGETLIBS= \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
        $(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\ceddk.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Storeapi.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Ceshell.lib \
        $(_TARGETPLATROOT)\SRC\TESTS\COMMON\LIBS\kato\$(_WINCEOSVER)\$(_TGTCPUFAMILY)\kato.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Ole32.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\oleaut32.lib \

    INCLUDES= \
        $(INCLUDES); \
        $(_WINCEROOT)\public\common\sdk\inc; \
        $(_WINCEROOT)\PUBLIC\OSTEST\SDK\INC; \
        $(_WINCEROOT)\public\common\sdk\inc; \
        $(_TARGETPLATROOT)\src\inc\atl; \
        $(_TARGETPLATROOT)\src\tests\inc; \
        $(_TARGETPLATROOT)\SRC\bootloader\BBC\ARM\INC; \
        $(_TARGETPLATROOT)\SRC\bootloader\BBC\COMMON\INC; \
        $(_TARGETPLATROOT)\SRC\TESTS\FILESYS\FUP\FUPTST\builddll\$(_TGTCPUFAMILY); \

    !ELSEIF "$(_TGTCPUFAMILY)"=="x86"
    TARGETLIBS= \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Storeapi.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Ceshell.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Oleaut32.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\ole32.lib \
        $(_TARGETPLATROOT)\SRC\TESTS\COMMON\LIBS\kato\$(_WINCEOSVER)\$(_TGTCPUFAMILY)\kato.lib \

    INCLUDES= \
        $(INCLUDES); \
        $(_WINCEROOT)\public\common\sdk\inc; \
        $(_WINCEROOT)\PUBLIC\OSTEST\SDK\INC; \
        $(_WINCEROOT)\public\common\sdk\inc; \
        $(_TARGETPLATROOT)\src\inc\atl; \
        $(_TARGETPLATROOT)\src\tests\inc; \

    !ENDIF

    _ISVINCPATH=$(_WINCEROOT)\public\common\sdk\inc;$(_WINCEROOT)\public\common\oak\inc;$(_PUBLICROOT)\COMMON\DDK\INC
    _OEMINCPATH=$(_WINCEROOT)\public\common\sdk\inc;$(_WINCEROOT)\public\common\oak\inc;$(_PUBLICROOT)\COMMON\DDK\INC

    CDEFINES=$(CDEFINES) /EHsc

    ARM_SOURCES= \
        arm\CFaultIndicator.cpp \
        arm\swtst.cpp \

    X86_SOURCES= \
        x86\faultindicator.cpp \
        x86\swtst.cpp \

    SOURCES= \
        tstfsd.cpp \
        integrity.cpp \
        tstbinfs.cpp \
        tstmain.cpp \
        tststg.cpp \

    FILE_VIEW_INCLUDES_FOLDER= \
        tstfsd.h \
        diskusage.h \
        fxformat.h \
        integrity.h \
        tststoragedevice.h \
        tstbinfs.h \
        tstmain.h \
        tststg.h \
        swtst.h \
        FaultIndicator.h \

    FILE_VIEW_RESOURCE_FOLDER= \
        fsdtst2.def \

    FILE_VIEW_PARAMETER_FOLDER= \

    ======================================================================

    However I'm getting a lot of warnings during the Builder.exe pre-scan.

    I would need to see an example of what you are trying to explain.


    Thanks much, -GM



    • Edited by Gil Motta Wednesday, February 5, 2014 11:06 PM
    Wednesday, February 5, 2014 11:04 PM
  • Of course, based on your existing SOURCES file - you do not have different LIB files.   So what is the problem that you are trying to solve?   It looks like you might need to have different INCLUDES for different _TGTCPU.

    The easiest solution for the INCLUDES would be to create similar folders under x86 and use $(_TGTCPU) in the path.   Another solution would be to move the header files to a more common folder, like $(_TARGETPLATROOT)\src\inc.   In either solution, you will then be able, and must, remove the IF/ELSE.

    But, if you insist on making this difficult, then replace your IF/ELSE with:

    TARGETLIBS= \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Storeapi.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Ceshell.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\Oleaut32.lib \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\ole32.lib \
        $(_TARGETPLATROOT)\SRC\TESTS\COMMON\LIBS\kato\$(_WINCEOSVER)\$(_TGTCPUFAMILY)\kato.lib \

    INCLUDES= \
        $(INCLUDES); \
        $(_WINCEROOT)\public\common\sdk\inc; \
        $(_WINCEROOT)\PUBLIC\OSTEST\SDK\INC; \
        $(_WINCEROOT)\public\common\sdk\inc; \
        $(_TARGETPLATROOT)\src\inc\atl; \
        $(_TARGETPLATROOT)\src\tests\inc; \

    !INCLUDE sources.$(_TGTCPU)

    -----------------------

    Then in your newly created sources.ARM:

    INCLUDES= \
        $(INCLUDES); \
        $(_TARGETPLATROOT)\SRC\bootloader\BBC\ARM\INC; \
        $(_TARGETPLATROOT)\SRC\bootloader\BBC\COMMON\INC; \
        $(_TARGETPLATROOT)\SRC\TESTS\FILESYS\FUP\FUPTST\builddll\$(_TGTCPUFAMILY); \

    -------------------------

    Then in your newly created sources.x86, all you need is a blank file.




    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com



    • Edited by Bruce EitmanModerator Thursday, February 6, 2014 2:27 PM sarcastic remark removed
    • Marked as answer by Gil Motta Thursday, February 6, 2014 9:08 PM
    Thursday, February 6, 2014 2:24 PM
    Moderator
  • Thanks Bruce very helpful and I learned from your example. My boss and I did not know we could do !INCLUDE sources.$(_TGTCPU) that's fantastic!

    I think I have direction to follow with your input.

    Again thanks much,

    Gil


    Thanks much, -GM

    Thursday, February 6, 2014 9:11 PM