<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://baszerr.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>BaSzErr - prjs:build_process</title>
        <description></description>
        <link>https://baszerr.eu/</link>
        <lastBuildDate>Sat, 02 May 2026 13:13:44 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://baszerr.eu/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>BaSzErr</title>
            <link>https://baszerr.eu/</link>
        </image>
        <item>
            <title>build_process</title>
            <link>https://baszerr.eu/doku.php?id=prjs:build_process:build_process</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;build_process&quot;&gt;build process&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
usually when starting new project it uses either IDE build-in &amp;#039;project&amp;#039; that tells compiler how to make it, either uses fast written makefiles to make it flexible or autoconf and automake for generating makefiles for us.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;build process&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;build_process&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-251&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;why_build_process&quot;&gt;why build process?&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
although all mentioned before methods sound familiar there are few problems with each of them:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; IDE-integrated build does not allow easy porting.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; hand written, project-specific makefiles are error-prone and usually not very nice-looking after a while.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; auto-tools are good if you want to prepare release code for user but using them during development, when many things changes in structure over time is not very nice job.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; usually no support for automatic and manual test of code is present.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; (almost?) all proposed solutions build in directory with sources. this is bad because:&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; mixing sources and output files decrease readability of both.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; when you use different profiles (ex: debug, test and release) you need to clean object files and try to build once again whole project. this is inacceptable in bigger projects that may require tens of minutes or even hours to compile!&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
because of these, and few more, i&amp;#039;ve deiced to create generic, easy to port and adopt, build process which i can use in any sort of project.
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;NOTE: as i&amp;#039;m coding mostly in C++ and C, presented build process works with this type of code.&lt;/em&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;why build process?&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;why_build_process&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;252-1438&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;features&quot;&gt;features&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
there are few basic concepts that are implemented. they will be shortly described bellow.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;features&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;features&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1439-1553&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit4&quot; id=&quot;separation_sources_from_objects&quot;&gt;separation sources from objects&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
as mentioned in &lt;a href=&quot;#why_build_process&quot; title=&quot;prjs:build_process:build_process ↵&quot; class=&quot;wikilink1&quot;&gt;introduction&lt;/a&gt; part there is a strong need to separate source files from object files. in proposed solution it is done by creating special &amp;#039;gen/&amp;#039; directory in project root directory. subdirectories of it are profiles that are build (ex: test, release, debug, etc…). then this directory is a root for project output files. each library and application will have it&amp;#039;s own directory for output.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;separation sources from objects&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;separation_sources_from_objects&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;1554-2030&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit5&quot; id=&quot;predefined_profiles&quot;&gt;predefined profiles&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
in most cases there is a set of predefined profiles that user may need. in this case following are available:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; debug – build debug information on everything that is possible&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; release – build with optimizations and dissable asserts.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; profile – build in profiling mode. this will require gprof installed to read generated stats on execution time of particular calls.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; test – build automatic tests for chosen library/application.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; mtest – build manual tests for chosen library/application.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; doc – generates doxygen documentation.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;predefined profiles&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;predefined_profiles&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;2031-2614&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit6&quot; id=&quot;automatic_and_manual_tests&quot;&gt;automatic and manual tests&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
to make file simpler there is always requirement to test each and every part of software. automatic tests allows to quickly see if all of them works fine. in proposed solution &lt;a href=&quot;http://tut-framework.sourceforge.net/&quot; class=&quot;urlextern&quot; title=&quot;http://tut-framework.sourceforge.net/&quot; rel=&quot;ugc nofollow&quot;&gt;tut framework&lt;/a&gt; is used. this creates single binary for each library/application. when you run it it shows all tests that pass and long description of those which failed.
&lt;/p&gt;

