5.9.1. Adding a custom build group

In this example, you add a new CUSTOM group to the project build model and then configure this group to display a message during the build. Custom groups can be created at different points in the settings hierarchy and easily disabled when not required.

There are two ways to configure a CUSTOM group, either:

This example creates a new CUSTOM group so that default settings are shown. Where you have not made any changes to the CUSTOM=default group for the project, this gives the same result.

To set up the new build group:

  1. Select Project → Project Properties... to display the Project Properties window.

  2. Right-click on a group in the List of Entries pane, the left pane.

    Where you click defines the location of the new group in the hierarchy, for example, right-click on the *COMPILE=arm group to see the new entry inserted below this group.

  3. Select Make New... from the context menu to display the Group Type/Name selector dialog box.

  4. Highlight CUSTOM in the Group Type display list.

  5. Type MY_GROUP in the Group Name field.

  6. Click OK to close the Group Type/Name selector dialog box.

    The contents of the new group are displayed in the Settings Values pane, the right pane, of the Project Properties window.

  7. Right-click on the Message setting, in the Settings Values pane, and select Edit Value from the context menu.

  8. Type Writing version to version file and then press Enter to confirm the value.

    This string is output every time you build or rebuild the application.

  9. Right-click on the Files setting, in the Settings Values pane, and select Edit Value from the context menu.

  10. Type version.txt and then press Enter to confirm the value.

  11. Right-click on the Depends_on setting, in the Settings Values pane, and select Edit Value from the context menu.

  12. Type $(MAKENAME) and then press Enter to confirm the value. Ensure that you do not include any spaces in the entry.

    This entry means that the output file is dependent on the makefile so you rebuild version.txt each time the makefile is updated. Usually, dependent files are inputs to a build but this example illustrates the method.

    Do not make the executable file, dhrystone.axf, the dependent because that does not work. Instead, you must use postlink commands as shown in Adding prelink and postlink commands.

  13. Right-click on the Command setting, in the Settings Values pane, and select Edit Value from the context menu.

  14. Type +echo ‘version = 1.00 >$@‘ and then press Enter to confirm the value.

    This command writes the message to the text file defined previously. You might use a command to run another program or to output the date.

    Preceding the command with a plus sign means that the command is a built-in operating system shell command. Do not put a plus sign in the command when running normal applications. If you do not want the command to be shown while it is running, put an at sign (@) in front of the command string.

    The Project Properties window looks like Figure 5.10.

    Figure 5.10. Customizing the build

    Customizing the build
  15. Select File → Save and Close to regenerate the makefile(s) for the project, and close the Project Properties window.

  16. Select Tools → Build... to rebuild the application.

  17. Click on the Build tab, if necessary, to see the build output.

In this example, you are sending the output file version.txt to the current working directory. Open the messages file in the File Editor pane and view the contents.

Copyright © 2005, 2006 ARM Limited. All rights reserved.ARM DUI 0291C
Non-Confidential