Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
manual:chapter1:buildfromsource [2019/11/19 15:32] jojo1973 Reformatted |
manual:chapter1:buildfromsource [2019/11/20 14:45] jojo1973 |
====== 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** |
| |
| |
===== Preparing a system for cross-compiling the firmware ===== | ==== Preparing a system for cross-compiling the firmware ==== |
| |
**Linux** | **Linux** |
| |
| |
===== Getting the source code ===== | ==== Getting the source code ==== |
| |
**Linux** | **Linux** and **freeBSD** |
| |
While at your user's home, open a terminal and run: | While at your user's home, open a terminal and run: |
''git clone https://git.code.sf.net/p/newrpl/sources newrpl-sources'' | ''git clone https://git.code.sf.net/p/newrpl/sources newrpl-sources'' |
| |
| ---- |
| |
| ==== Building the tools ==== |
| |
===== Building the tools ===== | === elf2rom === |
| |
==== elf2rom ==== | |
| |
The first tool that needs building is ''elf2rom''. | The first tool that needs building is ''elf2rom''. |
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 ==== | === bmp2font === |
| |
| - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources/tools/fonts/bmp2font''; |
| - select the ''bmp2font.pro'' project file; |
| - when prompted, just click on ''Configure project''; |
| - at the bottom-left of the screen, there will be an icon that looks like a screen and shows ''Debug'': change it to ''Release''; |
| - on the left toolbox, select the wrench ''Projects'' to access the build settings; |
| - 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''; |
| - 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. |
| |
| It's done: the ''bmp2font'' 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 === |
| |
- Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources''; | - Open //Qt Creator//, select ''Open Project'', and go into ''newrpl-sources''; |
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''; |
- 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. |
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 targets, follow 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> |
- 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; |
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 |
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]] and 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''; |
- select the ''newrpl-comp.pro'' project file; | - with the updated compiler in place, close all projects and [[buildfromsource#building-the-newrpl-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; |
- now from the top menu, ''Build'', ''Run QMake'', then ''Rebuild All''; | - finally, close all projects and [[buildfromsource#building-the-firmware|rebuild the firmware]]. |
- 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. | |
- finally, close all projects and open ''newrpl-fw.pro'' (or the equivalent for other hardware targets), and also ''Run QMake'' and ''Rebuild all''. | |