&lt;p&gt;
though automatic tests are extremely usefull in every day life, there are some situations when writting automatic test is not possible, or at least very hard and not worth all this time (ex: consider wrapper for system call that show something on the screen). not to leave such a piece of code untouched you should write manual test for this situation. this is binary that calls single, tested functionality and you can see and judge results your self.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;automatic and manual tests&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;automatic_and_manual_tests&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;2615-3495&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit7&quot; id=&quot;semi-automatic_inter-component_dependencies&quot;&gt;semi-automatic inter-component dependencies&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
to automatically solve dependencies between separate sources is obvious. to go one step ahead dependencies between components (libs/apps) are solved semi-automatically. all you need to do is specify what libraries are needed to build each one and building tree from this is done for you.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;semi-automatic inter-component dependencies&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;semi-automatic_inter-component_dependencies&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;3496-3840&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit8&quot; id=&quot;dynamic_dependencies&quot;&gt;dynamic dependencies&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
some libraries does not provide specific libraries that are need but instead supply some executable that generates flags for given compiler and linker. to cope with those ones there is a backend allowing to place any binary that will produce a list of libraries to link with, link parameters and compile time switches.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;dynamic dependencies&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;dynamic_dependencies&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;3841-4193&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit9&quot; id=&quot;split_backend&quot;&gt;split backend&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
there is sometimes need to do something like static polymorphism on source-code level. this happens if some code does not have sense in some cases, or if we need to build different code depending on other circumstances (ex: depending on profile). this mechanism is called split backend. in general, in C and C++ projects it works by specifying single header set and two or more sources that need to be build depending on given mode.
&lt;/p&gt;

&lt;p&gt;
example library tree for having split backend could look like this:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;lib1/MyClass.hpp
lib1/FakeHandler/MyClass.cpp
lib1/RealHandler/MyClass.cpp&lt;/pre&gt;

&lt;p&gt;
each time only one MyClass.cpp will be build and linked in.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;split backend&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;split_backend&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:9,&amp;quot;range&amp;quot;:&amp;quot;4194-4869&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit10&quot; id=&quot;private_and_public_headers&quot;&gt;private and public headers&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
when specifying library&amp;#039;s &lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt; you need to show which headers are public and can be used by others and which are library privates. in build process i propose by default all are private. to make them visible to others one must put special marker into header file:
&lt;/p&gt;
&lt;pre class=&quot;code C&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/* public header */&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
files marked this way will be visible by external libraries and applications. rest is visible only inside library.
&lt;/p&gt;

&lt;p&gt;
example usage can be found in test_app/lib2/Lib2/ObjectToForceLink.cpp file, inside &lt;a href=&quot;#download&quot; title=&quot;prjs:build_process:build_process ↵&quot; class=&quot;wikilink1&quot;&gt;build process&amp;#039; release&lt;/a&gt;.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;private and public headers&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;private_and_public_headers&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:10,&amp;quot;range&amp;quot;:&amp;quot;4870-5446&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit11&quot; id=&quot;common_makefiles&quot;&gt;common Makefiles&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
there is a set of makefiles to be used for building library, application, project, etc… theses are ready to use and fully automatic. there is no need for user to change anything inside them. all he have to do is to put symbolic links in proper places.
&lt;/p&gt;

&lt;p&gt;
this allows easy changing build process version. all you need to do is replace old directory with makefiles set with new ones! since all symbolic links point in the same place, but files itself have changed, changes are visible straight away.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;common Makefiles&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;common_makefiles&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:11,&amp;quot;range&amp;quot;:&amp;quot;5447-5974&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit12&quot; id=&quot;makefiles_customisation_methods&quot;&gt;Makefiles customisation methods&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
in most cases there is no need to go into any Makefile. thought from time to time it happens that some code could be added there to prevent or force doing something. since assumption is not to change any build process files, there is a back door provided. you can put files of special names in project, library or application root directory and they will be automatically included in generic makefiles allowing inserting own code.
&lt;/p&gt;

&lt;p&gt;
the most important of those is config.mk placed in project&amp;#039;s root. you can put default setting for build there, so that all you&amp;#039;ll need to write to build default mode is:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Makefiles customisation methods&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;makefiles_customisation_methods&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:12,&amp;quot;range&amp;quot;:&amp;quot;5975-6630&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit13&quot; id=&quot;toolchain_selection&quot;&gt;toolchain selection&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
toolchain to be used for building can be easily selected by TC parameter to make (i can be also put in build_config/config.mk). currently available is &amp;#039;local&amp;#039; that used default toolchain to build everyting. new ones can be provided by creating new toolchain description files under build_process/makefiles/common/toolchains/&amp;lt;tc-name&amp;gt; directory.
&lt;/p&gt;

