ARM Technical Support Knowledge Articles

MULTIPLE PROGRAMS FROM 1 SOURCE FILE SET

Applies to: uVision IDE

Answer


Information in this article applies to:


QUESTION

I need to create 2 programs from the same set of source files. I know that µVision supports multiple targets, but I am not sure if I can solve the following requirements with that?

ANSWER

Yes, the µVision targets allow you to solve these problems. First you need to create a target as described below:

  1. Create a µVision project.
  2. Rename Target 1 (in the Project Window or by using the dialog Project - Components, Environment and Books) to the name of the first program you want to create.
  3. Add all of your source files to this target. If you have a group of files that will be excluded from the second program, create a new group for them in the dialog Project - Components, Environment and Books.
  4. In the dialog Project - Components, Environment and Books add a new target for the second program.

Now you may switch between the targets by using the selection line in the Build toolbar.

To exclude source files from a target:

  1. Right click on the file or group that you want to exclude from the second program and use the Options for ... from the context menu to open the Options - Properties dialog.
  2. Uncheck Include in Target Build to exclude a source file from a target. You may apply this on a single file or on a file group.

To use conditional compiling with a target:

  1. Open the dialog Project - Options for Target.
  2. In the Compiler page you may enter pre-processor symbols under Define. These symbols are tested using #if, #ifdef, and #ifndef preprocessor directives in the source files.
  3. In the Assembler page you may enter Set symbols that are used in $IF and $ELSEIF directives to control conditional assembly sections.
  4. Again, you may apply these symbol settings even on a single file or on a file group when you right click on the file or group that use the Options for ... dialog from the context menu.

SEE ALSO

Article last edited on: 2005-09-02 03:22:16

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential