Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
manual:chapter1:buildfromsource [2019/11/20 14:16] jojo1973 [Building the firmware] |
manual:chapter1:buildfromsource [2019/11/20 14:45] (current) jojo1973 |
==== 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 ==== |
| |
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. |
| |
| === 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 === | === newRPL standalone compiler === |
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''; |
==== Building the firmware ==== | ==== Building the firmware ==== |
| |
- 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; | - 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; |
| |
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. | 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 ==== |
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''. | |