|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
<h1>New Build Documentation</h1>
In my <code>ttmrichter</code> branch, tagged <code>newbuild</code>, I have a new build system in the works that should make it easier for new users to quickly get up to speed on their platform of choice. The new system works thusly:
* One <code>Makefile</code> drives all platforms.
* Different platforms are brought into this makefile through
<code>include</code> commands. Which one is brought in is specified using
a variable called <code>PLATFORM</code>. For example if
<code>PLATFORM</code> is set to "solaris" the Makefile will bring in the
makefile fragment named <code>./make/solaris-fragment.mk</code>. This
fragment selects which features are enabled and other OS-specific settings.
<code>PLATFORM</code> defaults to "linux" if not supplied.
* Different compilers are introduced via the <code>COMPILER</code> variable.
For example if you wish to use <code>clang</code> instead of
<code>gcc</code>, simply set <code>COMPILER</code> to <code>clang</code>.
As with the previous, a makefile fragment build from the compiler name is
brought in. This file will set compiler command line options.
<code>COMPILER</code> defaults to "gcc" if not supplied.
* As it is a hassle to constantly have to set the variables on the command
line, two site-specific configuration makefile fragments are loaded in by
the main makefile if present: pre-config.mk and post-config.mk. These
files are <em>not</em> under revision control and thus will not interfere
with the Fossil source itself.
* <code>./pre-config.mk</code> is included before <code>PLATFORM</code> or
<code>COMPILER</code> are set and is thus a perfect place to define these
two variables to avoid the need for convoluted (and error-prone) command
lines or for build scripts.
* <code>./post-config.mk</code> is included after the platform and compiler
fragments are executed and is thus a perfect place to override the settings
provided in these fragments.
* To support platform-specific modifications of compiler settings, special
variables -- <code>PLATFORM_SPECIFIC_(compiler)</code> and
<code>PLATFORM_SPECIFIC_LIB</code> are provided. You can see how these
variables are set in the <code>./make/mingw32-fragment.mk</code> file (note
the use of a friendlier wrapper definition) and how they are used in the
two compiler fragment files.
* Note that since platforms are included before compilers, it is possible for
platform fragments to force specific compilers if this is desirable. Again
the MinGW32 fragment demonstrates this, forcing the compiler to be GCC.
It is hoped that the new build system will permit new platforms and new compilers to be more quickly supported in a well-regulated way, and that it will make things easier for end-users who have to modify builds based on their sites' idiosyncracies.
|