Building the whole Haiku system from source is well documented on the official Haiku website.
What about compiling or recompiling only one application in the system?
Let's review how to do so in this article.
We will suppose in this article, you have already followed the article named "Compile Haiku".
And you should have the below structure in the "haiku" folder where the sources of the system are :
Now, suppose you would like to compile only one of the app available in the system.
It can be a system app among the list below (in "src/apps") :
Or it can be a preferences app among the list below (in "src/preferences") :
Let's build - for instance - the clock app.
For that go into the "generated.x86_64" folder and launch the compilation of "Clock" :
cd generated.x86_64
jam -q Clock
As you can see below, nothing really interesting is happening :
Why you will ask ?
The reason is as the sources of the "Clock" application have not been changed, then there's no need to rebuild the application.
In a real world situation, it would not be the case because you are supposed to change the sources files of the Clock application :)
To force that behavior, type :
touch ../src/app/clock/*.cpp
jam -q Clock
Great !
As you can see the "Clock" application has been rebuilt in the "objects/haiku/x86_64/release/apps/clock/" folder.
Let's execute it :
objects/haiku/x86_64/release/apps/clock/Clock
Yes, you made it :)
If you have read the "Develop with Genio" article, you should know that this tool is a must have when you want to make some applications under Haiku.
Let's compile "Clock" under Genio. Open the Genio application :
Select the "Project" menu and "Open project" :
Select in the "src/apps" the "clock" folder and validate with "Open" :
You should have the below sources visible :
Now let's configure the way to build "Clock". In the "Project" menu, select "Project settings" :
Then indicate the below :
Note : I'm not sure about the "Clean Command", so if you find something more appropriate don't hesitate to put a comment on this article.
Now let's build the project : Be sure you have modified the source code, else you need to apply the "touch command" on the sources as already indicated.
The build logs are the same than when building the application via the Jam command :
Let's verify the launch of the application.
Click on the green arrow :
Yes it's working fine !
I hope you have found this article useful to help compiling your first application from Haiku sources.