Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12746 Discussions

How to generate different ELF files at once in IDE

Altera_Forum
Honored Contributor II
1,231 Views

Hello, 

 

I have two projects (for our customers) which have the same Nios II IDE project as a source code basis. These two projects are mainly the same, only a few# define values are different when I build the IDE project. 

 

How can I build both projects from my IDE project at once and automatically? I would like to have two ELF files output by the IDE, with different names or in different folders for each customer project. 

 

I hope there is a way to do this.  

 

If the IDE does not offer such flexibility, how can I create easily (if not automatically) a makefile or similar to generate the two versions by DOS command line?
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
522 Views

I see two possibilities in this case: 

 

- (DOS-based) if you are using a simple HAL project, just create two configurations from the properties of the project; that will generate a makefile in two separate directories (call them Product1 and Product2 instead of Debug/Release). Then, just write a batch file to call make -s on the 2 directories form the command line. You can differentiate among the two products using a -D option passed to the gcc. 

 

- (Eclipse based) If you want to remain eclipse based to also control the generation of the makefiles, you can use an ANT script to prepare a little sequence of actions to be performed that are typically a mimic of the commands that can be issued from the IDE. (ANT also works from the command line). That is for example the typical thing we do when I want to generate and compile different application configurations from an OIL configuration file when using ERIKA Enterprise. However, I do not know if the Altera support ANT scripting... 

 

bye 

 

Paolo
0 Kudos
Altera_Forum
Honored Contributor II
522 Views

Hi Paolo! 

 

Thank you very much for your answer, I decided to implement the DOS batchfile. After various problems finding the right PATH settings, it finally worked out for me.  

 

For everyone who is interested in the paths: 

 

I got the "make" command from 

%QUARTUS_ROOTDIR%\bin\cygwin\bin\make 

 

...and called it with the "-s all" or "-s rebuild" options. 

 

To work correclty, at least the following three directories have to be in the search-path: 

 

%QUARTUS_ROOTDIR%\bin\cygwin\bin 

%SOPC_KIT_NIOS2%\bin\nios2-gnutools\H-i686-pc-cygwin\bin 

%SOPC_KIT_NIOS2%\bin
0 Kudos
Reply