&lt;p&gt;
currently following toolchains are supported:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; gcc – uses local, default tools (gcc, g++, ar, etc…)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; avr – uses tools provided with avr-gcc, and related&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; intel – uses Intel&amp;#039;s icc toolchain (icc, xiar, etc…)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; clang – uses clang C/C++ compiler&amp;#039;s suit&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;toolchain selection&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;toolchain_selection&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:13,&amp;quot;range&amp;quot;:&amp;quot;6631-7278&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit14&quot; id=&quot;memory_debuging_link_mode&quot;&gt;memory debuging link mode&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
new parameter MEM_DEBUG=1 can be passed to make causing linker to use library electric fence to be used as memory manager. it helps to debug many memory-related problems.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;memory debuging link mode&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;memory_debuging_link_mode&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:14,&amp;quot;range&amp;quot;:&amp;quot;7279-7488&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit15&quot; id=&quot;test_data&quot;&gt;test data&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
integrated possibility to use test data for tests. if test requires ex. reading external file(s), it can be provided with one, that is accessible from test&amp;#039;s output directory. dependencies of test data are traced as well as the code, i.e. when you change test data file it will be automatically copied to the destination place.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;test data&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;test_data&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:15,&amp;quot;range&amp;quot;:&amp;quot;7489-7839&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit16&quot; id=&quot;ccache_support&quot;&gt;ccache support&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
&lt;a href=&quot;https://en.wikipedia.org/wiki/ccache&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/ccache&quot;&gt;ccache&lt;/a&gt; is now supported out of the box. to run build with ccache simply pass WITH_CCACHE:=1 option when calling &amp;#039;make&amp;#039;, or add it to build_config/config.mk (note: since v1.1.0 it is enabled by default).
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;ccache support&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;ccache_support&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:16,&amp;quot;range&amp;quot;:&amp;quot;7840-8077&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit17&quot; id=&quot;distcc_support&quot;&gt;distcc support&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
&lt;a href=&quot;https://en.wikipedia.org/wiki/distcc&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/distcc&quot;&gt;distcc&lt;/a&gt; support is now available. to use is add WITH_DISTCC:=1 option when calling &amp;#039;make&amp;#039;, or add it to build_config/config.mk.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;distcc support&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;distcc_support&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:17,&amp;quot;range&amp;quot;:&amp;quot;8078-8239&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit18&quot; id=&quot;project-specific_compilation_opttions&quot;&gt;project-specific compilation opttions&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
3 new variables have been added to build_config/config.mk, that allows to specify extra compilation flags for a given project:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; USER_OPT_FLAGS – flags to be used when doing optimized build&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; USER_DBG_FLAGS – flags to be used when doing debug build&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; USER_PRF_FLAGS – flags to be used when doing profile build&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;project-specific compilation opttions&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;project-specific_compilation_opttions&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:18,&amp;quot;range&amp;quot;:&amp;quot;8240-8608&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit19&quot; id=&quot;profile-specific_components&quot;&gt;profile-specific components&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
some components can be now build only in some of the profiles now. this is especially useful when building (m)test profiles, since it allows to create test-only components that prepare test data and provide proper stubs, commonly used when testing. these components never appear in release mode and similar.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;profile-specific components&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;profile-specific_components&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:19,&amp;quot;range&amp;quot;:&amp;quot;8609-8956&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit20&quot; id=&quot;small_projects_build_process&quot;&gt;small projects build process&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
if you create small project, consisting of just a few files, in most cases it would be an overkill to use full-featured build, that requires some configuration to be done first. instead one may use &amp;#039;small projects build process&amp;#039;, which provides most main features of full-build-process, but consists of only one make file and does not require explicit configuration. it is just enough to put it in sources directory.
&lt;/p&gt;

