- cd /bin
- mv make.exe make-3.81.exe
- cp make-4.1.exe make.exe
The command "make -v" should now print a text containing "GNU Make 4.1".
If you based your project Makefile on a TouchGFX makefile from TouchGFX 4.3.0 or later, your Makefile should work with make version 3.81 as well as make version 4.1. If you based your Makefile on an earlier version of TouchGFX, you need to update it by going through the appropriate Makefile in the latest release of TouchGFX and applying the changes to your own Makefile.
With the new make version 4.1 in place, you can start parallel build simply by adding "-j N" where N is the number of simultaneous compilations to invoke. Setting N to the number of cores on your PC is a good number. On a Windows system you can find the number of cores by starting the Task Manager and on the "Performance" tab look for "Logical processors".
Now you can start a quick compilation by writing:
- make -f simulator/gcc/Makefile -j8 clean all
- no "-j N": 180 seconds
- "-j2": 94 seconds
- "-j4": 63 seconds
- "-j8": 60 seconds
So there is a significant gain, especially on larger projects, from switching to make version 4.1 and compiling in parallel.
- documentation of the final application
- check screen layout
- compare with screenshots during development
Printing using printf() and std::cout
As of TouchGFX version 4.8.0, simulator programs on the Windows platform are no longer console applications but windows applications. This means that it is not possible to write debug output using printf() or std::cout (nor is it possible to read text input using fgets or std::cin).
To solve this, simply use the function touchgfx_printf() which has the same syntax as printf() with a few benefits. This function is available by including Utils.h
- It automatically creates a console window and the prints the output. The console window is not opened until the first touchgfx_printf() is encountered.
- When compiling the application for a target, touchgfx_printf() does nothing, and thus it does not have to be inside #ifdef SIMULATOR / #endif tags. Also, #include <stdio.h> can be removed.
If you already have an application that uses printf() or std::cout in several places, it is possible to create a console window from main.cpp by simply calling touchgfx_enable_stdio(). This function is also completely removed from target code.
Please note that unlinke printf(), touchgfx_printf() does not return the number of characters written.