manual:chapter1:buildfromsource

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
manual:chapter1:buildfromsource [2019/11/19 15:32]
jojo1973 Reformatted
manual:chapter1:buildfromsource [2019/11/20 14:31]
jojo1973
Line 1: Line 1:
-====== Building newRPL from source code ======+===== Building newRPL from source code =====
  
- +==== Preparing a system for compiling the simulator ====
-===== Preparing a system for compiling the simulator =====+
  
 **Linux** **Linux**
Line 58: Line 57:
  
  
-===== Preparing a system for cross-compiling the firmware =====+==== Preparing a system for cross-compiling the firmware ====
  
 **Linux** **Linux**
Line 83: Line 82:
  
  
-===== Getting the source code =====+==== Getting the source code ====
  
 **Linux** **Linux**
Line 93: Line 92:
  
  
-===== Building the tools =====+==== Building the tools ====
  
-==== elf2rom ====+=== elf2rom ===
  
 The first tool that needs building is ''elf2rom''. The first tool that needs building is ''elf2rom''.
Line 110: Line 109:
 It's done: the ''elf2rom'' tool was built and installed in the appropriate location to be used by the other projects. Select ''Close all projects and editors'' from the main menu to end the session. It's done: the ''elf2rom'' tool was built and installed in the appropriate location to be used by the other projects. Select ''Close all projects and editors'' from the main menu to end the session.
  
-===newRPL standalone compiler ====+=== Building the newRPL standalone compiler ===
  
   - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources'';   - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources'';
Line 123: Line 122:
 It's done: the ''newrpl-comp'' tool was built and installed in the appropriate location to be used by the other projects. Select ''Close all projects and editors'' from the main menu to end the session. It's done: the ''newrpl-comp'' tool was built and installed in the appropriate location to be used by the other projects. Select ''Close all projects and editors'' from the main menu to end the session.
  
-===== Building the Desktop simulator =====+==== Building the newRPL desktop simulator ====
  
   - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources'';   - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources'';
Line 132: Line 131:
   - make sure ''Release'' is the selected configuration, then ''Add Build Step'' / ''Make'', and in the ''Make arguments:'' box type ''install'';   - make sure ''Release'' is the selected configuration, then ''Add Build Step'' / ''Make'', and in the ''Make arguments:'' box type ''install'';
   - now from the top menu, ''Build'', ''Run QMake'', then ''Rebuild All'';   - now from the top menu, ''Build'', ''Run QMake'', then ''Rebuild All'';
-  - from the bottom of the screen, check the ''Compile Output'' pane to see if everything went well. Quite often, the last step ''make install'' says there's nothing new to install when there's actually a newly built executable. Another round of ''Run QMake'' and ''Rebuild All'' usually shows in the output pane that the file is being copied to ''newrpl/tools-bin'' which is the expected result.+  - from the bottom of the screen, check the ''Compile Output'' pane to see if everything went well. Quite often, the last step ''make install'' says there's nothing new to install when there's actually a newly built executable. Another round of ''Run QMake'' and ''Rebuild All'' usually shows in the output pane that the file is being copied to ''newrpl-sources'' which is the expected result.
  
 It's done: the ''newrpl-ui'' tool was built and installed in the appropriate location to be used by the other projects. Select ''Close all projects and editors'' from the main menu to end the session. It's done: the ''newrpl-ui'' tool was built and installed in the appropriate location to be used by the other projects. Select ''Close all projects and editors'' from the main menu to end the session.
Line 138: Line 137:
 At the lower left area of the screen, use the upper //Play// button (Run without debugging) to start the application. At the lower left area of the screen, use the upper //Play// button (Run without debugging) to start the application.
  
-===== Building the firmware =====+==== Building the firmware ====
  
