| |||
| Home > Customizing Projects > Working with source files > Adding source files to a project | |||
To add source files to an existing project:
Select Project → Project Properties... to display the Project Properties window.
Right-click on the required group, in the List of
Entries pane, the left pane, that defines the build stage that you
want to modify, for example *COMPILE=arm, and select Expand
whole Tree from the context menu.
You can also expand, and collapse, groups in the List of Entries pane by clicking on the plus sign, or the minus sign, at each node in the tree. If you double-click on the group name, this expands the group and displays the contents in the Settings Values pane.
Select the *Sources group in
the List of Entries pane to display the contents.
Right-click on the default Files setting,
at the top of the list, and select Edit as Filename from
the context menu.
This displays the Enter New Filename dialog box where you can locate source files to add to the project. Select the source file you want to add and click Save.
Alternatively, right-click on the default Files setting,
at the top of the list, and select Manage List... from
the context menu. Use the Settings: List Manager dialog box to modify
the source list as required. You can also use this dialog box to
add more files to, or to remove files from, the group. Click OK when
you have finished adding files using the Settings: List Manager
dialog box.
Select File → Save and Close to regenerate the makefile(s) for the project, and close the Project Properties window.
Select Tools → Build... to rebuild the application.
You can also use this method to add files to other groups,
for example other COMPILE groups, ASSEMBLE groups,
or the BUILD group.
Before adding files to the active project in this way, you must wait for any build process to complete and the results to be visible in the Output pane.
You do not have to add .h files to a project,
because these are referenced from the main source files for your
project. See Specifying paths to include files.