Question
I have moved a CrossCore Embedded Studio project to another directory, and it no longer builds. There appears to be a number of resources that it cannot locate, generating the error:
make: *** No rule to make target `filename.c', needed by `an_object.doj'. Stop.
What do I need to change to build the project?
====================================
Answer
When you encounter the ‘No Rule to Make Target’ error, it indicates that the makefile has a reference to a build file that cannot be located by gmake. Typically a project will use a number of relative paths in its configuration that may become invalid once the project has been moved. These will need to be corrected.
The first thing to check in CCES is whether the project uses any Linked Files. These are files that do not exist within the directory structure of the project, and are instead linked into the project from relative paths. Expanding the Project in the Project Explorer window will show an exclamation mark over any Linked Files that cannot be located. To correct the path for these files, you will need to right-click on each one and select “Properties”. Then, under the ‘Resource’ tab, click the “edit” to the right of the ‘Location’ details and correct the path to the Linked File by providing either a corrected relative path, or an absolute path.
Once all of these are resolved, if you are still encountering ‘No rule to make target’ errors, you need to check the Project Preferences for any linked files. Go to ‘Project: Properties: C/C++ Build: Settings: CrossCore Linker: General’, and correct any “Library search directories” for the project’s new location.
If the project still fails to build, the next settings to check are the ‘Additional Include Directories’ for the Assembler, Compiler and Linker. Under ‘Project: Properties: C/C++ Build: Settings’, check the ‘Preprocessor’ tab for each of these three tools and correct any Additional Include Directories for the new project location.
Finally, ensure that any referenced paths in any ‘Additional Options’ for the Compiler, Linker and Assembler are corrected for the new project location.
If your project is set to build a Loader File artifact, you will also have to check that the path to the Initialization File - if a relative path - is correct for the project’s new location, and ensure that any paths in the ‘Additional Options’ for the Loader are corrected for the new project location.
This should correct most build errors, however you may still encounter problems where your code references files using relative paths that are not valid for the new project location. For example, if you use relative paths in #include or .import commands these may no longer be valid.