ARM Technical Support Knowledge Articles

Can I use existing makefiles with RVD?

Applies to: RealView Developer Kit (RVDK) for OKI, RealView Development Suite (RVDS)

Answer

Yes, RVD allows you to create a new project by 'importing' an existing makefile.

To create a new project using an existing makefile, select 'Project -> New project'. Enter a project name and base directory, and select 'Custom Project'. Finally click OK to open a 'Create Custom Project' dialog box.

Select 'Make a makefile (your own makefile)' as the type of custom project. This uses the default make command together with your makefile to build the image. Now enter the location and name of the makefile in the 'File Arg' field, and change the name of the executable to be built in the 'Executable' field, to match the image name in your makefile. Click OK to confirm the project details and close the dialog box.

Projects that are created this way differ from projects that are created entirely in RVD and further project configuration must be performed by manually editing the makefile outside RVD. Imported makefiles must contain the following build rules: 'clean', 'all', and 'rebuild'.

Below is an example makefile suitable for use with RVD:

clean:
# for Unix
# rm -f *.o *.axf
# for Windows
if exist *.o del *.o
if exist *.axf del *.axf
all: project1.axf
# for Unix
# echo Build completed
# for Windows
if exist *.axf echo Build completed
rebuild: clean all  
project1.axf: data.o io.o main.o
armlink data.o io.o main.o -o project1.axf
io.o: io.c
armcc -c io.c
data.o: data.c
armcc -c data.c
main.o: main.c
armcc -c main.c

There is a known issue that can be encountered when using certain build rules that issue commands to the shell.

For example, makefiles may contain a rule such as:

   all: dhry.axf
echo Build completed

The RVD make tool reports the error:

   make: Error -- echo: No such file or directory  

make is looking for the command "echo" on the search path and cannot find it as it is a shell command.

There are two workarounds available:

1) change the makefile to add a "+" before shell commands eg:

   all: dhry.axf
+echo Build completed

2) add the line:

   .USESHELL:  

to the 'startup.mk' file found in the 'etc' sub-directory of the RVD installation. This will force the make tool to always pass commands to the shell.

Article last edited on: 2008-09-09 15:47:32

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