| |||
| Home > Working with Projects > Adding files to a user-defined project > Adding files using the Project menu | |||
With a project open, you can add source files to the project and so update the project properties automatically:
Choose the menu option according to the location of the file you want to add:
Select Project → Add This File to Project to add the file currently displayed in the File Editor pane to the list of sources specified for the project.
Select Project → Add Files to Project... to display the Select File(s) to Add dialog box where one or more files can be located and added to the project.
The relative pathname of the file is added to the Sources group
in the top-level COMPILE or ASSEMBLE group.
If this is the first update to the Sources group,
an asterisk is appended to the beginning of the group name.
The Project Properties window is not displayed, but you can view the change by opening the window as described in Project properties.
If your project has more than one COMPILE or ASSEMBLE group
enabled, a list selection box is displayed that lists the groups
for the type of file being added:
for
files with extension .c, .cpp, .cc,
or .cxx, the list shows enabled COMPILE groups
for files with extension .s, .src,
or .asm, the list shows enabled ASSEMBLE groups.
Figure 2.3 shows
example COMPILE groups for a dhrystone project.
Choose the required group, for example COMPILE=arm and,
then click OK to close the dialog box.
The Build tab shows the makefile being regenerated.
When the makefile has been regenerated, select Tools → Build..., to rebuild the image.
If you select files of different types, for example, *.c and *.s files,
then RealView Debugger adds the files to the appropriate group, even if
that group is disabled. In this example, the *.c files
are added to the COMPILE=arm group, and the *.s files
are added to the ASSEMBLE=arm group.