Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Sep 2004 12:14 PM by  mikee@logicpd.com
How to set $(CePlatform) in PB
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
hdacosta
New Member
New Member
Posts:


--
15 Sep 2004 08:39 AM
    Hi,

    I'm using Platform Builder 4.2. One of the preprocessor definitions is $(CePlatform). When I try to print out the value of $(CePlatform) by putting 'echo $(CePlatform)' as a post-build step, I get 'unknown'. Am I missing something that's supposed to set $(CePlatform) to a proper value I can use in the code?

    Henry
    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    15 Sep 2004 12:14 PM
    Hi and thanks for the post.

    So, if I'm understanding you right, you have an environment variable named "CePlatform" that you've created and you want to use it to do some sort of pre-processing within the code.

    To do this, checkout the sources file in the directory of the code you are building.

    Within a sources file, you can do something like the following:

    !if "$(CePlatform)" == "foo"
    CDEFINES=$(CDEFINES) -DFOO=1
    !endif


    That would basically be the equivalent of:

    #define FOO (1)


    Which you can then take advantage of in your code such as:

    #if ( 1 == FOO )
    /* compile something */
    #elif ( 2 == FOO )
    /* compile something else */
    #else
    #error "Error, foo isn't defined, please check the environment variable $(CePlatform)"



    If you want this to propagate to code stored in several directories, use a sources.cmn file such as the one found in: x:\WINCE420\PLATFORM\LoCE_A400_rel_100

    You can also search the Platform builder help for sources.cmn for more information on the syntax and usage of that particular file. Or, just look through all of the examples.

    As far as setting the environment variable, use project.bat or the project settings dialog box within Platform Builder.

    Best regards,
    --mikee
    You are not authorized to post a reply.