-  - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources'', then select the ''newrpl-fw.pro'' project file for the **50g** target. Other project files are available for the other targetsfollow exactly the same instructions for all targets;+  - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources'', then select the relevant project file: ''newrpl-fw.pro'' for the **50g** target, ''newrpl-fw39.pro'' for the **39g+ / 39gs** target''newrpl-fw40.pro'' for the **40gs** target;
   - when prompted, just click on ''Configure project'';   - when prompted, just click on ''Configure project'';
   - open a Terminal window and type<code>   - open a Terminal window and type<code>
Line 152: Line 151:
   - another possible alternative for 64-bit systems is to install the package<code>   - another possible alternative for 64-bit systems is to install the package<code>
 libc6-dev-i386 libc6-dev-i386
-</code> which in most cases should allow to keep the default directories. For //Ubuntu// it works with the defaults, for other systems change that to ''/usr/include/<newlib>'', so the line reads<code>+</code> which in most cases should allow to keep the default directories. For //Ubuntu// it works with the defaults, for other systems change that to ''/usr/include/newlib'', so the line reads<code>
 INCLUDEPATH += firmware/include newrpl /usr/include/newlib</code> INCLUDEPATH += firmware/include newrpl /usr/include/newlib</code>
   - save and close the file;   - save and close the file;
Line 160: Line 159:
 To verify that it completed the build, the last output line should read To verify that it completed the build, the last output line should read
  
-''Binary image written to "newrplfw.bin"''+''Binary image written to "newrplfw.bin"'' (for HP50g target) or\\ 
 +''Binary image written to "newrpl39.bin"'' (for HP39g+ / 39gs target) or\\ 
 +''Binary image written to "newrpl40.bin"'' (for HP40gs target)
  
-If you see that line, everything went well, and your build directory (usually named ''build-newrpl-fw-Desktop...'') will contain the ''newrplfw.bin'' file, which is the ROM that needs to be flashed on the calculator.+If you see that line, everything went well, and your build directory (usually named ''build-newrpl-fw-Desktop...'') will contain the firmware file, which is the ROM that needs to be flashed on the calculator.
  
-===== Updating the source tree to a new version =====+==== Updating the source tree to a new version ====
  
 When updates are made to the source tree When updates are made to the source tree
Line 171: Line 172:
 git pull git pull
 </code>This will update the source code to the lastest version; </code>This will update the source code to the lastest version;
-  - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources''; +  - [[buildfromsource#newrpl-standalone-compiler|build the standalone compiler]];
-  select the ''newrpl-comp.pro'' project file; +
-  - now from the top menu, ''Build'', ''Run QMake'', then ''Rebuild All'';+
   - check the compile output to make sure the new version was copied to ''newrpl/tools-bin'', if not then repeat the steps ''Run QMake'' and ''Rebuild all''.   - check the compile output to make sure the new version was copied to ''newrpl/tools-bin'', if not then repeat the steps ''Run QMake'' and ''Rebuild all''.
-  - with the updated compiler in place, close all projects, open ''newrpl-ui.pro'' and do ''Run QMake'' then ''Rebuild all''. The ''Run QMake'' step is not optional, needs to be manually executed to make sure the build number is updated, otherwise the ''[[manual:chapter6:system:cmd_version|VERSION]]'' command will report the incorrect build number. +  - with the updated compiler in place, close all projects and [[buildfromsource#building-the-desktop-simulator|rebuild the desktop simulator]]. The ''Run QMake'' step is not optional, it needs to be manually executed to make sure the build number is updated, otherwise the ''[[manual:chapter6:system:cmd_version|VERSION]]'' command will report the incorrect build number. 
-  - finally, close all projects and open ''newrpl-fw.pro'' (or the equivalent for other hardware targets), and also ''Run QMake'' and ''Rebuild all''. +  - finally, close all projects and [[buildfromsource#building-the-firmware|rebuild the firmware]].
  • manual/chapter1/buildfromsource.txt
  • Last modified: 2019/11/20 14:45
  • by jojo1973