&lt;p&gt;
example of usage can be seen in test application (small_prj_build_process/test_app/), available in &lt;a href=&quot;#download&quot; title=&quot;prjs:build_process:build_process ↵&quot; class=&quot;wikilink1&quot;&gt;build process&amp;#039; release&lt;/a&gt;.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;small projects build process&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;small_projects_build_process&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:20,&amp;quot;range&amp;quot;:&amp;quot;8957-9552&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit21&quot; id=&quot;force-link&quot;&gt;force-link&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
force-link allows forcing linker to include given symbols (i.e. object files) in final binary, even though they would be normally discarded as not used. this is mainly useful when using auto-registration mechanisms for &lt;a href=&quot;https://en.wikipedia.org/wiki/Design pattern&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/Design pattern&quot;&gt;design patterns&lt;/a&gt; like &lt;a href=&quot;https://en.wikipedia.org/wiki/abstract factory&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/abstract factory&quot;&gt;abstract factory&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
usage is extremely simple – in object file that has registration code, and must be included in final binary, even though linker can remove it, one must include one (C-code) header and use macro to define unique name of this element. see the example:
&lt;/p&gt;
&lt;pre class=&quot;code c&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#include &amp;quot;BuildProcess/ForceLink.hpp&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...&lt;/span&gt;
FORCE_LINK_THIS_OBJECT&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;MyNamespace1_MyNamespace2_MyObjectToForceLink&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;force-link&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;force-link&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:21,&amp;quot;range&amp;quot;:&amp;quot;9553-10257&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit22&quot; id=&quot;auto-tools-based_components&quot;&gt;auto-tools-based components&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
build process now allows easy importing of components based on auto-tools (&lt;em&gt;./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;/em&gt;). now it is enough to extract such a component to directory with typical structure and link make to AutoToolsMakefile. build process will do the rest!
&lt;/p&gt;

&lt;p&gt;
you can set dependencies for such components as well, which makes it possible for quick and easy inclusion of external libs which have some dependencies between them as well.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;auto-tools-based components&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;auto-tools-based_components&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:22,&amp;quot;range&amp;quot;:&amp;quot;10258-10740&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit23&quot; id=&quot;user_features&quot;&gt;user &amp;#039;features&amp;#039;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
since v1.7.0 build process allows &amp;#039;features&amp;#039;, that are more flexible (i.e. scalable) extension of &amp;#039;modes&amp;#039; concept (see: &amp;#039;split backend&amp;#039;). features can be build or not, i.e. being turned on/off during compile time, by selecting (or not) given name.
&lt;/p&gt;

&lt;p&gt;
as a simple example, to give an idea how it works, consider two implementations of greetings for your program: normal and slang. lat us assume following directory structure:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;mycomponent/MyComponent/hello.hpp            // void hell(void);
mycomponent/MyComponent/Impl/normalHello.cpp // void hello(void) { cout&amp;lt;&amp;lt;&amp;quot;hello world!&amp;quot;&amp;lt;&amp;lt;endl; }
mycomponent/MyComponent/Impl/slangHello.cpp  // void hello(void) { cout&amp;lt;&amp;lt;&amp;quot;yo there!&amp;quot;&amp;lt;&amp;lt;endl; }&lt;/pre&gt;

&lt;p&gt;
to enable features add extra directory &amp;#039;features&amp;#039; in &amp;#039;modes&amp;#039; with proper names. for example:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;mycomponent/features/modes/default # MyComponent/*.[ch]pp
mycomponent/features/modes/features/normal # MyComponent/Impl/normalHello.cpp
mycomponent/features/modes/features/slang  # MyComponent/Impl/slangHello.cpp&lt;/pre&gt;

&lt;p&gt;
to enable given feature just add it to build parameters, &amp;#039;FEATURES&amp;#039; variable:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make FEATURES=&amp;quot;normal&amp;quot; # builds with &amp;#039;normal&amp;#039; feature turned on
make FEATURES=&amp;quot;slang&amp;quot;  # builds with &amp;#039;slag&amp;#039; feature turned on&lt;/pre&gt;

