Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,572 Views

nios2 eclipse-SBT source file management

I have a source tree from a version mangement system (SVN) with some code for a Nios2-system. 

 

I try to create a nios2-eclipse-project with some of these source files. The source tree also contains some folders which should not be part of my project, e.g.: 

 

/path-to-sources/ 

/files-which-should-be-included 

/files-which-should-NOT-be-included 

/subfolder/ 

/files-which-should-be-included 

/files-which-should-NOT-be-included 

[/INDENT] 

I want to keep the source-tree alive in my nios2-eclipse project, so that src files in my src-tree can refer to each other via relative paths. 

 

 

what I have tried so far: 

- use the nios2-app-update-makefile command with the --add-inc-dir and --add-src-dir options. effect: all the files get added to my project, but the raltive paths between the files are lost, all files are put into one "folder" and their relation to each other is lost. (also the files did not show up in eclipse, but when "executing" the makefiles they were part of the compilation process) 

- use the eclipse "File/import.../General/File System" tool. This adds all the files as needed to eclipse and keeps the source tree intact. BUT .h files are not part of the makefile (right-click and selecting "add to Nios2 build" did not add them. .c files could be excluded/added via this command, but .h files are ignored. during comilation, none of my .h files are found) 

 

any suggestions on how to solve this problem?
0 Kudos
4 Replies
Altera_Forum
Honored Contributor I
42 Views

some more background information: 

actually I can create an eclipse-project with all my required files via cmake. But cmake does not generate a project with the "Nios2-nature", so it's just a a C/C++ project without any Nios2 features, such as "run on nios2 hardware" or referring to a BSP project.  

turning the C/C++ project into a Nios2 project would solve my problem as well.
Altera_Forum
Honored Contributor I
42 Views

Your issue with the header files not being found during compilation should be solved, if you add the required paths (can be relative) to the "Application include directories" section of the project properties, i.e. right click on the project, select "Properties" and then "Nios II Application Properties->Nios II Application Paths" 

 

Hope that helps, 

Matthias
Altera_Forum
Honored Contributor I
42 Views

Matthias I have done precisely that which you suggest (add my include directory in ...Nios II Application Paths) and Apply and then OK. The rebuild still fails to locate my include folder & files - and upon return to the Nios II Application Paths - it is empty! 

 

:confused: 

 

Must be missing something right in front of my nose!
Altera_Forum
Honored Contributor I
42 Views

Hmm, that's quite odd. Paths should appear in the makefile. Is that file write protected by any chance? Make sure the makefile can be written to (e.g. check-out from the version control system if you're using one). 

 

If that's still not the source of the problem, try adding the include paths manually to the makefile. See example from my project: 

 

APP_INCLUDE_DIRS += ../inc_app_freertos 

APP_INCLUDE_DIRS += ../inc_common 

APP_LIBRARY_DIRS := 

APP_LIBRARY_NAMES := 

 

Hope that helps, 

Matthias
Reply