&lt;p&gt;
you can specify multiple features separate with spaces. features does not need to be implemented in every component (&amp;#039;modes&amp;#039; does!).
&lt;/p&gt;

&lt;p&gt;
note that &amp;#039;features&amp;#039; are often very useful along with automatic registration mechanisms like &lt;a href=&quot;https://en.wikipedia.org/wiki/abstract factory&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/abstract factory&quot;&gt;abstract factory&lt;/a&gt;, but can be used as a more selective &amp;#039;split backend&amp;#039; as well (see previous example).
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;user &amp;#039;features&amp;#039;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;user_features&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:23,&amp;quot;range&amp;quot;:&amp;quot;10741-12310&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit24&quot; id=&quot;usage_example&quot;&gt;usage example&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
the example of some features can be seen in action in &lt;a href=&quot;#download&quot; title=&quot;prjs:build_process:build_process ↵&quot; class=&quot;wikilink1&quot;&gt;downloaded&lt;/a&gt; build process file. there is test_app that is kind of playground/example to see and test.
&lt;/p&gt;

&lt;p&gt;
bellow are some examples of calling build process to build specific source with given parameters.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;usage example&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;usage_example&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:24,&amp;quot;range&amp;quot;:&amp;quot;12311-12607&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit25&quot; id=&quot;build_in_release&quot;&gt;build in release&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
to build all type:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=release TC=local&lt;/pre&gt;

&lt;p&gt;
or to build single app/lib:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=release TC=local somelib&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;build in release&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;build_in_release&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:25,&amp;quot;range&amp;quot;:&amp;quot;12608-12759&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit26&quot; id=&quot;build_in_debug&quot;&gt;build in debug&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
to build all type:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=debug TC=local&lt;/pre&gt;

&lt;p&gt;
or to build single app/lib:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=debug TC=local somelib&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;build in debug&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;build_in_debug&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:26,&amp;quot;range&amp;quot;:&amp;quot;12760-12905&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit27&quot; id=&quot;build_in_profile&quot;&gt;build in profile&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
to build all type:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=profile TC=local&lt;/pre&gt;

&lt;p&gt;
or to build single app/lib:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=profile TC=local somelib&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;build in profile&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;build_in_profile&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:27,&amp;quot;range&amp;quot;:&amp;quot;12906-13056&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit28&quot; id=&quot;build_in_test&quot;&gt;build in test&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
to build single app/lib in test mode enter:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=test TC=local somelib&lt;/pre&gt;

&lt;p&gt;
note that all dependencies of &amp;#039;somelib&amp;#039; will be build in debug profile!
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;build in test&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;build_in_test&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:28,&amp;quot;range&amp;quot;:&amp;quot;13057-13238&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit29&quot; id=&quot;build_in_mtest&quot;&gt;build in mtest&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
to build single app/lib in test mode enter:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=mtest TC=local somelib&lt;/pre&gt;

&lt;p&gt;
note that all dependencies of &amp;#039;somelib&amp;#039; will be build in debug profile!
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;build in mtest&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;build_in_mtest&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:29,&amp;quot;range&amp;quot;:&amp;quot;13239-13421&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit30&quot; id=&quot;build_in_different_mode&quot;&gt;build in different mode&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
default mode is called simply &amp;#039;default&amp;#039;. if you need to use other mode, you&amp;#039;ll need to specify it explicitly (or via build_config/config.mk). example o building release on mode named &amp;#039;fakedriver&amp;#039;.
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make PROFILE=release TC=local MODE=fakedriver&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;build in different mode&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;build_in_different_mode&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:30,&amp;quot;range&amp;quot;:&amp;quot;13422-13704&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit31&quot; id=&quot;creating_new_project&quot;&gt;creating new project&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
when creating new project following rules must be respected:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; all libraries and applications need to be placed in separate directories in project&amp;#039;s root.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; all makefiles should be links to corresponding build process makefiles. in particular main project makefile should be link to ProjectMakefile inside build process.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; build_config/components.lst file must be created in project root, with spaces separated list of all libraries and applications that are present in projects (use directories names).&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; for each library/application must be build following way:&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; makefile must be link to proper build process makefile.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; sources should be placed in single directory.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &amp;#039;features&amp;#039; directory should be present with following content:&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &amp;#039;deps&amp;#039; dir with files that have names like profile names. each file specifies dependencies on other libs/apps depending on given profile.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &amp;#039;modes&amp;#039; dir with files that names correspond to each mode. each file has line separated file expressions to selecting source/headers to compile.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &amp;#039;testdata&amp;#039; dir – here should be placed all data that will be needed for test and mtest applications (they are copied to gen/ directory).&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;creating new project&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;creating_new_project&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:31,&amp;quot;range&amp;quot;:&amp;quot;13705-14940&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit32&quot; id=&quot;download&quot;&gt;download&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
latest version of &lt;a href=&quot;https://github.com/el-bart/build_process&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/el-bart/build_process&quot; rel=&quot;ugc nofollow&quot;&gt;build process&lt;/a&gt; can be downloaded via github. download it directly via &lt;a href=&quot;https://github.com/el-bart/build_process/tags&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/el-bart/build_process/tags&quot; rel=&quot;ugc nofollow&quot;&gt;lates releases&lt;/a&gt; tab.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;download&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;download&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:32,&amp;quot;range&amp;quot;:&amp;quot;14941-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 15 Jun 2021 20:09:51 +0000</pubDate>
        </item>
    </channel>
</rss>
