<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hjs</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hjs"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Hjs"/>
	<updated>2026-11-21T10:50:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/Building_Guide/Building_on_Windows&amp;diff=169329</id>
		<title>Documentation/Building Guide/Building on Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/Building_Guide/Building_on_Windows&amp;diff=169329"/>
		<updated>2010-05-27T10:26:20Z</updated>

		<summary type="html">&lt;p&gt;Hjs: /* bootstrap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/Building Guide TOC&lt;br /&gt;
|ShowNextPage=none&lt;br /&gt;
|ShowPrevPage=none&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{DISPLAYTITLE:Building on Windows}}&lt;br /&gt;
[[Category:Windows]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Windows| This document explains how to build the OpenOffice.org source code on Windows systems.}}&lt;br /&gt;
&lt;br /&gt;
For building OpenOffice.org Cygwin is needed, a Windows program that emulates a complete Unix command line environment. To use this document you need to be familiar with a command line, but you need not to be a UNIX shell wizard.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Tip|If you have never used a Unix shell, you might want to take a look at the [http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html shell introduction at TLDP].}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|&amp;lt;code&amp;gt;$SRC_ROOT&amp;lt;/code&amp;gt; will denote the directory in which the source code of OpenOffice.org is stored.}}&lt;br /&gt;
{{Template:Documentation/Tip|You are advised to check the release notes for the release you are building to inform yourself about changes since previous releases.}}&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
== hardware requirements ==&lt;br /&gt;
&lt;br /&gt;
* 1 or more reasonable fast CPUs (x-way CPU recommended)&lt;br /&gt;
* 1 GB RAM (2 GB recommended)&lt;br /&gt;
* 10 GB free disk space (20 GB when debugging)&lt;br /&gt;
&lt;br /&gt;
== software requirements ==&lt;br /&gt;
* Windows XP/Vista&lt;br /&gt;
&lt;br /&gt;
The following table is placed here, so you can come back to it easily, when you want to use a link. The items are explained below. Here&amp;#039;s the list of files to download (with links) and the locations in the source tree where you must put them:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Where to get&lt;br /&gt;
! Place in&lt;br /&gt;
|-&lt;br /&gt;
| Cygwin: [http://www.cygwin.com Cygwin Toolkit with (dll version 1.5.10) or later]&lt;br /&gt;
| (default)&lt;br /&gt;
|-&lt;br /&gt;
| C/C++ Compiler: [http://www.microsoft.com/express/download/ Visual C++ 2008 Express Compiler (basic install, no optional parts required)]&lt;br /&gt;
| (default)&lt;br /&gt;
|-&lt;br /&gt;
| Java: [http://java.sun.com/javase/6/ JDK 1.6] for DEV300 milestones &amp;gt;= m37 and all OOo310 versions (older milestones will fail in the hsqldb module)&lt;br /&gt;
| (default)&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&amp;amp;displaylang=en Windows SDK for Windows Server 2008]&amp;lt;ref name=&amp;quot;Foot1&amp;quot;&amp;gt;{{Template:Documentation/Note|This also supported on Vista. This is either a DVD image or a net installer. You can either mount the DVD with a suitable tool, burn it do a DVD or use tools like winrar that can extract files from ISO files directly. You don&amp;#039;t need to install samples or documentation (saves a lot of disk space). It will also install the .NET Framework 3.5 SDK.&lt;br /&gt;
It might be best to install the Windows SDK into the default directory, and if not that into one without capital letters in the path. I used D:\Dev\Win_SDK\ and received some linking errors in the Python module (see {{Bug|88568}}).}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.microsoft.com/downloads/details.aspx?familyid=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&amp;amp;displaylang=en GDI+ Redistributable] (Genuine Windows Validation required)&lt;br /&gt;
| external/gdiplus&lt;br /&gt;
|-&lt;br /&gt;
| Only for OOo2.x but due to {{Bug|88652}} in configure still needed for 3.x: [http://download.microsoft.com/download/b/7/5/b75eace3-00e2-4aa0-9a6f-0b6882c71642/unicows.exe unicows.dll from (Microsoft Layer for Unicode)]&amp;lt;ref name=&amp;quot;Foot2&amp;quot;&amp;gt; {{Template:Documentation/Note|unicows.dll is available from the Microsoft site and needs to be saved to $SRC_ROOT/external/unicows. Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft&amp;#039;s website.}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| external/unicows&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=CD1FC4B2-0885-47F4-AF45-7FD5E14DB6C0 dbghelp.dll]&amp;lt;ref name=&amp;quot;Foot3&amp;quot;&amp;gt;{{Template:Documentation/Note|dbghelp.dll is available from the Microsoft site and needs to be saved to $SRC_ROOT/external/dbghelp. Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft&amp;#039;s website.}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| external/dbghelp&lt;br /&gt;
|-&lt;br /&gt;
| [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/NT45/EN-US/InstMsiW.exe instmsiw.exe] and [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/W9XMe/EN-US/InstMsiA.exe instmsia.exe]&lt;br /&gt;
| external/msi&lt;br /&gt;
|-&lt;br /&gt;
| for 2005 compiler and Seamonkey libraries from OpenOffice.org 3.2 up: msvcp80.dll and msvcr80.dll (found in c:\WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd/msvc &lt;br /&gt;
| external/msvcp80&lt;br /&gt;
|-&lt;br /&gt;
| for 2008 compiler (until DEV300 m22): msvcp90.dll and msvcr90.dll (found in $(msvcdir)\Vc\redist\x86\Microsoft.VC90.CRT) &lt;br /&gt;
| external/msvcp90&lt;br /&gt;
|-&lt;br /&gt;
| for 2008 compiler starting with DEV300m23: Microsoft_VC90_CRT_x86.msm and policy_9_0_Microsoft_VC90_CRT_x86.msm for non debug builds and Microsoft_VC90_DebugCRT_x86.msm and policy_9_0_Microsoft_VC90_DebugCRT_x86.msm for debug builds&amp;lt;ref name=&amp;quot;Foot4&amp;quot;&amp;gt; {{Template:Documentation/Note|You can find these files in your directory c:\program files\common files\merge modules}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
. These merge modules are available in VS08 Express Edition and VS08 Professional Edtion. All *.msm files are located at c:\Program Files\Common Files\Merge Module. &lt;br /&gt;
| external/msm90&lt;br /&gt;
|-&lt;br /&gt;
| [http://archive.apache.org/dist/ant/binaries Apache Ant (version 1.6.5 or later)]&lt;br /&gt;
| (default)&lt;br /&gt;
|-&lt;br /&gt;
| [http://tools.openoffice.org/moz_prebuild/OOo3.2 Mozilla binary distribution] &lt;br /&gt;
&lt;br /&gt;
(WNTMSCIruntime.zip,WNTMSCIlib.zip,WNTMSCIinc.zip)&lt;br /&gt;
| moz/zipped&lt;br /&gt;
|-&lt;br /&gt;
| msvcr71.dll and msvcp71.dll for Mozilla libraries (Search for them in the Web or on your PC. These files should be named as all lower case. Sometimes when downloaded they are upper case and this will cause &amp;#039;file not found&amp;#039; errors towards the end of the build))&lt;br /&gt;
| external/msvcp71 &lt;br /&gt;
|-&lt;br /&gt;
| optional: [http://nsis.sourceforge.net/ Nullsoft Scriptable Install System (NSIS)]&amp;lt;ref name=&amp;quot;Foot5&amp;quot;&amp;gt;{{Template:Documentation/Note|If NSIS is available, a self contained Windows installer is created in addition to the MSI installer files.}}&lt;br /&gt;
{{Template:Documentation/Caution|It used to be that newer version of NSIS broke the build (see {{Bug|85657}}), but it seems that it now works for NSIS up to 2.3.7.}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| optional: [http://msdn.microsoft.com/directx/directxdownloads/ Microsoft DirectX SDK]&amp;lt;ref name=&amp;quot;Foot6&amp;quot;&amp;gt; {{Template:Documentation/Note|If you don&amp;#039;t want to download it you can disable DirectX support in the configuration step (&amp;lt;code&amp;gt;--disable-directx&amp;lt;/code&amp;gt;).}}&lt;br /&gt;
{{Template:Documentation/Caution|Current (as of 2008/01) versions of the DirectX9 SDK and Windows Platform SDK do not fit to each other. To be able to build with DirextX enabled, you need to patch one file in the Platform SDK. See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID2743771 for details.}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution|Do not use a DirectX10 SDK!}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== adding required files to the build tree ===&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Tip|Some of the files can be found in a suitable OOo installation set also, so you can save the download by “stealing” it from your OOo installation.}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|OOo uses some Mozilla libraries. Building the corresponding sources is only possible with the VC2003 compiler so you have to use precompiled libraries that require the msvx71 libraries mentioned above. On Windows the Mozilla libraries are needed only for Mozilla address book support. Unfortunately a bug in the module dependencies makes it necessary that the Mozilla libaries are used anyway as otherwise building the module &amp;lt;tt&amp;gt;xmlsecurity&amp;lt;/tt&amp;gt; fails (see below).}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|The default cygwin version offered on http://www.cygwin.com/ now is 1.7.x. For current milestones it is recommended to use this version as it fixes the .dll remapping probelm (see below) and is required for builds on Windows 7. If you need to build old versions of the source code, check out http://www.cygwin.com/win-9x.html}}&lt;br /&gt;
&lt;br /&gt;
= Installation and Preparation of Build Tools =&lt;br /&gt;
== setting up cygwin ==&lt;br /&gt;
&lt;br /&gt;
Go to http://www.cygwin.com/ and download and install the current version.&lt;br /&gt;
{{Template:Documentation/Caution|Make sure that you keep the filetype set to “Unix/binary”.}}&lt;br /&gt;
&lt;br /&gt;
=== required additional packages ===&lt;br /&gt;
Cygwin consists of some basic and a lot of optional packages. As building OOo needs some of these optional packages you have to select them in the installer.&lt;br /&gt;
Here&amp;#039;s a complete list of the needed packages:&lt;br /&gt;
* Category Archive:&lt;br /&gt;
** unzip&lt;br /&gt;
** zip&lt;br /&gt;
* Category Devel :&lt;br /&gt;
** autoconf&lt;br /&gt;
** bison&lt;br /&gt;
** flex&lt;br /&gt;
** gcc-g++&lt;br /&gt;
** gperf&lt;br /&gt;
** make&lt;br /&gt;
** openssl-devel (only needed for perl modules for CWS tooling, see below)&lt;br /&gt;
** cvs (for 2.x code line and 3.0 code line) &lt;br /&gt;
** subversion (for 3.x code line, minimum version 1.5.5)&lt;br /&gt;
** readline&lt;br /&gt;
* Category Libs&lt;br /&gt;
** openssl&lt;br /&gt;
* Category Net&lt;br /&gt;
** openssh&lt;br /&gt;
** ncftp&lt;br /&gt;
* Category Perl&lt;br /&gt;
** perl&lt;br /&gt;
* Category Shells&lt;br /&gt;
** rxvt&lt;br /&gt;
* Category Utils&lt;br /&gt;
** patch&lt;br /&gt;
** gnupg&lt;br /&gt;
* Category Web&lt;br /&gt;
** lynx&lt;br /&gt;
** wget&lt;br /&gt;
{{Template:Documentation/Note|Unfortunately the list of packages mentioned at http://website.openoffice.org/support/en/howtos/1.html#1 is incomplete, some more are listed at http://tools.openoffice.org/dev_docs/build_windows_tcsh.html#BuildRequirements .}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|The installer will automatically check and download some more packages needed by thosed listed here. The whole process takes roughly 20 minutes.}}&lt;br /&gt;
&lt;br /&gt;
=== breaking links to executables ===&lt;br /&gt;
Within the Cygwin Toolkit, some executables might be symlinks: awk.exe and gunzip.exe, tar.exe (in older releases only). This can lead to a break of the build later, and the symlinks should be replaced by copies of the command they link to. &lt;br /&gt;
&lt;br /&gt;
To check this, execute:&lt;br /&gt;
&lt;br /&gt;
 ls -l /bin/awk.exe&lt;br /&gt;
&lt;br /&gt;
whether e.g. awk.exe is a symlink. In version 1.5.24-2 awk.exe is a link to gawk.exe. The shell will show this by putting out “awk.exe -&amp;gt; gawk.exe”. In this case gawk.exe must be copied to awk.exe by executing: &lt;br /&gt;
&lt;br /&gt;
 cd /bin&lt;br /&gt;
 rm awk.exe&lt;br /&gt;
 cp gawk.exe awk.exe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In case you overlook something here or you have a newer Cygwin version with additional symlinks not mentioned here it&amp;#039;s not a problem. You will get a helpful error message about an existing link in the configuration step (configure) later. The message will tell you which link you have to remove and you can do it following the advice given above for the awk.exe/gawk.exe pair.&lt;br /&gt;
&lt;br /&gt;
=== installing additional perl modules in cygwin ===&lt;br /&gt;
As explained some perl modules must be installed with CPAN. The necessary command in the cygwin shell is&lt;br /&gt;
&lt;br /&gt;
 perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
If this command is executed the first time CPAN will ask for configuration. Choose autoconfiguration. &lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution|Please note that CPAN is not able to deal with usernames containing spaces. To work around this fact, when CPAN asks you to specify the &amp;#039;&amp;#039;CPAN build and cache directory&amp;#039;&amp;#039;, change the default suggestion to &amp;lt;tt&amp;gt;/cpan&amp;lt;/tt&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
At the end the CPAN shell appeared and is ready to accept commands for installations. Each module is installed by typing &amp;lt;code&amp;gt;install $MODULENAME&amp;lt;/code&amp;gt;. The modules that must be installed are:&lt;br /&gt;
&lt;br /&gt;
* Archive::Zip&lt;br /&gt;
* XML::Parser (though it seems that this is already installed; doesn&amp;#039;t hurt to do it)&lt;br /&gt;
* URI&lt;br /&gt;
* LWP::UserAgent&lt;br /&gt;
* Crypt::SSLeay&lt;br /&gt;
* SOAP::Lite&lt;br /&gt;
&lt;br /&gt;
CPAN will detect if a selected module depends on other modules and it will offer to download them also. As explained please just confirm this.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|The last three modules are only needed if you want to use the cws tooling. These tools are necessary if you want to create and maintain your own [http://wiki.services.openoffice.org/wiki/CWS Child Workspaces] or if you want to build one of them. I recommend to install them anyway as sooner or later you want to work on a child workspace.}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution|I got an error message from CPAN somewhat like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\bin\cygiconv-2.dll to same&lt;br /&gt;
address as parent(0x7C0000) != 0x7D0000&amp;lt;/pre&amp;gt;&lt;br /&gt;
To fix this, I had to exit the Cygwin shell, run cmd.exe, then type &amp;quot;c:\cygwin\bin\ash.exe&amp;quot; to start the minimal shell, then type &amp;lt;code&amp;gt;/bin/rebaseall&amp;lt;/code&amp;gt;. Then CPAN worked when I ran it again.}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution| I got another error when cygwin was performing &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;ERROR: Can&amp;#039;t create &amp;#039;/usr/bin&amp;#039;; Do not have write permissions on &amp;#039;/usr/bin&amp;#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
I can actually write to /usr/bin; however when I do &amp;lt;tt&amp;gt;ls -ld /usr/bin&amp;lt;/tt&amp;gt;, cygwin reports no write permission; and &amp;lt;tt&amp;gt;chmod u+w /usr/bin&amp;lt;/tt&amp;gt; gives &amp;lt;tt&amp;gt;Permission denied&amp;lt;/tt&amp;gt;.  This causes the install process to fail when it checks permissions. As a kludge, I installed vim, and edited line 368 of /usr/lib/perl5/5.10/ExtUtils/Install.pm, replacing this:&lt;br /&gt;
&amp;lt;pre&amp;gt;return -w $dir;&amp;lt;/pre&amp;gt;&lt;br /&gt;
with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;return 1;&amp;lt;/pre&amp;gt;&lt;br /&gt;
which allowed installation to proceed.}}&lt;br /&gt;
&lt;br /&gt;
= Full Builds =&lt;br /&gt;
== configure ==&lt;br /&gt;
Finally the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; tool is used to create the environment. It checks that all software, hardware, and system requirements for the build are satisfied, and creates configuration files called winenv.set (for tcsh) and winenv.set.sh (for bash) that are used to set all necessary build environment variables. Before running configure, make sure that all needed programs are in the system path or start configure with the appropriate command line switches. If configure detects a problem it will stop and give you a useful hint how to fix it.&lt;br /&gt;
&lt;br /&gt;
You will find the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script in &amp;lt;code&amp;gt;$SRC_ROOT&amp;lt;/code&amp;gt;. The resulting configuration files are created there too.&lt;br /&gt;
&lt;br /&gt;
==== sample configure calls ====&lt;br /&gt;
&lt;br /&gt;
 ./configure \&lt;br /&gt;
  --disable-directx \&lt;br /&gt;
  --with-cl-home=&amp;quot;/cygdrive/d/develop/msvc/VC&amp;quot; \&lt;br /&gt;
  --disable-activex \&lt;br /&gt;
  --disable-atl \&lt;br /&gt;
  --disable-build-mozilla \&lt;br /&gt;
  --with-frame-home=&amp;quot;/cygdrive/d/develop/MSDK/v6.1&amp;quot; \&lt;br /&gt;
  --with-psdk-home=&amp;quot;/cygdrive/d/develop/MSDK/v6.1&amp;quot; \&lt;br /&gt;
  --with-midl-path=&amp;quot;/cygdrive/d/develop/MSDK/v6.1/Bin&amp;quot; \&lt;br /&gt;
  --with-asm-home=&amp;quot;/cygdrive/d/develop/msvc/VC&amp;quot; \&lt;br /&gt;
  --with-jdk-home=&amp;quot;/cygdrive/d/develop/j2sdk1.4.2_11&amp;quot; \&lt;br /&gt;
  --with-csc-path=&amp;quot;/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5&amp;quot; \&lt;br /&gt;
  --with-ant-home=/ant \&lt;br /&gt;
  --with-use-shell=bash&lt;br /&gt;
&lt;br /&gt;
 ./configure --disable-build-mozilla --with-use-shell=bash --disable-activex --with-win32&lt;br /&gt;
 --with-cl-home=&amp;quot;/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/VC&amp;quot;&lt;br /&gt;
 --with-midl-path=&amp;quot;/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1/Bin&amp;quot;&lt;br /&gt;
 --with-csc-path=&amp;quot;/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v3.5&amp;quot;&lt;br /&gt;
 --with-frame-home=&amp;quot;/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1&amp;quot;&lt;br /&gt;
 --with-asm-home=&amp;quot;/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/VC/Bin&amp;quot;&lt;br /&gt;
 --with-jdk-home=&amp;quot;/cygdrive/c/j2sdk1.4.2_11&amp;quot; .&lt;br /&gt;
 --disable-directx --disable-epm&lt;br /&gt;
 --with-ant-home=/cygdrive/c/apache-ant-1.6.5&lt;br /&gt;
 --with-psdk-home=&amp;quot;/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== configure settings tips ====&lt;br /&gt;
{{Template:Documentation/Caution|Make sure that the &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable in your cygwin shell does not contain any blanks and quotes.}}&lt;br /&gt;
{{Template:Documentation/Caution|Paths might have problems with spaces. Install requirements into pathes without them. Alternatively, feel free to install the various packages using the default path containing spaces and then use the mixed short path for the configure stage. The mixed short path can be obtained using Cygwin&amp;#039;s cygpath tool, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ cygpath -m -s &amp;quot;c:\Program Files\Microsoft Visual Studio 9.0\VC&amp;quot;&lt;br /&gt;
 c:/PROGRA~1/MICROS~1.0/VC&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;with-psdk-home&amp;lt;/code&amp;gt; setting needs a case-sensitive path name. I recommend to use case-sensitive usage in all cases - it&amp;#039;s good to get used to case sensitivity if you are going to work with Cygwin.}}&lt;br /&gt;
{{Template:Documentation/Caution|Beware of using &amp;lt;code&amp;gt;/c/&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;/cygdrive/c/&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Caution|Avoid trailing slashes in configure parameters. They sure cause problems for &amp;lt;code&amp;gt;--with-psdk-home&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Note|Paths to dependencies might be different for your installation. The pathes containing &amp;quot;msvc&amp;quot; and &amp;quot;msdk&amp;quot; should be self-explanatory.}}&lt;br /&gt;
{{Template:Documentation/Tip|There are a number of options that you can use with the configure script. To display these options, type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
{{Template:Documentation/Tip|If you run into problems with early DEV300 releases, check your settings in winenv.set.sh for &amp;lt;code&amp;gt;WINDOWS_VISTA_PSDK&amp;lt;/code&amp;gt; to be set &amp;lt;code&amp;gt;TRUE&amp;lt;/code&amp;gt;. This is important if &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; fails to detect the Windows platform SDK version correctly. The detection failure results from the way how configure searches for the Vista PSDK in older releases: it will be found only if it is installed into the default location.}} &lt;br /&gt;
{{Template:Documentation/Tip|If you run into problems compiling on an &amp;quot;Express Edition&amp;quot; with early DEV300 releases, check your settings in winenv.set.sh for &amp;lt;code&amp;gt;DISABLE_ATL&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;DISABLE_ACTIVEX&amp;lt;/code&amp;gt;: all have to be set &amp;lt;code&amp;gt;TRUE&amp;lt;/code&amp;gt;. Visual Studio Express compilers do not contain everything needed to build the OOo ActiveX control, OLE automation and native Windows OLE support, so disable support for them. A &amp;quot;complete&amp;quot; Visual Studio (no “Express” version) is not limited in that way.}}&lt;br /&gt;
{{Template:Documentation/Tip|As DirectX is not needed for most developers, its SDK consumes a lot of disk space and is prone to incompatibilities I recommend to build without DirecX support by using &amp;lt;code&amp;gt;--disable-directx&amp;lt;/code&amp;gt; as shown above. Otherwise you have to provide the path to the SDK in &amp;lt;code&amp;gt;--with-directx-home&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Tip|OOo uses some Mozilla components. It is not possible to build them from the sources using the Visual Studio 2005 compiler. Disabling the Mozilla components with &amp;lt;code&amp;gt;--disable-mozilla&amp;lt;/code&amp;gt; completely currently does might not work due to a bug in the module dependencies.}}&lt;br /&gt;
{{Template:Documentation/Tip|If you experiment with the newest sources, mind that it can happen sometimes that &amp;lt;code&amp;gt;configure.in&amp;lt;/code&amp;gt; was updated, but it was forgotten to update configure too. The configure script itself is created from &amp;lt;code&amp;gt;configure.in&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;autoreconf&amp;lt;/code&amp;gt; command. The perl script &amp;lt;code&amp;gt;set_soenv&amp;lt;/code&amp;gt; is created when you run configure from &amp;lt;code&amp;gt;set_soenv.in&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Tip|csc.exe comes from the &amp;lt;code&amp;gt;c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322&amp;lt;/code&amp;gt; directory, you might need &amp;lt;code&amp;gt;--with-csc-path&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Tip|If you fail to getting together a working installation of Cygwin, one possibility is to use a known-to-work combination of Cygwin packages, i.e. a direct copy of some other user&amp;#039;s Cygwin tree. [[User:TorLillqvist]] has such a tree (from late 2006) zipped up at http://download.go-oo.org/tstnvl/tml/tml-cygwin.zip . Don&amp;#039;t hesitate to ask for advice if necessary.}}&lt;br /&gt;
&lt;br /&gt;
== bootstrap ==&lt;br /&gt;
After running configure you must create the dmake make utility that is needed for the build of OpenOffice.org. This done from the SRC_ROOT directory by calling&lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|1=Starting with DEV300m77, the sources for external modules (e.g. libxml2) were moved out of the source repository. The bootstrap step will now create a directory called &amp;quot;ext_sources&amp;quot; beside the repository and populate it with the required file via HTTP.&lt;br /&gt;
If need to change that behavior, checkout the configure switches &lt;br /&gt;
 --with-external-tar=&amp;lt;TARFILE PATH&amp;gt;  : Specify path to tarfiles manually&lt;br /&gt;
 --disable-fetch-external            : Disables fetching external tarballs from web sources.}}&lt;br /&gt;
&lt;br /&gt;
== setting the enviroment ==&lt;br /&gt;
&lt;br /&gt;
When the configure script has been run successfully a file &amp;lt;code&amp;gt;winenv.Set.sh&amp;lt;/code&amp;gt; was created&amp;lt;ref name=&amp;quot;Foot7&amp;quot;&amp;gt;{{Template:Documentation/Note|When you want to use tcsh instead of bash, you will need to use the file &amp;lt;code&amp;gt;winenv.Set&amp;lt;/code&amp;gt; instead:&lt;br /&gt;
&amp;lt;pre&amp;gt; source winenv.Set&lt;br /&gt;
 rehash&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you do not use tcsh, it is better to delete that file, as it will get in the way for tab-completion sooner or later.}}&amp;lt;/ref&amp;gt;. Do this:&lt;br /&gt;
&lt;br /&gt;
 source winenv.Set.sh&lt;br /&gt;
&lt;br /&gt;
to set up the enviroment for the build.&lt;br /&gt;
&lt;br /&gt;
== starting the build ==&lt;br /&gt;
Build the software by typing the following in &amp;lt;code&amp;gt;$SRC_ROOT&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;Foot8&amp;quot;&amp;gt;{{Template:Documentation/Note|You can also run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&amp;lt;/pre&amp;gt;&lt;br /&gt;
but GNU/make will just start dmake. You can also run the following in the &amp;lt;code&amp;gt;instetoo_native&amp;lt;/code&amp;gt; module:&lt;br /&gt;
&amp;lt;pre&amp;gt;build --all&amp;lt;/pre&amp;gt;&lt;br /&gt;
For details run:&lt;br /&gt;
&amp;lt;pre&amp;gt;build --help&amp;lt;/pre&amp;gt;}}&amp;lt;/ref&amp;gt;:&lt;br /&gt;
 dmake&lt;br /&gt;
&lt;br /&gt;
The building procedure will take at least an hour (on a 3 GHz Quad-Core with 8GB RAM).&lt;br /&gt;
&lt;br /&gt;
There are some special things in the way how OOo builds its modules. Every module has an “output” folder (with some subfolders for the different kinds of generated output) that is created the first time a build is done in the module. The name of this folder is “wntmsci10.pro” for builds with MSVC++2003, “wntmsci11.pro” for builds with MSVC++2005 and &amp;quot;wntmsci12.pro&amp;quot; for builds with MSVC++2008 (for the meaning of the &amp;quot;pro&amp;quot; extension see below). After a successful build of a module some of the generated files are copied to the output folder of the “solver” module by executing a tool called “deliver” (this is automatically called by build --all for each of the modules). Other modules will take these “delivered” files (header files, libraries etc.) to resolve their dependencies. The content of the solver module will also be used to pack the installation sets in the final step.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Tip|Using some not quite latest cygwin releases (1.5.18/1.5.19) can lead to tcsh freezing in places - the build will appear to hang. You can fix this by running &amp;#039;&amp;#039;ls /proc/$nnn/fd&amp;#039;&amp;#039; where $nnn is the number of the process. Or just run&lt;br /&gt;
&amp;lt;pre&amp;gt;ls /proc/*/fd&amp;lt;/pre&amp;gt;&lt;br /&gt;
to &amp;quot;unhang&amp;quot; the process. See {{Bug|51560}} for more info...}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Partial Builds =&lt;br /&gt;
There are two ways to do partial builds:&lt;br /&gt;
* compatible&lt;br /&gt;
* incompatible&lt;br /&gt;
Only do compatible partial builds if you know exactly what you are doing.&lt;br /&gt;
{{Documentation/Note|For more information, see [[Compatible Builds]].}}&lt;br /&gt;
== rebuilding from a module (incompatible build) ==&lt;br /&gt;
&lt;br /&gt;
If you decide to change a module in an incompatible way, you will need to rebuild all modules depending on it (directly or indirectly):&lt;br /&gt;
&lt;br /&gt;
 cd $SRC_ROOT/instsetoo_native&lt;br /&gt;
 build --from $INCOMPATIPLEMODULE --prepare&lt;br /&gt;
 build --from $INCOMPATIBLEMODULE&lt;br /&gt;
&lt;br /&gt;
== rebuilding a module (compatible build) ==&lt;br /&gt;
&lt;br /&gt;
To rebuild a module you can delete all output directories with, rebuild and redeliver into the solver with:&lt;br /&gt;
&lt;br /&gt;
 cd $MODULE&lt;br /&gt;
 build --from $MODULE --prepare&lt;br /&gt;
 build &amp;amp;&amp;amp; deliver&lt;br /&gt;
&lt;br /&gt;
A simple &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;$SRC_ROOT/instsetoo_native&amp;lt;/code&amp;gt; will recreate the installation sets, provided all other modules have already been build.&amp;lt;ref name=&amp;quot;Foot9&amp;quot;&amp;gt;{{Documentation/Caution|&amp;lt;code&amp;gt;build --all&amp;lt;/code&amp;gt; would rebuild changed/missing files. However, it does not check for incompatible modules. If unsure, use &amp;lt;code&amp;gt;build --from --prepare&amp;lt;/code&amp;gt;.}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Building a Module with Debug Information =&lt;br /&gt;
&lt;br /&gt;
To rebuild a module with debug information and additional assertions and checks, run:&lt;br /&gt;
&lt;br /&gt;
 cd $MODULE&lt;br /&gt;
 build --from $MODULE --prepare # removes old output trees and solver&lt;br /&gt;
 build debug=true --from $MODULE&lt;br /&gt;
&lt;br /&gt;
Drop the newly created binaries into an existing installation. Building an installation set with them will not help, as binaries are stripped on packing by default.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Tip|For details, see [[Windows Debugging]].}}&lt;br /&gt;
= Finding the Installation Sets =&lt;br /&gt;
After a successful build you will find the OOo installation set in &lt;br /&gt;
&lt;br /&gt;
 instsetoo_native/wntmscixx.pro/OpenOffice/msi/Install/en-US&lt;br /&gt;
&lt;br /&gt;
“instsetoo_native” is the module that packs the installation set.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Tip|If you already have a version of OOo installed you can install your freshly built version in parallel by installing it with setup /a that just unpacks all files without any system registration.}}&lt;br /&gt;
&lt;br /&gt;
= Tips And Tricks =&lt;br /&gt;
== ccache ==&lt;br /&gt;
For Windows: download from [http://artax.karlin.mff.cuni.cz/~kendy/ccache/ here], do the following:&lt;br /&gt;
&lt;br /&gt;
 export CCACHE_DIR=&amp;quot;some/place/with/space&amp;quot;&lt;br /&gt;
 ccache -M 2G -F 10000&lt;br /&gt;
 export CCACHE_CPP2=TRUE&lt;br /&gt;
 export CXX=&amp;quot;guw.pl ccache cl&amp;quot;&lt;br /&gt;
 # export USE_PCH=  if you experience trouble with precompiled headers&lt;br /&gt;
== dependencies ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;nodep&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you set the environment variable &amp;lt;code&amp;gt;nodep&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TRUE&amp;lt;/code&amp;gt;, then dependendy information files are not created - the build finishes faster.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution|But only enable that on a clean build. Once you have built OOo and then made modifications, unset the variable again to be on the safe side.}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NO_HIDS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Similar to the &amp;lt;code&amp;gt;nodep&amp;lt;/code&amp;gt; variable, this one prevents the generation of HIDs (Help IDs) that are mainly used for automated testing - if you only want to build OOo, you don&amp;#039;t need those.&lt;br /&gt;
&lt;br /&gt;
== parallel builds ==&lt;br /&gt;
If you have a multiprocessor machine or similar, you can run a parallel build. There are two levels  of parallelism  - one operating on makefile (directory) level, the other one on the global level. The two levels of parallelism result from the two-step build procedure in the OOo build environment. The build script runs through all the directories it reads from the build.lst files in all modules and calls dmake for every directory. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;parallelism on the global level&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For parallelism on the global level, you have to run build from &amp;lt;code&amp;gt;$SRC_ROOT&amp;gt;/instsetoo_native&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;-P&amp;lt;number&amp;gt;&amp;lt;/code&amp;gt; switch, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
build -P2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This takes build how many dmake processes it is allowd to start in parallel.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;parallelism on the directory level&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 export MAXPROCESS=&amp;lt;numer or processes&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This tells dmake how many targets it is allowed to build in parallel. When you don&amp;#039;t use build.pl but build a single directory (single makefile), you can achieve the same with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dmake -P2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;combining both levels&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to have parallelism on both levels, you can call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
build -P2 -- -P2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;--&amp;quot; is a special build.pl parameter that passes every further parameters to the dmake processes it starts.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; Recommendation &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Experience tells that using the doubled number of cores in your machine is a good choice, using more threads does not make a big difference, except if the combined option is chosen. So even on single core machines using two threads will speed up the build considerably.&lt;br /&gt;
&lt;br /&gt;
== create prebuilt mozilla ==&lt;br /&gt;
For the mozilla-components you have the choice to either build from mozilla sources, to use precompiled packages or to use system-mozilla (the one installed on your buildsystem, not everything might work, depending on the version you got installed).&lt;br /&gt;
You can easily create your own version of the prepacked binaries if you wish to do so (either because you cannot use the official ones because of mismatch of compiler version used to build them/other technical reasons or because you want to use stuff you didn&amp;#039;t build yourself).&lt;br /&gt;
To do so:&lt;br /&gt;
&lt;br /&gt;
* build the &amp;lt;code&amp;gt;moz&amp;lt;/code&amp;gt; module from the mozilla sources&lt;br /&gt;
* use &amp;lt;code&amp;gt;--enable-build-mozilla&amp;lt;/code&amp;gt; when running configure and put the mozilla-source tarball to &amp;lt;code&amp;gt;moz/download&amp;lt;/code&amp;gt;&lt;br /&gt;
* in &amp;lt;code&amp;gt;moz&amp;lt;/code&amp;gt; run &amp;lt;code&amp;gt;dmake zip&amp;lt;/code&amp;gt; to create the zip files&lt;br /&gt;
* you&amp;#039;ll find the zips in &amp;lt;code&amp;gt;{platform}.pro/zipped&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy them to a location of your liking.&lt;br /&gt;
Now instead of using &amp;lt;code&amp;gt;--enable-build-mozilla&amp;lt;/code&amp;gt;, use &amp;lt;code&amp;gt;--disable-build-mozilla&amp;lt;/code&amp;gt; and copy the zips you created or downloaded to &amp;lt;code&amp;gt;moz/zipped&amp;lt;/code&amp;gt; and these will be used when compiling.&lt;br /&gt;
This will greatly reduce build-time (you save the time that would otherwise be spent on compiling mozilla).&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
{{Template:Documentation/Note|For more information on building OOo on Windows see:&lt;br /&gt;
* [[Building on Windows (older releases)]]&lt;br /&gt;
* [[CPAN_install| Perl modules installation with CPAN]]&lt;br /&gt;
* [http://tools.openoffice.org/dev_docs/build_windows_tcsh.html Documentation on tools.openoffice.org]&lt;br /&gt;
* [http://website.openoffice.org/support/en/howtos/1.html#1 Documentation on website.openoffice.org]}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/Building_Guide/Building_on_Windows&amp;diff=169328</id>
		<title>Documentation/Building Guide/Building on Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/Building_Guide/Building_on_Windows&amp;diff=169328"/>
		<updated>2010-05-27T09:52:36Z</updated>

		<summary type="html">&lt;p&gt;Hjs: /* adding required files to the build tree */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation/Building Guide TOC&lt;br /&gt;
|ShowNextPage=none&lt;br /&gt;
|ShowPrevPage=none&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{DISPLAYTITLE:Building on Windows}}&lt;br /&gt;
[[Category:Windows]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Windows| This document explains how to build the OpenOffice.org source code on Windows systems.}}&lt;br /&gt;
&lt;br /&gt;
For building OpenOffice.org Cygwin is needed, a Windows program that emulates a complete Unix command line environment. To use this document you need to be familiar with a command line, but you need not to be a UNIX shell wizard.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Tip|If you have never used a Unix shell, you might want to take a look at the [http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html shell introduction at TLDP].}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|&amp;lt;code&amp;gt;$SRC_ROOT&amp;lt;/code&amp;gt; will denote the directory in which the source code of OpenOffice.org is stored.}}&lt;br /&gt;
{{Template:Documentation/Tip|You are advised to check the release notes for the release you are building to inform yourself about changes since previous releases.}}&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
== hardware requirements ==&lt;br /&gt;
&lt;br /&gt;
* 1 or more reasonable fast CPUs (x-way CPU recommended)&lt;br /&gt;
* 1 GB RAM (2 GB recommended)&lt;br /&gt;
* 10 GB free disk space (20 GB when debugging)&lt;br /&gt;
&lt;br /&gt;
== software requirements ==&lt;br /&gt;
* Windows XP/Vista&lt;br /&gt;
&lt;br /&gt;
The following table is placed here, so you can come back to it easily, when you want to use a link. The items are explained below. Here&amp;#039;s the list of files to download (with links) and the locations in the source tree where you must put them:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Where to get&lt;br /&gt;
! Place in&lt;br /&gt;
|-&lt;br /&gt;
| Cygwin: [http://www.cygwin.com Cygwin Toolkit with (dll version 1.5.10) or later]&lt;br /&gt;
| (default)&lt;br /&gt;
|-&lt;br /&gt;
| C/C++ Compiler: [http://www.microsoft.com/express/download/ Visual C++ 2008 Express Compiler (basic install, no optional parts required)]&lt;br /&gt;
| (default)&lt;br /&gt;
|-&lt;br /&gt;
| Java: [http://java.sun.com/javase/6/ JDK 1.6] for DEV300 milestones &amp;gt;= m37 and all OOo310 versions (older milestones will fail in the hsqldb module)&lt;br /&gt;
| (default)&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&amp;amp;displaylang=en Windows SDK for Windows Server 2008]&amp;lt;ref name=&amp;quot;Foot1&amp;quot;&amp;gt;{{Template:Documentation/Note|This also supported on Vista. This is either a DVD image or a net installer. You can either mount the DVD with a suitable tool, burn it do a DVD or use tools like winrar that can extract files from ISO files directly. You don&amp;#039;t need to install samples or documentation (saves a lot of disk space). It will also install the .NET Framework 3.5 SDK.&lt;br /&gt;
It might be best to install the Windows SDK into the default directory, and if not that into one without capital letters in the path. I used D:\Dev\Win_SDK\ and received some linking errors in the Python module (see {{Bug|88568}}).}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [http://www.microsoft.com/downloads/details.aspx?familyid=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&amp;amp;displaylang=en GDI+ Redistributable] (Genuine Windows Validation required)&lt;br /&gt;
| external/gdiplus&lt;br /&gt;
|-&lt;br /&gt;
| Only for OOo2.x but due to {{Bug|88652}} in configure still needed for 3.x: [http://download.microsoft.com/download/b/7/5/b75eace3-00e2-4aa0-9a6f-0b6882c71642/unicows.exe unicows.dll from (Microsoft Layer for Unicode)]&amp;lt;ref name=&amp;quot;Foot2&amp;quot;&amp;gt; {{Template:Documentation/Note|unicows.dll is available from the Microsoft site and needs to be saved to $SRC_ROOT/external/unicows. Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft&amp;#039;s website.}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| external/unicows&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=CD1FC4B2-0885-47F4-AF45-7FD5E14DB6C0 dbghelp.dll]&amp;lt;ref name=&amp;quot;Foot3&amp;quot;&amp;gt;{{Template:Documentation/Note|dbghelp.dll is available from the Microsoft site and needs to be saved to $SRC_ROOT/external/dbghelp. Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft&amp;#039;s website.}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| external/dbghelp&lt;br /&gt;
|-&lt;br /&gt;
| [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/NT45/EN-US/InstMsiW.exe instmsiw.exe] and [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/W9XMe/EN-US/InstMsiA.exe instmsia.exe]&lt;br /&gt;
| external/msi&lt;br /&gt;
|-&lt;br /&gt;
| for 2005 compiler and Seamonkey libraries from OpenOffice.org 3.2 up: msvcp80.dll and msvcr80.dll (found in c:\WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd/msvc &lt;br /&gt;
| external/msvcp80&lt;br /&gt;
|-&lt;br /&gt;
| for 2008 compiler (until DEV300 m22): msvcp90.dll and msvcr90.dll (found in $(msvcdir)\Vc\redist\x86\Microsoft.VC90.CRT) &lt;br /&gt;
| external/msvcp90&lt;br /&gt;
|-&lt;br /&gt;
| for 2008 compiler starting with DEV300m23: Microsoft_VC90_CRT_x86.msm and policy_9_0_Microsoft_VC90_CRT_x86.msm for non debug builds and Microsoft_VC90_DebugCRT_x86.msm and policy_9_0_Microsoft_VC90_DebugCRT_x86.msm for debug builds&amp;lt;ref name=&amp;quot;Foot4&amp;quot;&amp;gt; {{Template:Documentation/Note|You can find these files in your directory c:\program files\common files\merge modules}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
. These merge modules are available in VS08 Express Edition and VS08 Professional Edtion. All *.msm files are located at c:\Program Files\Common Files\Merge Module. &lt;br /&gt;
| external/msm90&lt;br /&gt;
|-&lt;br /&gt;
| [http://archive.apache.org/dist/ant/binaries Apache Ant (version 1.6.5 or later)]&lt;br /&gt;
| (default)&lt;br /&gt;
|-&lt;br /&gt;
| [http://tools.openoffice.org/moz_prebuild/OOo3.2 Mozilla binary distribution] &lt;br /&gt;
&lt;br /&gt;
(WNTMSCIruntime.zip,WNTMSCIlib.zip,WNTMSCIinc.zip)&lt;br /&gt;
| moz/zipped&lt;br /&gt;
|-&lt;br /&gt;
| msvcr71.dll and msvcp71.dll for Mozilla libraries (Search for them in the Web or on your PC. These files should be named as all lower case. Sometimes when downloaded they are upper case and this will cause &amp;#039;file not found&amp;#039; errors towards the end of the build))&lt;br /&gt;
| external/msvcp71 &lt;br /&gt;
|-&lt;br /&gt;
| optional: [http://nsis.sourceforge.net/ Nullsoft Scriptable Install System (NSIS)]&amp;lt;ref name=&amp;quot;Foot5&amp;quot;&amp;gt;{{Template:Documentation/Note|If NSIS is available, a self contained Windows installer is created in addition to the MSI installer files.}}&lt;br /&gt;
{{Template:Documentation/Caution|It used to be that newer version of NSIS broke the build (see {{Bug|85657}}), but it seems that it now works for NSIS up to 2.3.7.}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| optional: [http://msdn.microsoft.com/directx/directxdownloads/ Microsoft DirectX SDK]&amp;lt;ref name=&amp;quot;Foot6&amp;quot;&amp;gt; {{Template:Documentation/Note|If you don&amp;#039;t want to download it you can disable DirectX support in the configuration step (&amp;lt;code&amp;gt;--disable-directx&amp;lt;/code&amp;gt;).}}&lt;br /&gt;
{{Template:Documentation/Caution|Current (as of 2008/01) versions of the DirectX9 SDK and Windows Platform SDK do not fit to each other. To be able to build with DirextX enabled, you need to patch one file in the Platform SDK. See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID2743771 for details.}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution|Do not use a DirectX10 SDK!}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== adding required files to the build tree ===&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Tip|Some of the files can be found in a suitable OOo installation set also, so you can save the download by “stealing” it from your OOo installation.}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|OOo uses some Mozilla libraries. Building the corresponding sources is only possible with the VC2003 compiler so you have to use precompiled libraries that require the msvx71 libraries mentioned above. On Windows the Mozilla libraries are needed only for Mozilla address book support. Unfortunately a bug in the module dependencies makes it necessary that the Mozilla libaries are used anyway as otherwise building the module &amp;lt;tt&amp;gt;xmlsecurity&amp;lt;/tt&amp;gt; fails (see below).}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|The default cygwin version offered on http://www.cygwin.com/ now is 1.7.x. For current milestones it is recommended to use this version as it fixes the .dll remapping probelm (see below) and is required for builds on Windows 7. If you need to build old versions of the source code, check out http://www.cygwin.com/win-9x.html}}&lt;br /&gt;
&lt;br /&gt;
= Installation and Preparation of Build Tools =&lt;br /&gt;
== setting up cygwin ==&lt;br /&gt;
&lt;br /&gt;
Go to http://www.cygwin.com/ and download and install the current version.&lt;br /&gt;
{{Template:Documentation/Caution|Make sure that you keep the filetype set to “Unix/binary”.}}&lt;br /&gt;
&lt;br /&gt;
=== required additional packages ===&lt;br /&gt;
Cygwin consists of some basic and a lot of optional packages. As building OOo needs some of these optional packages you have to select them in the installer.&lt;br /&gt;
Here&amp;#039;s a complete list of the needed packages:&lt;br /&gt;
* Category Archive:&lt;br /&gt;
** unzip&lt;br /&gt;
** zip&lt;br /&gt;
* Category Devel :&lt;br /&gt;
** autoconf&lt;br /&gt;
** bison&lt;br /&gt;
** flex&lt;br /&gt;
** gcc-g++&lt;br /&gt;
** gperf&lt;br /&gt;
** make&lt;br /&gt;
** openssl-devel (only needed for perl modules for CWS tooling, see below)&lt;br /&gt;
** cvs (for 2.x code line and 3.0 code line) &lt;br /&gt;
** subversion (for 3.x code line, minimum version 1.5.5)&lt;br /&gt;
** readline&lt;br /&gt;
* Category Libs&lt;br /&gt;
** openssl&lt;br /&gt;
* Category Net&lt;br /&gt;
** openssh&lt;br /&gt;
** ncftp&lt;br /&gt;
* Category Perl&lt;br /&gt;
** perl&lt;br /&gt;
* Category Shells&lt;br /&gt;
** rxvt&lt;br /&gt;
* Category Utils&lt;br /&gt;
** patch&lt;br /&gt;
** gnupg&lt;br /&gt;
* Category Web&lt;br /&gt;
** lynx&lt;br /&gt;
** wget&lt;br /&gt;
{{Template:Documentation/Note|Unfortunately the list of packages mentioned at http://website.openoffice.org/support/en/howtos/1.html#1 is incomplete, some more are listed at http://tools.openoffice.org/dev_docs/build_windows_tcsh.html#BuildRequirements .}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|The installer will automatically check and download some more packages needed by thosed listed here. The whole process takes roughly 20 minutes.}}&lt;br /&gt;
&lt;br /&gt;
=== breaking links to executables ===&lt;br /&gt;
Within the Cygwin Toolkit, some executables might be symlinks: awk.exe and gunzip.exe, tar.exe (in older releases only). This can lead to a break of the build later, and the symlinks should be replaced by copies of the command they link to. &lt;br /&gt;
&lt;br /&gt;
To check this, execute:&lt;br /&gt;
&lt;br /&gt;
 ls -l /bin/awk.exe&lt;br /&gt;
&lt;br /&gt;
whether e.g. awk.exe is a symlink. In version 1.5.24-2 awk.exe is a link to gawk.exe. The shell will show this by putting out “awk.exe -&amp;gt; gawk.exe”. In this case gawk.exe must be copied to awk.exe by executing: &lt;br /&gt;
&lt;br /&gt;
 cd /bin&lt;br /&gt;
 rm awk.exe&lt;br /&gt;
 cp gawk.exe awk.exe&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In case you overlook something here or you have a newer Cygwin version with additional symlinks not mentioned here it&amp;#039;s not a problem. You will get a helpful error message about an existing link in the configuration step (configure) later. The message will tell you which link you have to remove and you can do it following the advice given above for the awk.exe/gawk.exe pair.&lt;br /&gt;
&lt;br /&gt;
=== installing additional perl modules in cygwin ===&lt;br /&gt;
As explained some perl modules must be installed with CPAN. The necessary command in the cygwin shell is&lt;br /&gt;
&lt;br /&gt;
 perl -MCPAN -e shell&lt;br /&gt;
&lt;br /&gt;
If this command is executed the first time CPAN will ask for configuration. Choose autoconfiguration. &lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution|Please note that CPAN is not able to deal with usernames containing spaces. To work around this fact, when CPAN asks you to specify the &amp;#039;&amp;#039;CPAN build and cache directory&amp;#039;&amp;#039;, change the default suggestion to &amp;lt;tt&amp;gt;/cpan&amp;lt;/tt&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
At the end the CPAN shell appeared and is ready to accept commands for installations. Each module is installed by typing &amp;lt;code&amp;gt;install $MODULENAME&amp;lt;/code&amp;gt;. The modules that must be installed are:&lt;br /&gt;
&lt;br /&gt;
* Archive::Zip&lt;br /&gt;
* XML::Parser (though it seems that this is already installed; doesn&amp;#039;t hurt to do it)&lt;br /&gt;
* URI&lt;br /&gt;
* LWP::UserAgent&lt;br /&gt;
* Crypt::SSLeay&lt;br /&gt;
* SOAP::Lite&lt;br /&gt;
&lt;br /&gt;
CPAN will detect if a selected module depends on other modules and it will offer to download them also. As explained please just confirm this.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Note|The last three modules are only needed if you want to use the cws tooling. These tools are necessary if you want to create and maintain your own [http://wiki.services.openoffice.org/wiki/CWS Child Workspaces] or if you want to build one of them. I recommend to install them anyway as sooner or later you want to work on a child workspace.}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution|I got an error message from CPAN somewhat like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\bin\cygiconv-2.dll to same&lt;br /&gt;
address as parent(0x7C0000) != 0x7D0000&amp;lt;/pre&amp;gt;&lt;br /&gt;
To fix this, I had to exit the Cygwin shell, run cmd.exe, then type &amp;quot;c:\cygwin\bin\ash.exe&amp;quot; to start the minimal shell, then type &amp;lt;code&amp;gt;/bin/rebaseall&amp;lt;/code&amp;gt;. Then CPAN worked when I ran it again.}}&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution| I got another error when cygwin was performing &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;ERROR: Can&amp;#039;t create &amp;#039;/usr/bin&amp;#039;; Do not have write permissions on &amp;#039;/usr/bin&amp;#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
I can actually write to /usr/bin; however when I do &amp;lt;tt&amp;gt;ls -ld /usr/bin&amp;lt;/tt&amp;gt;, cygwin reports no write permission; and &amp;lt;tt&amp;gt;chmod u+w /usr/bin&amp;lt;/tt&amp;gt; gives &amp;lt;tt&amp;gt;Permission denied&amp;lt;/tt&amp;gt;.  This causes the install process to fail when it checks permissions. As a kludge, I installed vim, and edited line 368 of /usr/lib/perl5/5.10/ExtUtils/Install.pm, replacing this:&lt;br /&gt;
&amp;lt;pre&amp;gt;return -w $dir;&amp;lt;/pre&amp;gt;&lt;br /&gt;
with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;return 1;&amp;lt;/pre&amp;gt;&lt;br /&gt;
which allowed installation to proceed.}}&lt;br /&gt;
&lt;br /&gt;
= Full Builds =&lt;br /&gt;
== configure ==&lt;br /&gt;
Finally the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; tool is used to create the environment. It checks that all software, hardware, and system requirements for the build are satisfied, and creates configuration files called winenv.set (for tcsh) and winenv.set.sh (for bash) that are used to set all necessary build environment variables. Before running configure, make sure that all needed programs are in the system path or start configure with the appropriate command line switches. If configure detects a problem it will stop and give you a useful hint how to fix it.&lt;br /&gt;
&lt;br /&gt;
You will find the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script in &amp;lt;code&amp;gt;$SRC_ROOT&amp;lt;/code&amp;gt;. The resulting configuration files are created there too.&lt;br /&gt;
&lt;br /&gt;
==== sample configure calls ====&lt;br /&gt;
&lt;br /&gt;
 ./configure \&lt;br /&gt;
  --disable-directx \&lt;br /&gt;
  --with-cl-home=&amp;quot;/cygdrive/d/develop/msvc/VC&amp;quot; \&lt;br /&gt;
  --disable-activex \&lt;br /&gt;
  --disable-atl \&lt;br /&gt;
  --disable-build-mozilla \&lt;br /&gt;
  --with-frame-home=&amp;quot;/cygdrive/d/develop/MSDK/v6.1&amp;quot; \&lt;br /&gt;
  --with-psdk-home=&amp;quot;/cygdrive/d/develop/MSDK/v6.1&amp;quot; \&lt;br /&gt;
  --with-midl-path=&amp;quot;/cygdrive/d/develop/MSDK/v6.1/Bin&amp;quot; \&lt;br /&gt;
  --with-asm-home=&amp;quot;/cygdrive/d/develop/msvc/VC&amp;quot; \&lt;br /&gt;
  --with-jdk-home=&amp;quot;/cygdrive/d/develop/j2sdk1.4.2_11&amp;quot; \&lt;br /&gt;
  --with-csc-path=&amp;quot;/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5&amp;quot; \&lt;br /&gt;
  --with-ant-home=/ant \&lt;br /&gt;
  --with-use-shell=bash&lt;br /&gt;
&lt;br /&gt;
 ./configure --disable-build-mozilla --with-use-shell=bash --disable-activex --with-win32&lt;br /&gt;
 --with-cl-home=&amp;quot;/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/VC&amp;quot;&lt;br /&gt;
 --with-midl-path=&amp;quot;/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1/Bin&amp;quot;&lt;br /&gt;
 --with-csc-path=&amp;quot;/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v3.5&amp;quot;&lt;br /&gt;
 --with-frame-home=&amp;quot;/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1&amp;quot;&lt;br /&gt;
 --with-asm-home=&amp;quot;/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/VC/Bin&amp;quot;&lt;br /&gt;
 --with-jdk-home=&amp;quot;/cygdrive/c/j2sdk1.4.2_11&amp;quot; .&lt;br /&gt;
 --disable-directx --disable-epm&lt;br /&gt;
 --with-ant-home=/cygdrive/c/apache-ant-1.6.5&lt;br /&gt;
 --with-psdk-home=&amp;quot;/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== configure settings tips ====&lt;br /&gt;
{{Template:Documentation/Caution|Make sure that the &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; variable in your cygwin shell does not contain any blanks and quotes.}}&lt;br /&gt;
{{Template:Documentation/Caution|Paths might have problems with spaces. Install requirements into pathes without them. Alternatively, feel free to install the various packages using the default path containing spaces and then use the mixed short path for the configure stage. The mixed short path can be obtained using Cygwin&amp;#039;s cygpath tool, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ cygpath -m -s &amp;quot;c:\Program Files\Microsoft Visual Studio 9.0\VC&amp;quot;&lt;br /&gt;
 c:/PROGRA~1/MICROS~1.0/VC&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;with-psdk-home&amp;lt;/code&amp;gt; setting needs a case-sensitive path name. I recommend to use case-sensitive usage in all cases - it&amp;#039;s good to get used to case sensitivity if you are going to work with Cygwin.}}&lt;br /&gt;
{{Template:Documentation/Caution|Beware of using &amp;lt;code&amp;gt;/c/&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;/cygdrive/c/&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Caution|Avoid trailing slashes in configure parameters. They sure cause problems for &amp;lt;code&amp;gt;--with-psdk-home&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Note|Paths to dependencies might be different for your installation. The pathes containing &amp;quot;msvc&amp;quot; and &amp;quot;msdk&amp;quot; should be self-explanatory.}}&lt;br /&gt;
{{Template:Documentation/Tip|There are a number of options that you can use with the configure script. To display these options, type the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
{{Template:Documentation/Tip|If you run into problems with early DEV300 releases, check your settings in winenv.set.sh for &amp;lt;code&amp;gt;WINDOWS_VISTA_PSDK&amp;lt;/code&amp;gt; to be set &amp;lt;code&amp;gt;TRUE&amp;lt;/code&amp;gt;. This is important if &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; fails to detect the Windows platform SDK version correctly. The detection failure results from the way how configure searches for the Vista PSDK in older releases: it will be found only if it is installed into the default location.}} &lt;br /&gt;
{{Template:Documentation/Tip|If you run into problems compiling on an &amp;quot;Express Edition&amp;quot; with early DEV300 releases, check your settings in winenv.set.sh for &amp;lt;code&amp;gt;DISABLE_ATL&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;DISABLE_ACTIVEX&amp;lt;/code&amp;gt;: all have to be set &amp;lt;code&amp;gt;TRUE&amp;lt;/code&amp;gt;. Visual Studio Express compilers do not contain everything needed to build the OOo ActiveX control, OLE automation and native Windows OLE support, so disable support for them. A &amp;quot;complete&amp;quot; Visual Studio (no “Express” version) is not limited in that way.}}&lt;br /&gt;
{{Template:Documentation/Tip|As DirectX is not needed for most developers, its SDK consumes a lot of disk space and is prone to incompatibilities I recommend to build without DirecX support by using &amp;lt;code&amp;gt;--disable-directx&amp;lt;/code&amp;gt; as shown above. Otherwise you have to provide the path to the SDK in &amp;lt;code&amp;gt;--with-directx-home&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Tip|OOo uses some Mozilla components. It is not possible to build them from the sources using the Visual Studio 2005 compiler. Disabling the Mozilla components with &amp;lt;code&amp;gt;--disable-mozilla&amp;lt;/code&amp;gt; completely currently does might not work due to a bug in the module dependencies.}}&lt;br /&gt;
{{Template:Documentation/Tip|If you experiment with the newest sources, mind that it can happen sometimes that &amp;lt;code&amp;gt;configure.in&amp;lt;/code&amp;gt; was updated, but it was forgotten to update configure too. The configure script itself is created from &amp;lt;code&amp;gt;configure.in&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;autoreconf&amp;lt;/code&amp;gt; command. The perl script &amp;lt;code&amp;gt;set_soenv&amp;lt;/code&amp;gt; is created when you run configure from &amp;lt;code&amp;gt;set_soenv.in&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Tip|csc.exe comes from the &amp;lt;code&amp;gt;c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322&amp;lt;/code&amp;gt; directory, you might need &amp;lt;code&amp;gt;--with-csc-path&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
{{Template:Documentation/Tip|If you fail to getting together a working installation of Cygwin, one possibility is to use a known-to-work combination of Cygwin packages, i.e. a direct copy of some other user&amp;#039;s Cygwin tree. [[User:TorLillqvist]] has such a tree (from late 2006) zipped up at http://download.go-oo.org/tstnvl/tml/tml-cygwin.zip . Don&amp;#039;t hesitate to ask for advice if necessary.}}&lt;br /&gt;
&lt;br /&gt;
== bootstrap ==&lt;br /&gt;
After running configure you must create the dmake make utility that is needed for the build of OpenOffice.org. This done from the SRC_ROOT directory by calling&lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
== setting the enviroment ==&lt;br /&gt;
&lt;br /&gt;
When the configure script has been run successfully a file &amp;lt;code&amp;gt;winenv.Set.sh&amp;lt;/code&amp;gt; was created&amp;lt;ref name=&amp;quot;Foot7&amp;quot;&amp;gt;{{Template:Documentation/Note|When you want to use tcsh instead of bash, you will need to use the file &amp;lt;code&amp;gt;winenv.Set&amp;lt;/code&amp;gt; instead:&lt;br /&gt;
&amp;lt;pre&amp;gt; source winenv.Set&lt;br /&gt;
 rehash&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you do not use tcsh, it is better to delete that file, as it will get in the way for tab-completion sooner or later.}}&amp;lt;/ref&amp;gt;. Do this:&lt;br /&gt;
&lt;br /&gt;
 source winenv.Set.sh&lt;br /&gt;
&lt;br /&gt;
to set up the enviroment for the build.&lt;br /&gt;
&lt;br /&gt;
== starting the build ==&lt;br /&gt;
Build the software by typing the following in &amp;lt;code&amp;gt;$SRC_ROOT&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;Foot8&amp;quot;&amp;gt;{{Template:Documentation/Note|You can also run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&amp;lt;/pre&amp;gt;&lt;br /&gt;
but GNU/make will just start dmake. You can also run the following in the &amp;lt;code&amp;gt;instetoo_native&amp;lt;/code&amp;gt; module:&lt;br /&gt;
&amp;lt;pre&amp;gt;build --all&amp;lt;/pre&amp;gt;&lt;br /&gt;
For details run:&lt;br /&gt;
&amp;lt;pre&amp;gt;build --help&amp;lt;/pre&amp;gt;}}&amp;lt;/ref&amp;gt;:&lt;br /&gt;
 dmake&lt;br /&gt;
&lt;br /&gt;
The building procedure will take at least an hour (on a 3 GHz Quad-Core with 8GB RAM).&lt;br /&gt;
&lt;br /&gt;
There are some special things in the way how OOo builds its modules. Every module has an “output” folder (with some subfolders for the different kinds of generated output) that is created the first time a build is done in the module. The name of this folder is “wntmsci10.pro” for builds with MSVC++2003, “wntmsci11.pro” for builds with MSVC++2005 and &amp;quot;wntmsci12.pro&amp;quot; for builds with MSVC++2008 (for the meaning of the &amp;quot;pro&amp;quot; extension see below). After a successful build of a module some of the generated files are copied to the output folder of the “solver” module by executing a tool called “deliver” (this is automatically called by build --all for each of the modules). Other modules will take these “delivered” files (header files, libraries etc.) to resolve their dependencies. The content of the solver module will also be used to pack the installation sets in the final step.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Tip|Using some not quite latest cygwin releases (1.5.18/1.5.19) can lead to tcsh freezing in places - the build will appear to hang. You can fix this by running &amp;#039;&amp;#039;ls /proc/$nnn/fd&amp;#039;&amp;#039; where $nnn is the number of the process. Or just run&lt;br /&gt;
&amp;lt;pre&amp;gt;ls /proc/*/fd&amp;lt;/pre&amp;gt;&lt;br /&gt;
to &amp;quot;unhang&amp;quot; the process. See {{Bug|51560}} for more info...}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Partial Builds =&lt;br /&gt;
There are two ways to do partial builds:&lt;br /&gt;
* compatible&lt;br /&gt;
* incompatible&lt;br /&gt;
Only do compatible partial builds if you know exactly what you are doing.&lt;br /&gt;
{{Documentation/Note|For more information, see [[Compatible Builds]].}}&lt;br /&gt;
== rebuilding from a module (incompatible build) ==&lt;br /&gt;
&lt;br /&gt;
If you decide to change a module in an incompatible way, you will need to rebuild all modules depending on it (directly or indirectly):&lt;br /&gt;
&lt;br /&gt;
 cd $SRC_ROOT/instsetoo_native&lt;br /&gt;
 build --from $INCOMPATIPLEMODULE --prepare&lt;br /&gt;
 build --from $INCOMPATIBLEMODULE&lt;br /&gt;
&lt;br /&gt;
== rebuilding a module (compatible build) ==&lt;br /&gt;
&lt;br /&gt;
To rebuild a module you can delete all output directories with, rebuild and redeliver into the solver with:&lt;br /&gt;
&lt;br /&gt;
 cd $MODULE&lt;br /&gt;
 build --from $MODULE --prepare&lt;br /&gt;
 build &amp;amp;&amp;amp; deliver&lt;br /&gt;
&lt;br /&gt;
A simple &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;$SRC_ROOT/instsetoo_native&amp;lt;/code&amp;gt; will recreate the installation sets, provided all other modules have already been build.&amp;lt;ref name=&amp;quot;Foot9&amp;quot;&amp;gt;{{Documentation/Caution|&amp;lt;code&amp;gt;build --all&amp;lt;/code&amp;gt; would rebuild changed/missing files. However, it does not check for incompatible modules. If unsure, use &amp;lt;code&amp;gt;build --from --prepare&amp;lt;/code&amp;gt;.}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Building a Module with Debug Information =&lt;br /&gt;
&lt;br /&gt;
To rebuild a module with debug information and additional assertions and checks, run:&lt;br /&gt;
&lt;br /&gt;
 cd $MODULE&lt;br /&gt;
 build --from $MODULE --prepare # removes old output trees and solver&lt;br /&gt;
 build debug=true --from $MODULE&lt;br /&gt;
&lt;br /&gt;
Drop the newly created binaries into an existing installation. Building an installation set with them will not help, as binaries are stripped on packing by default.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Tip|For details, see [[Windows Debugging]].}}&lt;br /&gt;
= Finding the Installation Sets =&lt;br /&gt;
After a successful build you will find the OOo installation set in &lt;br /&gt;
&lt;br /&gt;
 instsetoo_native/wntmscixx.pro/OpenOffice/msi/Install/en-US&lt;br /&gt;
&lt;br /&gt;
“instsetoo_native” is the module that packs the installation set.&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Tip|If you already have a version of OOo installed you can install your freshly built version in parallel by installing it with setup /a that just unpacks all files without any system registration.}}&lt;br /&gt;
&lt;br /&gt;
= Tips And Tricks =&lt;br /&gt;
== ccache ==&lt;br /&gt;
For Windows: download from [http://artax.karlin.mff.cuni.cz/~kendy/ccache/ here], do the following:&lt;br /&gt;
&lt;br /&gt;
 export CCACHE_DIR=&amp;quot;some/place/with/space&amp;quot;&lt;br /&gt;
 ccache -M 2G -F 10000&lt;br /&gt;
 export CCACHE_CPP2=TRUE&lt;br /&gt;
 export CXX=&amp;quot;guw.pl ccache cl&amp;quot;&lt;br /&gt;
 # export USE_PCH=  if you experience trouble with precompiled headers&lt;br /&gt;
== dependencies ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;nodep&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you set the environment variable &amp;lt;code&amp;gt;nodep&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TRUE&amp;lt;/code&amp;gt;, then dependendy information files are not created - the build finishes faster.&lt;br /&gt;
&lt;br /&gt;
{{Template:Documentation/Caution|But only enable that on a clean build. Once you have built OOo and then made modifications, unset the variable again to be on the safe side.}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NO_HIDS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Similar to the &amp;lt;code&amp;gt;nodep&amp;lt;/code&amp;gt; variable, this one prevents the generation of HIDs (Help IDs) that are mainly used for automated testing - if you only want to build OOo, you don&amp;#039;t need those.&lt;br /&gt;
&lt;br /&gt;
== parallel builds ==&lt;br /&gt;
If you have a multiprocessor machine or similar, you can run a parallel build. There are two levels  of parallelism  - one operating on makefile (directory) level, the other one on the global level. The two levels of parallelism result from the two-step build procedure in the OOo build environment. The build script runs through all the directories it reads from the build.lst files in all modules and calls dmake for every directory. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;parallelism on the global level&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For parallelism on the global level, you have to run build from &amp;lt;code&amp;gt;$SRC_ROOT&amp;gt;/instsetoo_native&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;-P&amp;lt;number&amp;gt;&amp;lt;/code&amp;gt; switch, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
build -P2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This takes build how many dmake processes it is allowd to start in parallel.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;parallelism on the directory level&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 export MAXPROCESS=&amp;lt;numer or processes&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This tells dmake how many targets it is allowed to build in parallel. When you don&amp;#039;t use build.pl but build a single directory (single makefile), you can achieve the same with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dmake -P2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;combining both levels&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to have parallelism on both levels, you can call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
build -P2 -- -P2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;--&amp;quot; is a special build.pl parameter that passes every further parameters to the dmake processes it starts.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; Recommendation &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Experience tells that using the doubled number of cores in your machine is a good choice, using more threads does not make a big difference, except if the combined option is chosen. So even on single core machines using two threads will speed up the build considerably.&lt;br /&gt;
&lt;br /&gt;
== create prebuilt mozilla ==&lt;br /&gt;
For the mozilla-components you have the choice to either build from mozilla sources, to use precompiled packages or to use system-mozilla (the one installed on your buildsystem, not everything might work, depending on the version you got installed).&lt;br /&gt;
You can easily create your own version of the prepacked binaries if you wish to do so (either because you cannot use the official ones because of mismatch of compiler version used to build them/other technical reasons or because you want to use stuff you didn&amp;#039;t build yourself).&lt;br /&gt;
To do so:&lt;br /&gt;
&lt;br /&gt;
* build the &amp;lt;code&amp;gt;moz&amp;lt;/code&amp;gt; module from the mozilla sources&lt;br /&gt;
* use &amp;lt;code&amp;gt;--enable-build-mozilla&amp;lt;/code&amp;gt; when running configure and put the mozilla-source tarball to &amp;lt;code&amp;gt;moz/download&amp;lt;/code&amp;gt;&lt;br /&gt;
* in &amp;lt;code&amp;gt;moz&amp;lt;/code&amp;gt; run &amp;lt;code&amp;gt;dmake zip&amp;lt;/code&amp;gt; to create the zip files&lt;br /&gt;
* you&amp;#039;ll find the zips in &amp;lt;code&amp;gt;{platform}.pro/zipped&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy them to a location of your liking.&lt;br /&gt;
Now instead of using &amp;lt;code&amp;gt;--enable-build-mozilla&amp;lt;/code&amp;gt;, use &amp;lt;code&amp;gt;--disable-build-mozilla&amp;lt;/code&amp;gt; and copy the zips you created or downloaded to &amp;lt;code&amp;gt;moz/zipped&amp;lt;/code&amp;gt; and these will be used when compiling.&lt;br /&gt;
This will greatly reduce build-time (you save the time that would otherwise be spent on compiling mozilla).&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
{{Template:Documentation/Note|For more information on building OOo on Windows see:&lt;br /&gt;
* [[Building on Windows (older releases)]]&lt;br /&gt;
* [[CPAN_install| Perl modules installation with CPAN]]&lt;br /&gt;
* [http://tools.openoffice.org/dev_docs/build_windows_tcsh.html Documentation on tools.openoffice.org]&lt;br /&gt;
* [http://website.openoffice.org/support/en/howtos/1.html#1 Documentation on website.openoffice.org]}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Build_Environment_Effort/ToDo&amp;diff=161499</id>
		<title>Build Environment Effort/ToDo</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Build_Environment_Effort/ToDo&amp;diff=161499"/>
		<updated>2010-03-29T17:48:17Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Build Environment Effort}}&lt;br /&gt;
* create runnable instance of OOo in solver&lt;br /&gt;
** solver becomes incrementally filled office tree&lt;br /&gt;
** libraries can be executed from solver&lt;br /&gt;
** UNO services are registered from text files&lt;br /&gt;
** configurable place for solver&lt;br /&gt;
* build should not modify source tree&lt;br /&gt;
** configurable place for output directories&lt;br /&gt;
* platform independent help content&lt;br /&gt;
* evaluate integration of OOo SDK and OOo build environments&lt;br /&gt;
* find a way to move out localization completely (localize only strings, not resources)&lt;br /&gt;
** which resource types can be localized&lt;br /&gt;
** which of them do we localize &lt;br /&gt;
** find replacements for all non-string types&lt;br /&gt;
** do we have the best file format for localizations?&lt;br /&gt;
* get rid of STLPORT&lt;br /&gt;
* merge the different ways to configure a build environment (&amp;quot;configure&amp;quot;,&amp;quot;setsolar&amp;quot;(Sun))&lt;br /&gt;
* get rid of HID.LST&lt;br /&gt;
* get rid of superfluous compiler switches, check &amp;quot;noopt&amp;quot; directives&lt;br /&gt;
* always enable exceptions, check if removing of throw() directives (to limit code size) is possible&lt;br /&gt;
* get rid of service registration in packing process&lt;br /&gt;
* don&amp;#039;t use image modules for rsc compilation, use list in solver instead&lt;br /&gt;
* move external tarballs out of the code repository ([[External_source_tarballs#Where_are_those_tarballs| check here]])&lt;br /&gt;
&lt;br /&gt;
[[Category:To-Do]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Build_Environment_Effort/External_source_tarballs&amp;diff=161498</id>
		<title>Build Environment Effort/External source tarballs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Build_Environment_Effort/External_source_tarballs&amp;diff=161498"/>
		<updated>2010-03-29T17:31:01Z</updated>

		<summary type="html">&lt;p&gt;Hjs: Created page with &amp;#039;== Integration of external source tarballs in our build process  ==  === General assumptions  ===  Most available tarballs can be built (theoretically) by following three steps: …&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Integration of external source tarballs in our build process  ==&lt;br /&gt;
&lt;br /&gt;
=== General assumptions  ===&lt;br /&gt;
&lt;br /&gt;
Most available tarballs can be built (theoretically) by following three steps: &lt;br /&gt;
&lt;br /&gt;
#unpack &lt;br /&gt;
#configure &lt;br /&gt;
#build&lt;br /&gt;
&lt;br /&gt;
Taking this as the generic way some targets are implemented in our makefiles to ease the integration of external projects. &lt;br /&gt;
&lt;br /&gt;
=== What can be done?  ===&lt;br /&gt;
&lt;br /&gt;
With a single dmake you can unpack, patch, configure and build an alien tarball, provided that the according makefile.mk is correct. Each of these steps is skipped when run successfully once. The files in &amp;quot;&amp;amp;lt;module&amp;amp;gt;/&amp;amp;lt;platform&amp;amp;gt;/misc/build&amp;quot; reflect the already done parts and can be deleted to force rerunning a particular step. &lt;br /&gt;
&lt;br /&gt;
Additionally there are some targets for common use actions which can be used with &amp;quot;dmake TARGET&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
*create_clean: unpack tarball without modifying it.&lt;br /&gt;
&lt;br /&gt;
*patch: apply the patchfiles from &amp;quot;&amp;#039;&amp;#039;PATCH_FILES&amp;#039;&amp;#039;&amp;quot; to source tree. The tree is created if not already existing.&lt;br /&gt;
&lt;br /&gt;
*create_patch: a patchfile (named &amp;lt;tarball basename&amp;gt;-newpatch-rename_me +.patch) is created, reflecting all new changes to files from the tarball, done additionally to previous patches. Note that you still have to give that patch a sensible name and add it to PATCH_FILES Additional files have to be set in the variable &amp;quot;ADDITIONAL_FILES&amp;quot; to get into the patch.&lt;br /&gt;
&lt;br /&gt;
=== Where are those tarballs?  ===&lt;br /&gt;
&lt;br /&gt;
With the integration of the {{CWS|ause110}} the tarballs no longer reside in the source code repository. Setting up a build environment will set an environment variable named TARFILE_LOCATION. For solving problems with unversioned source archives, files are stored as &amp;quot;&amp;amp;lt;md5-checksum&amp;amp;gt;-tarfilename&amp;quot; (see also TARFILE_MD5 in the example). &lt;br /&gt;
&lt;br /&gt;
To initially fill this directory, a script called &amp;#039;&amp;#039;fetch_tarballs.sh&amp;#039;&amp;#039; is called. The only parameter is the list of all required tarfiles for this specific revision, found in the repository root. Thus &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;fetch_tarballs.sh ooo.lst&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
checks for the required tarballs and downloads them from the URL given in the first line of this list. This step by default is done in the bootstrap step of setting up an environment. &lt;br /&gt;
&lt;br /&gt;
To get new archives to the download directory, please contact [mailto://mh@openoffice.org Martin Hollmichel].&lt;br /&gt;
&lt;br /&gt;
=== What&amp;#039;s missing?  ===&lt;br /&gt;
&lt;br /&gt;
*Dependencies are only between the supported steps or tarball internal.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;span style=&amp;quot;text-decoration: none;&amp;quot;&amp;gt;Known feature like &amp;quot;dmake&amp;lt;/span&amp;gt; debug&amp;quot; only work in modules that add dmake makefiles to build the external sources.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*switching to a gcc environment on win32 .&lt;br /&gt;
&lt;br /&gt;
*external projects are build as one job. There is no parallelization the build the external project -- this might create a bottleneck for highly parallelized builds, if the external project is big.&lt;br /&gt;
&lt;br /&gt;
=== How to write a makefile.mk for an external tarball  ===&lt;br /&gt;
&lt;br /&gt;
This example is taken from the so_berkeley project. &lt;br /&gt;
&lt;br /&gt;
 #*************************************************************************&lt;br /&gt;
 &lt;br /&gt;
 PRJ=.&lt;br /&gt;
 &lt;br /&gt;
 PRJNAME=so_berkeleydb&lt;br /&gt;
 TARGET=so_berkeleydb&lt;br /&gt;
 &lt;br /&gt;
 # --- Settings&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 .INCLUDE : settings.mk&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # --- Files&lt;br /&gt;
 &lt;br /&gt;
 # Basename of the tarball which is supposed to reside in a direcrory named pointed to by the environment variable TARFILE_LOCATION. &lt;br /&gt;
 TARFILE_NAME=db-3.2.9&lt;br /&gt;
 &lt;br /&gt;
 # md5 checksum of the tarball &lt;br /&gt;
 TARFILE_MD5=d70951c80dabecc2892c919ff5d07172&lt;br /&gt;
 &lt;br /&gt;
 # Name of the patch file if needed. Used to apply patches to the original tarball needed &lt;br /&gt;
 # to build (e.g. for win32...). &lt;br /&gt;
 &lt;br /&gt;
 PATCH_FILES=db-3.2.9.patch&lt;br /&gt;
 &lt;br /&gt;
 .IF &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # sometimes it makes sense to call the configure command from a different directory. &lt;br /&gt;
 CONFIGURE_DIR=out&lt;br /&gt;
 &lt;br /&gt;
 #relative to CONFIGURE_DIR&lt;br /&gt;
 &lt;br /&gt;
 # command to configure package and switches. If no &amp;quot;CONFIGURE_ACTION&amp;quot; is supplied &lt;br /&gt;
 # all other configure variables are ignored. &lt;br /&gt;
 &lt;br /&gt;
 CONFIGURE_ACTION=..$/dist$/configure&lt;br /&gt;
 &lt;br /&gt;
 CONFIGURE_FLAGS=--enable-cxx --enable-java --enable-dynamic --enable-shared&lt;br /&gt;
 &lt;br /&gt;
 # same as with configure. &lt;br /&gt;
 BUILD_DIR=$(CONFIGURE_DIR)&lt;br /&gt;
 BUILD_ACTION=make&lt;br /&gt;
 &lt;br /&gt;
 # copy libraries to the &amp;quot;lib&amp;quot; directory in the local output tree known from own projects. &lt;br /&gt;
 OUT2LIB=$(BUILD_DIR)$/.libs$/libdb*.so&lt;br /&gt;
 &lt;br /&gt;
 # same as above. copy to $(BIN) &lt;br /&gt;
 OUT2BIN=java$/classes$/db.jar&lt;br /&gt;
 &lt;br /&gt;
 .ENDIF # &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 .IF &amp;quot;$(GUI)&amp;quot;==&amp;quot;WNT&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 BUILD_DIR=build_win32 &lt;br /&gt;
 &lt;br /&gt;
 # build a msdev project without GUI. &lt;br /&gt;
 BUILD_ACTION=msdev Berkeley_DB.dsw /useenv /MAKE &amp;quot;db_buildall - RELEASE&amp;quot; /MAKE &amp;quot;db_java - RELEASE&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 OUT2BIN=java$/classes$/db.jar \&lt;br /&gt;
     $(BUILD_DIR)$/Release$/libdb_java32.dll \&lt;br /&gt;
     $(BUILD_DIR)$/Release$/libdb32.dll&lt;br /&gt;
 &lt;br /&gt;
 OUT2LIB= \&lt;br /&gt;
     $(BUILD_DIR)$/Release$/libdb_java32.lib \&lt;br /&gt;
     $(BUILD_DIR)$/Release$/libdb32.lib&lt;br /&gt;
 &lt;br /&gt;
 .ENDIF # &amp;quot;$(GUI)&amp;quot;==&amp;quot;WNT&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # make the created patch contain the new files comments.txt &lt;br /&gt;
 ADDITIONAL_FILES= build_w32$/comment.txt&lt;br /&gt;
 &lt;br /&gt;
 OUT2INC= \&lt;br /&gt;
     $(BUILD_DIR)$/db.h \&lt;br /&gt;
     include$/db_185.h \&lt;br /&gt;
     include$/db_cxx.h&lt;br /&gt;
 &lt;br /&gt;
 OUT2CLASS=java$/classes$/db.jar&lt;br /&gt;
 &lt;br /&gt;
 # --- Targets&lt;br /&gt;
 &lt;br /&gt;
 # contains some nessecary variables. &lt;br /&gt;
 .INCLUDE : set_ext.mk&lt;br /&gt;
 .INCLUDE : target.mk&lt;br /&gt;
 &lt;br /&gt;
 # contains the &amp;quot;magic&amp;quot; to create targets out of the set variables. &lt;br /&gt;
 .INCLUDE : tg_ext.mk&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[Category:Build_System]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Extensions_packing&amp;diff=82237</id>
		<title>Extensions packing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Extensions_packing&amp;diff=82237"/>
		<updated>2008-06-09T12:58:59Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
&lt;br /&gt;
=== Packing Extensions in OOo Environment ===&lt;br /&gt;
&lt;br /&gt;
Packing of extensions normally consists of creating a tree containing a stucture holding all the desired files in the and packing them into a .oxt via the zip command. Since the reqirements of this structure and the packing itself is quite similar for most extensions, the OOo build environment now (DEV300_m18) has a couple of helping targets to ease that process.&lt;br /&gt;
&lt;br /&gt;
== The Sample ==&lt;br /&gt;
&lt;br /&gt;
The module &amp;quot;solenv&amp;quot; contains a sample makefile which shows how to make use of the new features ([http://tools.openoffice.org/source/browse/tools/solenv/inc/templates/extension_tmpl.mk?view=markup extension_tmpl.mk]). NOTE: not all of this is required for every extension. It&amp;#039;s just a commented example which has to be stripped and modified according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Behind the Scene ==&lt;br /&gt;
&lt;br /&gt;
Some of the centralized targets do some hidden things that previously had to be specified for each and every extension. currently this is&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;description.xml&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** inserting the according tags for license files: the perl script licinserter.pl in solenv/bin uses the existing tag&lt;br /&gt;
            &amp;lt;license-text xlink:href=&amp;quot;licensefile&amp;quot; lang=&amp;quot;isocode&amp;quot; license-id=&amp;quot;lic-isocode&amp;quot;/&amp;gt;&lt;br /&gt;
:: to insert the multiple license tags containing the required lanaguage and filename&lt;br /&gt;
:* string replacements to create platform dependent tags&lt;br /&gt;
::* UPDATED_SUPPORTED_PLATFORM -&amp;gt; $(PLATFORMID) (settings.mk) -&amp;gt; $(RTL_OS:l)_$(RTL_ARCH:l) (rtlbootstrap.mk)&lt;br /&gt;
::* UPDATED_IDENTIFIER -&amp;gt; com.sun.star.$(EXTENSIONNAME)-$(PLATFORMID) (extensions_post.mk)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;manifest.xml&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** string replacements for binary extension&lt;br /&gt;
*** SHARED_EXTENSION -&amp;gt; $(DLLPOST) (see according platform .mk)&lt;br /&gt;
*** EXEC_EXTENSION -&amp;gt; $(EXECPOST) (see according platform .mk)&lt;br /&gt;
** there is also a quite beta scripting to automate the .xcu list in manifest.xml&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;if COMPONENT_LIBRARIES is defined&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** copy the compiler runtime libraries on windows into the tree to pack&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Extensions_packing&amp;diff=82233</id>
		<title>Extensions packing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Extensions_packing&amp;diff=82233"/>
		<updated>2008-06-09T12:17:14Z</updated>

		<summary type="html">&lt;p&gt;Hjs: New page: {{Extensions}}  === Packing Extensions in OOo Environment ===  Packing of extensions normally consists of creating a tree containing a stucture holding all the desired files in the and pac...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
&lt;br /&gt;
=== Packing Extensions in OOo Environment ===&lt;br /&gt;
&lt;br /&gt;
Packing of extensions normally consists of creating a tree containing a stucture holding all the desired files in the and packing them into a .oxt via the zip command. Since the reqirements of this structure and the packing itself is quite similar for most extensions, the OOo build environment now (DEV300_m18) has a couple of helping targets to ease that process.&lt;br /&gt;
&lt;br /&gt;
== The Sample ==&lt;br /&gt;
&lt;br /&gt;
The module &amp;quot;solenv&amp;quot; contains a sample makefile which show how to make use of the new features ([http://tools.openoffice.org/source/browse/tools/solenv/inc/templates/extension_tmpl.mk?view=markup extension_tmpl.mk]). NOTE: not all of this is required for every extension. It&amp;#039;s just a commented example which has to be stripped and modified according to your needs.&lt;br /&gt;
&lt;br /&gt;
== Behind the Scene ==&lt;br /&gt;
&lt;br /&gt;
Some of the centralized targets do some hidden things that previously had to be specified for each and every extension. currently this is&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;description.xml&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** inserting the according tags for license files: the perl script licinserter.pl in solenv/bin uses the existing tag&lt;br /&gt;
            &amp;lt;license-text xlink:href=&amp;quot;licensefile&amp;quot; lang=&amp;quot;isocode&amp;quot; license-id=&amp;quot;lic-isocode&amp;quot;/&amp;gt;&lt;br /&gt;
:: to insert the multiple license tags containing the required lanaguage and filename&lt;br /&gt;
:* string replacements to create platform dependent tags&lt;br /&gt;
::* UPDATED_SUPPORTED_PLATFORM -&amp;gt; $(PLATFORMID) (settings.mk) -&amp;gt; $(RTL_OS:l)_$(RTL_ARCH:l) (rtlbootstrap.mk)&lt;br /&gt;
::* UPDATED_IDENTIFIER -&amp;gt; com.sun.star.$(EXTENSIONNAME)-$(PLATFORMID) (extensions_post.mk)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;manifest.xml&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** string replacements for binary extension&lt;br /&gt;
*** SHARED_EXTENSION -&amp;gt; $(DLLPOST) (see according platform .mk)&lt;br /&gt;
*** EXEC_EXTENSION -&amp;gt; $(EXECPOST) (see according platform .mk)&lt;br /&gt;
** there is also a quite beta scripting to automate the .xcu list in manifest.xml&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;if COMPONENT_LIBRARIES is defined&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** copy the compiler runtime libraries on windows into the tree to pack&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=RedTinderboxStatusInEIS&amp;diff=30783</id>
		<title>RedTinderboxStatusInEIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=RedTinderboxStatusInEIS&amp;diff=30783"/>
		<updated>2007-04-25T16:16:52Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Since some time [[EIS]] now has a status overview about tinderbox builds on [[CWS | ChildWorkspaces]].&lt;br /&gt;
The tinderbox status messages are available on the main CWS overview pages.&lt;br /&gt;
&lt;br /&gt;
Critical is when the color in those status messages is red for one of the platforms, because this indicates that the build broke on that platform.&lt;br /&gt;
&lt;br /&gt;
Here´s a short list what can be done to get more information about such tinderbox build breakers:&lt;br /&gt;
&lt;br /&gt;
1.) Go to the CWS Overview page in EIS and look at the tinderbox status&lt;br /&gt;
The only thing of interest is when the color is red somewhere, which indicates that the build broke on that platform.&lt;br /&gt;
&lt;br /&gt;
2.) On that EIS page there is a link below the headline &amp;quot;Tinderbox&amp;quot; with a text like &amp;quot;&amp;lt;cwsname&amp;gt; is open as of &amp;lt;date&amp;gt;&amp;quot;. Klick on that link.&lt;br /&gt;
&lt;br /&gt;
3.) You are now at the tinderbox overview page for that [[CWS | ChildWorkspace]]. There is a table with build dates as rows and platform as columns.&lt;br /&gt;
&lt;br /&gt;
4.) If there have been build breakers or if the build output contained warnings there will be a colored cell at that build-date/platform combination. Inside that cell there is the letter &amp;quot;L&amp;quot; with a Link. Click on that link.&lt;br /&gt;
&lt;br /&gt;
4a.) If you don&amp;#039;t see the cell you&amp;#039;re looking for, try to increase the displayed timeframe (links right above the legend) and start over at 4.&lt;br /&gt;
&lt;br /&gt;
5.) A popup box is now opening containing the links &amp;quot;View Summary Log&amp;quot; and &amp;quot;View full Log&amp;quot;. Later is just the output of the &amp;quot;build&amp;quot; command. In case of a build breaker you will usually find the error from the C++ Compiler, linker, java compiler etc. in the last lines of that Log file.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;View Summary Log&amp;quot; contains just those lines of the log near a warning or error and the last few lines. So click on that &amp;quot;View full Log&amp;quot; and have a look at the last few lines.&lt;br /&gt;
&lt;br /&gt;
If you are the owner of the [[CWS]] and can´t fix the problem yourself (eg. because it is system specific and you do not have acesss to that platform) an alternative is to seek help from porters of that platform. You can use either use the dev@porting.openoffice.org  mailinglist or ask around on IRC ( server: irc.freenode.net channel: #dev.openoffice.org ) - some OpenOffice.org porters are usually around on that IRC channel.&lt;br /&gt;
&lt;br /&gt;
Note that there is currently no possiblity to manually trigger a rebuild of tinderbox, but tinderbox will automatically put the [[CWS]] back into it´s queue of to be build things when it detects that there have been CVS commits on a ChildWorkspace. Thus a CVS commit (which you´d surely would have to do anyway when you fixed something) effectively forces a new build.&lt;br /&gt;
&lt;br /&gt;
In the future it is planned that [[buildbot | buildbots]] will send their results also to tinderbox. When this feature will become available you can request a new build on a [[buildbot]] to have the tinderbox status being updated.&lt;br /&gt;
&lt;br /&gt;
A red status can sometimes also have other causes than actual bugs it´s possible that there is a build breaker because of missing modules, something being tagged wrong on anoncvs etc.&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Forced_shell_calls&amp;diff=23881</id>
		<title>Forced shell calls</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Forced_shell_calls&amp;diff=23881"/>
		<updated>2007-01-26T14:23:28Z</updated>

		<summary type="html">&lt;p&gt;Hjs: /* The downside */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
It&amp;#039;s a single &amp;quot;+&amp;quot; in the receipt properties (right at the beginning of the line).&lt;br /&gt;
Forced shell calls in makefile receipt lines are used to force execution of this line in a shell context instead of a plain exec call. The problem is, that starting up a seperate shell for a receipt line isn&amp;#039;t cheap.&lt;br /&gt;
&lt;br /&gt;
One may think this is nesseccary if shell functionality (e.g. piping, redirection or similar) is used - this is &amp;#039;&amp;#039;&amp;#039;wrong&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== When do i need them? ==&lt;br /&gt;
&lt;br /&gt;
[[dmake]] supports definig a set of shell meta characters (SHELLMETA variable) to detect if a shell is required to process a specific receipt line. So if these set is popperly defined, [[dmake]] is able to decide in almost all cases if a shell is required.&lt;br /&gt;
&lt;br /&gt;
The only exception to this are shell internal commands. Depending on what shell you are used to, you may know &amp;quot;source&amp;quot;, &amp;quot;set&amp;quot; or &amp;quot;copy&amp;quot;. using these commands requires forced shell calls as there are no according binaries (for exec) and no special chars for [[dmake]] to detect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Now for some details ==&lt;br /&gt;
&lt;br /&gt;
Since noone wants to slow down all shells just because a command is internal for one of them, the &amp;quot;+&amp;quot; previously found before every potential internal command has been moved into the according dmake variable (see [[unitools.mk]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The downside ==&lt;br /&gt;
&lt;br /&gt;
*Not all affected commands are yet wrapped by dmake variables - so there is a handfull of places where forced shell calls are still lingering around in makefiles.&lt;br /&gt;
&lt;br /&gt;
*In some rare places, moving the &amp;quot;+&amp;quot; into the variable leads to a receipt line containing a &amp;quot;+&amp;quot; somewhere in the middle of the line and thus causing an error. that&amp;#039;s the reason for the ugly construct $(SOMETOOL:s/+//) found in solenv/inc.&lt;br /&gt;
[[Category:Build System]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Forced_shell_calls&amp;diff=23880</id>
		<title>Forced shell calls</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Forced_shell_calls&amp;diff=23880"/>
		<updated>2007-01-26T14:22:37Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
It&amp;#039;s a single &amp;quot;+&amp;quot; in the receipt properties (right at the beginning of the line).&lt;br /&gt;
Forced shell calls in makefile receipt lines are used to force execution of this line in a shell context instead of a plain exec call. The problem is, that starting up a seperate shell for a receipt line isn&amp;#039;t cheap.&lt;br /&gt;
&lt;br /&gt;
One may think this is nesseccary if shell functionality (e.g. piping, redirection or similar) is used - this is &amp;#039;&amp;#039;&amp;#039;wrong&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== When do i need them? ==&lt;br /&gt;
&lt;br /&gt;
[[dmake]] supports definig a set of shell meta characters (SHELLMETA variable) to detect if a shell is required to process a specific receipt line. So if these set is popperly defined, [[dmake]] is able to decide in almost all cases if a shell is required.&lt;br /&gt;
&lt;br /&gt;
The only exception to this are shell internal commands. Depending on what shell you are used to, you may know &amp;quot;source&amp;quot;, &amp;quot;set&amp;quot; or &amp;quot;copy&amp;quot;. using these commands requires forced shell calls as there are no according binaries (for exec) and no special chars for [[dmake]] to detect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Now for some details ==&lt;br /&gt;
&lt;br /&gt;
Since noone wants to slow down all shells just because a command is internal for one of them, the &amp;quot;+&amp;quot; previously found before every potential internal command has been moved into the according dmake variable (see [[unitools.mk]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The downside ==&lt;br /&gt;
&lt;br /&gt;
*Not all affected commands are yet wrapped by dmake variables - so there is a handfull of places where forced shell calls are still lingering around in makefiles.&lt;br /&gt;
&lt;br /&gt;
*In some rare places, moving the &amp;quot;+&amp;quot; into the variable leads to a receipt line containing a &amp;quot;+&amp;quot; somewhere in the middle of the line and thus causing an error. that&amp;#039;s the reason for the ugly construct $(SOMETOOL:s/+//) found in solenv/inc.&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Dmake_and_OOo_environment&amp;diff=23871</id>
		<title>Dmake and OOo environment</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Dmake_and_OOo_environment&amp;diff=23871"/>
		<updated>2007-01-26T13:29:17Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Introduction&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This document is mainly &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;targeting&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
developers who are working in a &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;OOo&amp;lt;/SPAN&amp;gt;/SO&lt;br /&gt;
environment but also gives some general background on using&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefiles.&amp;lt;/SPAN&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;No scripting or how make works&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;One of the most common mistakes is to&lt;br /&gt;
regard a &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; as a script which is&lt;br /&gt;
executed in a sequential order. This may lead to some surprises as&lt;br /&gt;
the order of the lines in the &amp;lt;SPAN LANG=&amp;quot;ko-KR&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; does&lt;br /&gt;
not &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;correspond&amp;lt;/SPAN&amp;gt; with the order of processing&lt;br /&gt;
targets.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Take the following example:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all : my_app_object my_app my_lib_object my_library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_lib_object:&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_library :&lt;br /&gt;
    link library from my_lib_object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app : my_library&lt;br /&gt;
    link my application from “my_app_object” and “my_library”&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;although “my_lib_object” appears&lt;br /&gt;
before “my_library” in the main target “all” and in  the&lt;br /&gt;
target description, this &amp;lt;SPAN LANG=&amp;quot;ko-KR&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; will fail&lt;br /&gt;
when linking “my_library”. The reason is that  there  is no&lt;br /&gt;
stated dependency from “my_library” to “my_lib_object”.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;What  make does is parsing the complete&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; and keeping the first target in&lt;br /&gt;
mind. From this target a dependency tree is generated which &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;controls&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all further action. In this case this tree will look like&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;[[Image:wrong_deps.png]]&amp;lt;BR CLEAR=LEFT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Starting from this first target, make&lt;br /&gt;
descends through the tree, building all targets (knots) with&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;satisfied&amp;lt;/SPAN&amp;gt; dependencies in a quite&lt;br /&gt;
unpredictable order. This order depends on the implementation details&lt;br /&gt;
of each make among other  things (e.g. parallel processes).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To get a clean build, the created tree&lt;br /&gt;
has to look like this&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;[[Image:right_deps.png]]&amp;lt;BR CLEAR=LEFT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;where the red arrow are marking the&lt;br /&gt;
missing dependencies which caused errors while the dependencies&lt;br /&gt;
marked in blue are simply not needed in this simple example (there &lt;br /&gt;
are circumstances where adding &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;redundant&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
dependencies may be needed for standardization).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To complete this first example, here is&lt;br /&gt;
the makefile, cleaned up a bit:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all : my_app&lt;br /&gt;
&lt;br /&gt;
my_lib_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
my_app_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
my_library : my_lib_object&lt;br /&gt;
    link library from my_lib_object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app : my_library my_app_object&lt;br /&gt;
    link my application from “my_app_object” and “my_library”&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;Even the “all”&lt;br /&gt;
target could have been removed when pushing “my_app” to first&lt;br /&gt;
position but it&amp;#039;s quite &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;useful&amp;lt;/SPAN&amp;gt; to keep a&lt;br /&gt;
standard “first target”, especially when things get more&lt;br /&gt;
complicated.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Variable handling&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;An other remarkable&lt;br /&gt;
point is the handling of variables. A variable can change it&amp;#039;s&lt;br /&gt;
content as long it&amp;#039;s only referenced but not used. The following&lt;br /&gt;
(note the colon when defining VAR2)  example tries to illustrate&lt;br /&gt;
this:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=first&lt;br /&gt;
VAR2:=$(VAR1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mytarget :&lt;br /&gt;
    +echo $(VAR1)&lt;br /&gt;
    +echo $(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=second&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;font-style: normal&amp;quot;&amp;gt;The &lt;br /&gt;
output when running &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt; &amp;lt;/SPAN&amp;gt;is:&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt;: &lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile.mk&amp;lt;/SPAN&amp;gt;:  line 9:  Warning -- Macro&lt;br /&gt;
`VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;echo second&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;echo first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;The warning already&lt;br /&gt;
gives a hint what is going on. When parsing the &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
as described above, the content  of “VAR1” may change several&lt;br /&gt;
times. What it contains depends on the current value when using it.&lt;br /&gt;
Defining “VAR2” with forced expansion ( this is the colon) gets&lt;br /&gt;
the value “first” as this is the current content of “VAR1”&lt;br /&gt;
when parsing. the command line in “mytarget” gets the value&lt;br /&gt;
“second” as it is the last redefinition of “VAR1”. The&lt;br /&gt;
content of “VAR1” when parsing the target description (called the&lt;br /&gt;
recipe)  doesn&amp;#039;t matter. Be aware that it does when the variable&lt;br /&gt;
appears in either the right or left side of the colon when stating a&lt;br /&gt;
dependency. Here&amp;#039;s some more, just for the record:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
VAR1=first&lt;br /&gt;
VAR2=$(VAR1) third&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ttt1 : $(VAR2)&lt;br /&gt;
    @+echo $(VAR1)&lt;br /&gt;
    &amp;gt;@+echo $(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=second&lt;br /&gt;
VAR1:=$(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
first second third :&lt;br /&gt;
    @+echo subtarget $@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The output is:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt;: &lt;br /&gt;
makefile.mk:  line 9:  Warning -- Macro `VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;dmake:  makefile.mk:  line 10: &lt;br /&gt;
Warning -- Macro `VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;subtarget first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;subtarget third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second third third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Centralized targets&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;In SO/OOo build environment some&lt;br /&gt;
measures have been taken to simplify multi-platform building. One &lt;br /&gt;
approach was to create  a set of makefiles which wrap all platform&lt;br /&gt;
specific handling of common targets. This also has the advantage that&lt;br /&gt;
changes to a special target or &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;behavior&amp;lt;/SPAN&amp;gt; can&lt;br /&gt;
be done for all modules in a single place.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Since there is an increasing number of&lt;br /&gt;
requests to do things different than all &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;others&amp;lt;/SPAN&amp;gt;,&lt;br /&gt;
the number of variables modifying those &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;centralized&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
targets are growing but the concept of these targets still exists and&lt;br /&gt;
is illustrated here.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;From the developer view a “centralized&lt;br /&gt;
target” is just a couple of variables to to fill with their&lt;br /&gt;
according values. To build e.g. a resource library for OOo/SO the&lt;br /&gt;
makefile snippet may look like&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RESLIB1NAME=myres&lt;br /&gt;
&lt;br /&gt;
RESLIB1SRSFILES= \&lt;br /&gt;
	$(SRS)$/mydlg1.srs \&lt;br /&gt;
	$(SRS)$/mytabbar.srs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To make this result in a resource&lt;br /&gt;
library, several things have to be handled by the central makefiles:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;First of all&lt;br /&gt;
	a huge amount of variables is &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;initialized&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	to match the requirements of used platform, set default output&lt;br /&gt;
	directories, locations, switches etc.&lt;br /&gt;
	For example the	used “$(SRS)” variable is defined now.&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Second a filename is computed from the variables supplied in the makefile.&lt;br /&gt;
	This happens depending on naming, versioning, platform or other&lt;br /&gt;
	conventions. It also contains a directory portion which points&lt;br /&gt;
	somewhere in the output tree. In this case it is stored in the&lt;br /&gt;
	variable RESLIB1TARGETN and can act as a “real” target as it&lt;br /&gt;
	represents a real file.&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Now a&lt;br /&gt;
	centralized target &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;hierarchy&amp;lt;/SPAN&amp;gt; has to be&lt;br /&gt;
	established. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;Normally&amp;lt;/SPAN&amp;gt; this is done in the&lt;br /&gt;
	form of&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #c0c0c0&amp;quot;&amp;gt;&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;ALLTAR:&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	...&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB1TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB2TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB3TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	...&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;	Note that ALLTAR doesn&amp;#039;t represent a file. It is also meant to be the first target the make process encounters and takes care of inserting all other targets in the global dependency tree.&amp;lt;BR&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Last but not least, the target&lt;br /&gt;
	itself is defined. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;Normally&amp;lt;/SPAN&amp;gt; this is the&lt;br /&gt;
	most complex part of the game. Here the dependencies, partially&lt;br /&gt;
	taken from the developer makefile, are handled. Also remaining&lt;br /&gt;
	differences between platforms are taken care of. And in some cases&lt;br /&gt;
	the whole processing takes place in different &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;flavors&amp;lt;/SPAN&amp;gt;,&lt;br /&gt;
	depending on boundary conditions.&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Only the target itself is about 100&lt;br /&gt;
lines of makefile code, not counting the code setting the required&lt;br /&gt;
variables. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;That&amp;#039;s&amp;lt;/SPAN&amp;gt; another reason for using&lt;br /&gt;
a lot of common targets this way.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Going for examples&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To get some examples for using the most&lt;br /&gt;
common targets I&amp;#039;ve prepared a module for demonstration purpose only&lt;br /&gt;
(no license header!). it contains a couple of makefiles which will be&lt;br /&gt;
the base of this part. &lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;It&amp;#039;s a good idea to imagine a&lt;br /&gt;
makefile.mk to be divided into five sections:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;OL TYPE=I&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ffffcc&amp;quot;&amp;gt;Pre&lt;br /&gt;
	settings&amp;lt;/SPAN&amp;gt; – some data to identify the actual makefile and&lt;br /&gt;
	control initialization of the make process.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ccffff&amp;quot;&amp;gt;Initialization&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
	– normally just including “settings.mk” but also module wide&lt;br /&gt;
	settings can be included here.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ffcc99&amp;quot;&amp;gt;Regular&lt;br /&gt;
	work&amp;lt;/SPAN&amp;gt; – define all variables for central targets.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #99ccff&amp;quot;&amp;gt;Common&lt;br /&gt;
	targets&amp;lt;/SPAN&amp;gt; – include “target.mk” to get involved with&lt;br /&gt;
	“ALLTAR” and all the central targets.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ff8080&amp;quot;&amp;gt;Freestyle&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
	– define your own targets and do things nobody else ever dreamed&lt;br /&gt;
	of...&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/OL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;First of all a simple makefile.mk to&lt;br /&gt;
compile some C sources. It will also help to cover some basics which&lt;br /&gt;
are common for all makefiles used in SO/OOo environment. I&amp;#039;ll call&lt;br /&gt;
them “makefile.mk” to ease my work.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #ffffcc&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
case sensitive modulename&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;PRJNAME=prjsample&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
path to module root&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;PRJ=..&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
unique module wide&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;TARGET=shl_source&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #ccffff&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;.INCLUDE : settings.mk&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.00in; background: #ffcc99&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;SLOFILES= \&amp;lt;BR&amp;gt;&lt;br /&gt;
$(SLO)$/shlobj.obj&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.00in; background: #99ccff&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;.INCLUDE : target.mk &amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;There are three variables at the&lt;br /&gt;
beginning of this file which are obligatory for each makefile.mk:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;PRJNAME is the case sensitive&lt;br /&gt;
	module name. If the module name changes for any reason, this&lt;br /&gt;
	variable needs to be changed too.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;PRJ indicates the relative path to&lt;br /&gt;
	the module root. Normally it contains just an assembly of  “..”&lt;br /&gt;
	and “$/” (the platform independent directory delimiter).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;TARGET is a user defined string&lt;br /&gt;
	that has to full fill two requirements: it may only contain the&lt;br /&gt;
	characters “0-9”, “a-z” and “_” and it must not be used&lt;br /&gt;
	as TARGET in an other makefile.mk of the same module.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This can easily be identified as&lt;br /&gt;
section I..&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Section III. Defines “SLOFILES” to&lt;br /&gt;
be just one object file in the directory pointed to by the variable&lt;br /&gt;
“SLO”. This triggers all required actions, from checking&lt;br /&gt;
dependencies to included header files and looking for the source file&lt;br /&gt;
up to selecting the compiler command line and compiling. It also&lt;br /&gt;
causes the build process to collect those objects (just one in this&lt;br /&gt;
case) in one file with the extension “.lib” in the output tree.&lt;br /&gt;
The basename is taken from the “TARGET” variable as it is&lt;br /&gt;
guaranteed to be unique. This is done by default to ease the handling&lt;br /&gt;
of lots of objects later on.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As this is a quite simple makefile.mk, it&lt;br /&gt;
doesn&amp;#039;t make much sense to talk a lot about the other sections. They&lt;br /&gt;
are either empty (V.) or contain their defaults (II. And IV.).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The next example is linking a shared&lt;br /&gt;
library from the results of the previous makefile.mk. It&amp;#039;s also a&lt;br /&gt;
good example how the idea of platform independent centralized targets&lt;br /&gt;
got softened and how this pollutes makefiles.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=shl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#win32&lt;br /&gt;
USE_DEFFILE=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1TARGET=myshl&lt;br /&gt;
SHL1LIBS=$(SLB)$/shl_source.lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# needed to link against&lt;br /&gt;
SHL1IMPLIB=i$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1VERSIONMAP=myshl.map&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
DEF1NAME=$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Beside the common lines we have already&lt;br /&gt;
seen in the first example, the interesting lines are&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SHL1TARGET=myshl&lt;br /&gt;
SHL1LIBS=$(SLB)$/shl_source.lib&lt;br /&gt;
SHL1VERSIONMAP=myshl.map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Ideally this is all that&amp;#039;s needed to&lt;br /&gt;
create a shared library. The basename, the source files and a map to&lt;br /&gt;
define the exports. Unfortunately some more lines are required to do&lt;br /&gt;
the same thing for windows but this difference will vanish.&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;For completion an other example linking&lt;br /&gt;
a share library using the old win32 way of defining exports.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=shl_cxx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# must collect all archives to have one file to dump&lt;br /&gt;
# symbols from&lt;br /&gt;
&lt;br /&gt;
LIB1TARGET=$(SLB)$/myshl_cxx.lib&lt;br /&gt;
LIB1FILES=$(SLB)$/shl_source_cxx.lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1TARGET=myshl_cxx&lt;br /&gt;
SHL1LIBS=$(LIB1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# needed to link against&lt;br /&gt;
SHL1IMPLIB=i$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
DEF1NAME=$(SHL1TARGET)&lt;br /&gt;
DEF1LIBNAME=myshl_cxx&lt;br /&gt;
DEF1DEPN=$(MISC)$/$(SHL1TARGET).flt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
$(MISC)$/$(SHL1TARGET).flt : myshl.flt makefile.mk&lt;br /&gt;
	+-$(RM) $@&lt;br /&gt;
	$(TYPE) myshl.flt &amp;amp;gt; $@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;It strikes that, beside other&lt;br /&gt;
disadvantages, there&amp;#039;s even more platform specific bloat. It also&lt;br /&gt;
illustrates that when section V. comes into play, things are getting&lt;br /&gt;
a bit more cryptic.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The last but one example builds an&lt;br /&gt;
application or two. It takes some more lines in this example because&lt;br /&gt;
one has to cope with some handling/defaults not applicable for this&lt;br /&gt;
example.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=test_app&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some defaults&lt;br /&gt;
&lt;br /&gt;
NO_DEFAULT_STL=TRUE&lt;br /&gt;
LIBTARGET=NO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJFILES= \&lt;br /&gt;
    $(OBJ)$/app_source.obj \&lt;br /&gt;
    $(OBJ)$/app_source_cxx.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# normay defined in &amp;quot;solenv/inc/libs.mk&amp;quot;&lt;br /&gt;
.IF &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
MYSHLLIB=-lmyshl&lt;br /&gt;
MYSHLLIB_CXX=-lmyshl_cxx&lt;br /&gt;
.ELSE        # &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
MYSHLLIB=imyshl.lib&lt;br /&gt;
MYSHLLIB_CXX=imyshl_cxx.lib&lt;br /&gt;
.ENDIF     # &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some more defaults&lt;br /&gt;
APP1LIBSALCPPRT=&lt;br /&gt;
APP1NOSAL=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
APP1TARGET=myapp&lt;br /&gt;
APP1STDLIBS=$(MYSHLLIB)&lt;br /&gt;
APP1OBJS=$(OBJ)$/app_source.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some more defaults&lt;br /&gt;
APP2LIBSALCPPRT=&lt;br /&gt;
APP2NOSAL=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
APP2TARGET=myapp_cxx&lt;br /&gt;
APP2STDLIBS=$(MYSHLLIB_CXX)&lt;br /&gt;
APP2OBJS=$(OBJ)$/app_source_cxx.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Beside this “example specific”&lt;br /&gt;
stuff, the requirements for linking an application are quite simple.&lt;br /&gt;
Just fill three variables to define input and output. No need to care&lt;br /&gt;
about fancy linker switches or similar.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Note also that the linked object files&lt;br /&gt;
appear twice. Once in OBJFILES to make them a  regular target and&lt;br /&gt;
twice in APPnOBJS to link them to the application. Both occurrences&lt;br /&gt;
are required if the objects are not built elsewhere.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Getting to the end of those examples,&lt;br /&gt;
some Java stuff.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..$/..$/..$/..&lt;br /&gt;
TARGET=cssu&lt;br /&gt;
PACKAGE=com$/sun$/star$/unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JAVACLASSFILES= \&lt;br /&gt;
	$(CLASSDIR)$/$(PACKAGE)$/something.class&lt;br /&gt;
&lt;br /&gt;
JARTARGET=something.jar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ALLTAR : runjar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
runjar : $(CLASSDIR)$/$(JARTARGET)&lt;br /&gt;
    java -classpath $(CLASSDIR)$/$(JARTARGET) com.sun.star.unsupported.something&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Simple as this is creating a jar file&lt;br /&gt;
containing compiled Java files located in the current directory. For&lt;br /&gt;
supporting the Java package structures, section I. contains one more&lt;br /&gt;
variable which contains the package defined in the files located in&lt;br /&gt;
this directory.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As a final goodie an example how to&lt;br /&gt;
include an own target and make sure it is handled according to it&amp;#039;s&lt;br /&gt;
dependencies.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ALLTAR : runjar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This simply inserts the target in the&lt;br /&gt;
global dependency tree. As “runjar” doesn&amp;#039;t correspond with a&lt;br /&gt;
filename, it&amp;#039;s regarded “out of date” in each dmake run.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;runjar : $(CLASSDIR)$/$(JARTARGET)&lt;br /&gt;
    java -classpath $(CLASSDIR)$/$(JARTARGET) com.sun.star.unsupported.something&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As “runjar” requires the jar file&lt;br /&gt;
to exist, it&amp;#039;s lined up as a dependency of this target. This makes&lt;br /&gt;
sure that the command line isn&amp;#039;t executed before the jarfile exists.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;An often seen construct&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
all: \&lt;br /&gt;
	ALLTAR \&lt;br /&gt;
	runjar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;is by no means a useful alternative!&lt;br /&gt;
(still remember the first part?)&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Recalling the content of the previous&lt;br /&gt;
topics of this document and looking at the samples given, it should&lt;br /&gt;
be possible to get an idea of how to write a makefile.mk and what to&lt;br /&gt;
avoid. Nevertheless the next section of this document tries to&lt;br /&gt;
summarize and also give some additional rules of thumb.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Summary&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;With centralized targets as available&lt;br /&gt;
in SO/OOo environment, writing a makefile.mk normally is done in two &lt;br /&gt;
steps:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;First make sure to create a&lt;br /&gt;
	skeleton which contains the required variables matching your&lt;br /&gt;
	module/directory and the standard includes.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Second fill up section III. with&lt;br /&gt;
	the variables needed to define your targets. It may be quite&lt;br /&gt;
	convenient to recycle an existing makfile.mk but just copying all&lt;br /&gt;
	isn&amp;#039;t that useful (see “Rules of thumb” later on).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;When writing own targets (section V.)&lt;br /&gt;
there some more things to check:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is it required to write an own&lt;br /&gt;
	target?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is my target stating it&amp;#039;s&lt;br /&gt;
	dependencies?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Are there other targets that&lt;br /&gt;
	depend on mine? At least ALLTAR should or your target will never be&lt;br /&gt;
	touched.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is all output protected against&lt;br /&gt;
	colliding with an other platform building this target at the same&lt;br /&gt;
	time?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is there any time consuming action&lt;br /&gt;
	done more than once? This primary addresses file system operations&lt;br /&gt;
	like zip, unzip and copying.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;And last but not least, some general&lt;br /&gt;
rules which may help writing makefiles that do not cause unexpected&lt;br /&gt;
behavior some day later on:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;A sane makefile.mk shouldn&amp;#039;t build&lt;br /&gt;
	anything on second dmake call (there are some very rare exceptions&lt;br /&gt;
	otherwise it would have been a must).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;A sane makefile.mk must rebuild&lt;br /&gt;
	the according targets when any source file gets touched.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Do not write targets that require&lt;br /&gt;
	manual intervention when rebuilding after encountering an error.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Use real files as targets to avoid&lt;br /&gt;
	unnecessary rebuilds.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;And my private favorite:&amp;lt;BR&amp;gt;remove&lt;br /&gt;
	all lines you do not understand!&amp;lt;BR&amp;gt;You&amp;#039;ll either not need them&lt;br /&gt;
	(most cases) or you should learn why they are required and what&lt;br /&gt;
	they&amp;#039;re doing.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Links&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;Some links which might be helpful when dealing with makefiles in&lt;br /&gt;
the OOo/SO environment:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;The dmake documentation&lt;br /&gt;
	itself:&amp;lt;BR&amp;gt;http://tools.openoffice.org/source/browse/*checkout*/tools/dmake/man/dmake.nc (plain text)&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;The environment documentation on&lt;br /&gt;
	OOo:&amp;lt;BR&amp;gt;http://tools.openoffice.org/build_env.html http://tools.openoffice.org/build_env.html&lt;br /&gt;
	(although slightly outdated)&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;And the main entry point for building&lt;br /&gt;
	OOo:&amp;lt;BR&amp;gt;http://tools.openoffice.org/&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Glossary&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;Not yet&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Build System]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Category:Build_System&amp;diff=23870</id>
		<title>Category:Build System</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Category:Build_System&amp;diff=23870"/>
		<updated>2007-01-26T13:25:20Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Entry point for topics related to building&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Precompiled_header_(PCH)&amp;diff=23869</id>
		<title>Precompiled header (PCH)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Precompiled_header_(PCH)&amp;diff=23869"/>
		<updated>2007-01-26T13:22:32Z</updated>

		<summary type="html">&lt;p&gt;Hjs: Precompiled header (PCH) moved to Precompiled header - PCH: hopefully better search results&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Precompiled header - PCH]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=23868</id>
		<title>Precompiled header - PCH</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=23868"/>
		<updated>2007-01-26T13:22:32Z</updated>

		<summary type="html">&lt;p&gt;Hjs: Precompiled header (PCH) moved to Precompiled header - PCH: hopefully better search results&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General==&lt;br /&gt;
&lt;br /&gt;
For general info see&lt;br /&gt;
[http://en.wikipedia.org/wiki/Precompiled_header &amp;quot;Precompiled header&amp;quot; on Wikipedia]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==OOo build - PCH support==&lt;br /&gt;
&lt;br /&gt;
With the integration of cws ause060, &amp;quot;--enable-pch&amp;quot; will tell configure&lt;br /&gt;
to enable precompiled header support for most modules, currently on&lt;br /&gt;
windows only.&lt;br /&gt;
&lt;br /&gt;
This is based on the include lines in every C/C++ file introduced by the&lt;br /&gt;
pchfix* cws:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
 // MARKER(update_precomp.py): autogen include statement, do not remove&lt;br /&gt;
 #include &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Unfortunatly, with enabled PCH the windows build will break in those&lt;br /&gt;
modules on the first source file _NOT_ containing this include statement.&lt;br /&gt;
&lt;br /&gt;
So if you&amp;#039;re adding new sources, please make sure to fetch those lines&lt;br /&gt;
from one of your neighbour sources and place them in your new file as&lt;br /&gt;
_FIRST_ include made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Are the .pch files automatically updated when i&amp;#039;m building?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; They are updated every time you enter &amp;lt;module&amp;gt;/inc and call &amp;quot;dmake&amp;quot;. This automatically happens when using the &amp;quot;build&amp;quot; command. All build.lst have been changed accordingly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Why aren&amp;#039;t they updated by &amp;quot;dmake&amp;quot; before starting to compile?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; That could be possible in future times but holds the risc that several dmake calls may try to update/write the same file...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Can&amp;#039;t we use compilerswitch &amp;quot;-XY&amp;quot; to avoid the &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot; include in every sourcefile?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; Just make suggestions! This would of cause make using PCH more stable. Already tried &amp;quot;-FI&amp;lt;filename&amp;gt;&amp;quot; for &amp;quot;wntmsci10&amp;quot; but it didn&amp;#039;t help.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; When will PCH support be available on &amp;lt;platform&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; The current PCH support is designed to have one set of compiler switches to create .pch (or whatever they may be named) files and one set of switches for using them (see solenv/inc/wntmsci10.mk). So if anyone finds the time to lookup these switches to make &amp;lt;platform&amp;gt; work in a similar way - PCH support should be there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Build System]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=23867</id>
		<title>Precompiled header - PCH</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=23867"/>
		<updated>2007-01-26T13:21:08Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General==&lt;br /&gt;
&lt;br /&gt;
For general info see&lt;br /&gt;
[http://en.wikipedia.org/wiki/Precompiled_header &amp;quot;Precompiled header&amp;quot; on Wikipedia]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==OOo build - PCH support==&lt;br /&gt;
&lt;br /&gt;
With the integration of cws ause060, &amp;quot;--enable-pch&amp;quot; will tell configure&lt;br /&gt;
to enable precompiled header support for most modules, currently on&lt;br /&gt;
windows only.&lt;br /&gt;
&lt;br /&gt;
This is based on the include lines in every C/C++ file introduced by the&lt;br /&gt;
pchfix* cws:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
 // MARKER(update_precomp.py): autogen include statement, do not remove&lt;br /&gt;
 #include &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Unfortunatly, with enabled PCH the windows build will break in those&lt;br /&gt;
modules on the first source file _NOT_ containing this include statement.&lt;br /&gt;
&lt;br /&gt;
So if you&amp;#039;re adding new sources, please make sure to fetch those lines&lt;br /&gt;
from one of your neighbour sources and place them in your new file as&lt;br /&gt;
_FIRST_ include made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Are the .pch files automatically updated when i&amp;#039;m building?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; They are updated every time you enter &amp;lt;module&amp;gt;/inc and call &amp;quot;dmake&amp;quot;. This automatically happens when using the &amp;quot;build&amp;quot; command. All build.lst have been changed accordingly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Why aren&amp;#039;t they updated by &amp;quot;dmake&amp;quot; before starting to compile?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; That could be possible in future times but holds the risc that several dmake calls may try to update/write the same file...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Can&amp;#039;t we use compilerswitch &amp;quot;-XY&amp;quot; to avoid the &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot; include in every sourcefile?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; Just make suggestions! This would of cause make using PCH more stable. Already tried &amp;quot;-FI&amp;lt;filename&amp;gt;&amp;quot; for &amp;quot;wntmsci10&amp;quot; but it didn&amp;#039;t help.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; When will PCH support be available on &amp;lt;platform&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; The current PCH support is designed to have one set of compiler switches to create .pch (or whatever they may be named) files and one set of switches for using them (see solenv/inc/wntmsci10.mk). So if anyone finds the time to lookup these switches to make &amp;lt;platform&amp;gt; work in a similar way - PCH support should be there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Build System]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=23853</id>
		<title>Precompiled header - PCH</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=23853"/>
		<updated>2007-01-26T10:11:39Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General==&lt;br /&gt;
&lt;br /&gt;
For general info see&lt;br /&gt;
[http://en.wikipedia.org/wiki/Precompiled_header &amp;quot;Precompiled header&amp;quot; on Wikipedia]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==OOo build - PCH support==&lt;br /&gt;
&lt;br /&gt;
With the integration of cws ause060, &amp;quot;--enable-pch&amp;quot; will tell configure&lt;br /&gt;
to enable precompiled header support for most modules, currently on&lt;br /&gt;
windows only.&lt;br /&gt;
&lt;br /&gt;
This is based on the include lines in every C/C++ file introduced by the&lt;br /&gt;
pchfix* cws:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
 // MARKER(update_precomp.py): autogen include statement, do not remove&lt;br /&gt;
 #include &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Unfortunatly, with enabled PCH the windows build will break in those&lt;br /&gt;
modules on the first source file _NOT_ containing this include statement.&lt;br /&gt;
&lt;br /&gt;
So if you&amp;#039;re adding new sources, please make sure to fetch those lines&lt;br /&gt;
from one of your neighbour sources and place them in your new file as&lt;br /&gt;
_FIRST_ include made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Are the .pch files automatically updated when i&amp;#039;m building?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; They are updated every time you enter &amp;lt;module&amp;gt;/inc and call &amp;quot;dmake&amp;quot;. This automatically happens when using the &amp;quot;build&amp;quot; command. All build.lst have been changed accordingly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Why aren&amp;#039;t they updated by &amp;quot;dmake&amp;quot; before starting to compile?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; That could be possible in future times but holds the risc that several dmake calls may try to update/write the same file...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Can&amp;#039;t we use compilerswitch &amp;quot;-XY&amp;quot; to avoid the &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot; include in every sourcefile?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; Just make suggestions! This would of cause make using PCH more stable. Already tried &amp;quot;-FI&amp;lt;filename&amp;gt;&amp;quot; for &amp;quot;wntmsci10&amp;quot; but it didn&amp;#039;t help.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; When will PCH support be available on &amp;lt;platform&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; The current PCH support is designed to have one set of compiler switches to create .pch (or whatever they may be named) files and one set of switches for using them (see solenv/inc/wntmsci10.mk). So if anyone finds the time to lookup these switches to make &amp;lt;platform&amp;gt; work in a similar way - PCH support should be there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=18916</id>
		<title>Precompiled header - PCH</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=18916"/>
		<updated>2006-10-16T16:05:44Z</updated>

		<summary type="html">&lt;p&gt;Hjs: /* OOo build - PCH support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General==&lt;br /&gt;
&lt;br /&gt;
For general info see&lt;br /&gt;
[http://en.wikipedia.org/wiki/Precompiled_header &amp;quot;Precompiled header&amp;quot; on Wikipedia]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==OOo build - PCH support==&lt;br /&gt;
&lt;br /&gt;
With the integration of cws ause060, &amp;quot;--enable-pch&amp;quot; will tell configure&lt;br /&gt;
to enable precompiled header support for most modules, currently on&lt;br /&gt;
windows only.&lt;br /&gt;
&lt;br /&gt;
This is based on the include lines in every C/C++ file introduced by the&lt;br /&gt;
pchfix* cws:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
 // MARKER(update_precomp.py): autogen include statement, do not remove&lt;br /&gt;
 #include &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Unfortunatly, with enabled PCH the windows build will break in those&lt;br /&gt;
modules on the first source file _NOT_ containing this include statement.&lt;br /&gt;
&lt;br /&gt;
So if you&amp;#039;re adding new sources, please make sure to fetch those lines&lt;br /&gt;
from one of your neighbour sources and place them in your new file as&lt;br /&gt;
_FIRST_ include made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Are the .pch files automatically updated when i&amp;#039;m building?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; They are updated every time you enter &amp;lt;module&amp;gt;/inc and call &amp;quot;dmake&amp;quot;. This automatically happens when using the &amp;quot;build&amp;quot; command. All build.lst have been changed accordingly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Why aren&amp;#039;t they updated by &amp;quot;dmake&amp;quot; before starting to compile?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; That could be possible in future times but holds the risc that several dmake calls may try to update/write the same file...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; Can&amp;#039;t we use compilerswitch &amp;quot;-XY&amp;quot; to avoid the &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot; include in every sourcefile?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; Just make suggestions! This would of cause make using PCH more stable. Already tried &amp;quot;-FI&amp;lt;filename&amp;gt;&amp;quot; for &amp;quot;wntmsci10&amp;quot; but it didn&amp;#039;t help.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q:&amp;#039;&amp;#039;&amp;#039; When will PCH support be available on &amp;lt;platform&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A:&amp;#039;&amp;#039;&amp;#039; The current PCH support is designed to have one set of compiler switches to create .pch (or whatever they may be named) files and one set of switches for using them (see solenv/inc/wntmsci10.mk). So if anyone finds the time to lookup these switches to make &amp;lt;platform&amp;gt; work in a similar way - PCH support should be there.&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=18528</id>
		<title>Precompiled header - PCH</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Precompiled_header_-_PCH&amp;diff=18528"/>
		<updated>2006-10-13T13:28:24Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==General==&lt;br /&gt;
&lt;br /&gt;
For general info see&lt;br /&gt;
[http://en.wikipedia.org/wiki/Precompiled_header &amp;quot;Precompiled header&amp;quot; on Wikipedia]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==OOo build - PCH support==&lt;br /&gt;
&lt;br /&gt;
With the integration of cws ause060, &amp;quot;--enable-pch&amp;quot; will tell configure&lt;br /&gt;
to enable precompiled header support for most modules, currently on&lt;br /&gt;
windows only.&lt;br /&gt;
&lt;br /&gt;
This is based on the include lines in every C/C++ file introduced by the&lt;br /&gt;
pchfix* cws:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
 // MARKER(update_precomp.py): autogen include statement, do not remove&lt;br /&gt;
 #include &amp;quot;precompiled_&amp;lt;module_name&amp;gt;.hxx&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Unfortunatly, with enabled PCH the windows build will break in those&lt;br /&gt;
modules on the first source file _NOT_ containing this include statement.&lt;br /&gt;
&lt;br /&gt;
So if you&amp;#039;re adding new sources, please make sure to fetch those lines&lt;br /&gt;
from one of your neighbour sources and place them in your new file as&lt;br /&gt;
_FIRST_ include made.&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Dmake_and_OOo_environment&amp;diff=13219</id>
		<title>Dmake and OOo environment</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Dmake_and_OOo_environment&amp;diff=13219"/>
		<updated>2006-06-30T15:23:22Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Introduction&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This document is mainly &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;targeting&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
developers who are working in a &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;OOo&amp;lt;/SPAN&amp;gt;/SO&lt;br /&gt;
environment but also gives some general background on using&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefiles.&amp;lt;/SPAN&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;No scripting or how make works&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;One of the most common mistakes is to&lt;br /&gt;
regard a &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; as a script which is&lt;br /&gt;
executed in a sequential order. This may lead to some surprises as&lt;br /&gt;
the order of the lines in the &amp;lt;SPAN LANG=&amp;quot;ko-KR&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; does&lt;br /&gt;
not &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;correspond&amp;lt;/SPAN&amp;gt; with the order of processing&lt;br /&gt;
targets.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Take the following example:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all : my_app_object my_app my_lib_object my_library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_lib_object:&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_library :&lt;br /&gt;
    link library from my_lib_object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app : my_library&lt;br /&gt;
    link my application from “my_app_object” and “my_library”&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;although “my_lib_object” appears&lt;br /&gt;
before “my_library” in the main target “all” and in  the&lt;br /&gt;
target description, this &amp;lt;SPAN LANG=&amp;quot;ko-KR&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; will fail&lt;br /&gt;
when linking “my_library”. The reason is that  there  is no&lt;br /&gt;
stated dependency from “my_library” to “my_lib_object”.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;What  make does is parsing the complete&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; and keeping the first target in&lt;br /&gt;
mind. From this target a dependency tree is generated which &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;controls&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all further action. In this case this tree will look like&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;[[Image:wrong_deps.png]]&amp;lt;BR CLEAR=LEFT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Starting from this first target, make&lt;br /&gt;
descends through the tree, building all targets (knots) with&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;satisfied&amp;lt;/SPAN&amp;gt; dependencies in a quite&lt;br /&gt;
unpredictable order. This order depends on the implementation details&lt;br /&gt;
of each make among other  things (e.g. parallel processes).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To get a clean build, the created tree&lt;br /&gt;
has to look like this&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;[[Image:right_deps.png]]&amp;lt;BR CLEAR=LEFT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;where the red arrow are marking the&lt;br /&gt;
missing dependencies which caused errors while the dependencies&lt;br /&gt;
marked in blue are simply not needed in this simple example (there &lt;br /&gt;
are circumstances where adding &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;redundant&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
dependencies may be needed for standardization).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To complete this first example, here is&lt;br /&gt;
the makefile, cleaned up a bit:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all : my_app&lt;br /&gt;
&lt;br /&gt;
my_lib_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
my_app_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
my_library : my_lib_object&lt;br /&gt;
    link library from my_lib_object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app : my_library my_app_object&lt;br /&gt;
    link my application from “my_app_object” and “my_library”&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;Even the “all”&lt;br /&gt;
target could have been removed when pushing “my_app” to first&lt;br /&gt;
position but it&amp;#039;s quite &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;useful&amp;lt;/SPAN&amp;gt; to keep a&lt;br /&gt;
standard “first target”, especially when things get more&lt;br /&gt;
complicated.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Variable handling&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;An other remarkable&lt;br /&gt;
point is the handling of variables. A variable can change it&amp;#039;s&lt;br /&gt;
content as long it&amp;#039;s only referenced but not used. The following&lt;br /&gt;
(note the colon when defining VAR2)  example tries to illustrate&lt;br /&gt;
this:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=first&lt;br /&gt;
VAR2:=$(VAR1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mytarget :&lt;br /&gt;
    +echo $(VAR1)&lt;br /&gt;
    +echo $(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=second&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;font-style: normal&amp;quot;&amp;gt;The &lt;br /&gt;
output when running &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt; &amp;lt;/SPAN&amp;gt;is:&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt;: &lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile.mk&amp;lt;/SPAN&amp;gt;:  line 9:  Warning -- Macro&lt;br /&gt;
`VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;echo second&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;echo first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;The warning already&lt;br /&gt;
gives a hint what is going on. When parsing the &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
as described above, the content  of “VAR1” may change several&lt;br /&gt;
times. What it contains depends on the current value when using it.&lt;br /&gt;
Defining “VAR2” with forced expansion ( this is the colon) gets&lt;br /&gt;
the value “first” as this is the current content of “VAR1”&lt;br /&gt;
when parsing. the command line in “mytarget” gets the value&lt;br /&gt;
“second” as it is the last redefinition of “VAR1”. The&lt;br /&gt;
content of “VAR1” when parsing the target description (called the&lt;br /&gt;
recipe)  doesn&amp;#039;t matter. Be aware that it does when the variable&lt;br /&gt;
appears in either the right or left side of the colon when stating a&lt;br /&gt;
dependency. Here&amp;#039;s some more, just for the record:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
VAR1=first&lt;br /&gt;
VAR2=$(VAR1) third&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ttt1 : $(VAR2)&lt;br /&gt;
    @+echo $(VAR1)&lt;br /&gt;
    &amp;gt;@+echo $(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=second&lt;br /&gt;
VAR1:=$(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
first second third :&lt;br /&gt;
    @+echo subtarget $@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The output is:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt;: &lt;br /&gt;
makefile.mk:  line 9:  Warning -- Macro `VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;dmake:  makefile.mk:  line 10: &lt;br /&gt;
Warning -- Macro `VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;subtarget first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;subtarget third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second third third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Centralized targets&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;In SO/OOo build environment some&lt;br /&gt;
measures have been taken to simplify multi-platform building. One &lt;br /&gt;
approach was to create  a set of makefiles which wrap all platform&lt;br /&gt;
specific handling of common targets. This also has the advantage that&lt;br /&gt;
changes to a special target or &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;behavior&amp;lt;/SPAN&amp;gt; can&lt;br /&gt;
be done for all modules in a single place.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Since there is an increasing number of&lt;br /&gt;
requests to do things different than all &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;others&amp;lt;/SPAN&amp;gt;,&lt;br /&gt;
the number of variables modifying those &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;centralized&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
targets are growing but the concept of these targets still exists and&lt;br /&gt;
is illustrated here.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;From the developer view a “centralized&lt;br /&gt;
target” is just a couple of variables to to fill with their&lt;br /&gt;
according values. To build e.g. a resource library for OOo/SO the&lt;br /&gt;
makefile snippet may look like&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RESLIB1NAME=myres&lt;br /&gt;
&lt;br /&gt;
RESLIB1SRSFILES= \&lt;br /&gt;
	$(SRS)$/mydlg1.srs \&lt;br /&gt;
	$(SRS)$/mytabbar.srs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To make this result in a resource&lt;br /&gt;
library, several things have to be handled by the central makefiles:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;First of all&lt;br /&gt;
	a huge amount of variables is &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;initialized&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	to match the requirements of used platform, set default output&lt;br /&gt;
	directories, locations, switches etc.&lt;br /&gt;
	For example the	used “$(SRS)” variable is defined now.&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Second a filename is computed from the variables supplied in the makefile.&lt;br /&gt;
	This happens depending on naming, versioning, platform or other&lt;br /&gt;
	conventions. It also contains a directory portion which points&lt;br /&gt;
	somewhere in the output tree. In this case it is stored in the&lt;br /&gt;
	variable RESLIB1TARGETN and can act as a “real” target as it&lt;br /&gt;
	represents a real file.&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Now a&lt;br /&gt;
	centralized target &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;hierarchy&amp;lt;/SPAN&amp;gt; has to be&lt;br /&gt;
	established. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;Normally&amp;lt;/SPAN&amp;gt; this is done in the&lt;br /&gt;
	form of&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #c0c0c0&amp;quot;&amp;gt;&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;ALLTAR:&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	...&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB1TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB2TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB3TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	...&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;	Note that ALLTAR doesn&amp;#039;t represent a file. It is also meant to be the first target the make process encounters and takes care of inserting all other targets in the global dependency tree.&amp;lt;BR&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Last but not least, the target&lt;br /&gt;
	itself is defined. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;Normally&amp;lt;/SPAN&amp;gt; this is the&lt;br /&gt;
	most complex part of the game. Here the dependencies, partially&lt;br /&gt;
	taken from the developer makefile, are handled. Also remaining&lt;br /&gt;
	differences between platforms are taken care of. And in some cases&lt;br /&gt;
	the whole processing takes place in different &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;flavors&amp;lt;/SPAN&amp;gt;,&lt;br /&gt;
	depending on boundary conditions.&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Only the target itself is about 100&lt;br /&gt;
lines of makefile code, not counting the code setting the required&lt;br /&gt;
variables. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;That&amp;#039;s&amp;lt;/SPAN&amp;gt; another reason for using&lt;br /&gt;
a lot of common targets this way.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Going for examples&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To get some examples for using the most&lt;br /&gt;
common targets I&amp;#039;ve prepared a module for demonstration purpose only&lt;br /&gt;
(no license header!). it contains a couple of makefiles which will be&lt;br /&gt;
the base of this part. &lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;It&amp;#039;s a good idea to imagine a&lt;br /&gt;
makefile.mk to be divided into five sections:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;OL TYPE=I&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ffffcc&amp;quot;&amp;gt;Pre&lt;br /&gt;
	settings&amp;lt;/SPAN&amp;gt; – some data to identify the actual makefile and&lt;br /&gt;
	control initialization of the make process.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ccffff&amp;quot;&amp;gt;Initialization&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
	– normally just including “settings.mk” but also module wide&lt;br /&gt;
	settings can be included here.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ffcc99&amp;quot;&amp;gt;Regular&lt;br /&gt;
	work&amp;lt;/SPAN&amp;gt; – define all variables for central targets.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #99ccff&amp;quot;&amp;gt;Common&lt;br /&gt;
	targets&amp;lt;/SPAN&amp;gt; – include “target.mk” to get involved with&lt;br /&gt;
	“ALLTAR” and all the central targets.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ff8080&amp;quot;&amp;gt;Freestyle&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
	– define your own targets and do things nobody else ever dreamed&lt;br /&gt;
	of...&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/OL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;First of all a simple makefile.mk to&lt;br /&gt;
compile some C sources. It will also help to cover some basics which&lt;br /&gt;
are common for all makefiles used in SO/OOo environment. I&amp;#039;ll call&lt;br /&gt;
them “makefile.mk” to ease my work.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #ffffcc&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
case sensitive modulename&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;PRJNAME=prjsample&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
path to module root&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;PRJ=..&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
unique module wide&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;TARGET=shl_source&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #ccffff&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;.INCLUDE : settings.mk&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.00in; background: #ffcc99&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;SLOFILES= \&amp;lt;BR&amp;gt;&lt;br /&gt;
$(SLO)$/shlobj.obj&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.00in; background: #99ccff&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;.INCLUDE : target.mk &amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;There are three variables at the&lt;br /&gt;
beginning of this file which are obligatory for each makefile.mk:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;PRJNAME is the case sensitive&lt;br /&gt;
	module name. If the module name changes for any reason, this&lt;br /&gt;
	variable needs to be changed too.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;PRJ indicates the relative path to&lt;br /&gt;
	the module root. Normally it contains just an assembly of  “..”&lt;br /&gt;
	and “$/” (the platform independent directory delimiter).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;TARGET is a user defined string&lt;br /&gt;
	that has to full fill two requirements: it may only contain the&lt;br /&gt;
	characters “0-9”, “a-z” and “_” and it must not be used&lt;br /&gt;
	as TARGET in an other makefile.mk of the same module.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This can easily be identified as&lt;br /&gt;
section I..&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Section III. Defines “SLOFILES” to&lt;br /&gt;
be just one object file in the directory pointed to by the variable&lt;br /&gt;
“SLO”. This triggers all required actions, from checking&lt;br /&gt;
dependencies to included header files and looking for the source file&lt;br /&gt;
up to selecting the compiler command line and compiling. It also&lt;br /&gt;
causes the build process to collect those objects (just one in this&lt;br /&gt;
case) in one file with the extension “.lib” in the output tree.&lt;br /&gt;
The basename is taken from the “TARGET” variable as it is&lt;br /&gt;
guaranteed to be unique. This is done by default to ease the handling&lt;br /&gt;
of lots of objects later on.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As this is a quite simple makefile.mk, it&lt;br /&gt;
doesn&amp;#039;t make much sense to talk a lot about the other sections. They&lt;br /&gt;
are either empty (V.) or contain their defaults (II. And IV.).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The next example is linking a shared&lt;br /&gt;
library from the results of the previous makefile.mk. It&amp;#039;s also a&lt;br /&gt;
good example how the idea of platform independent centralized targets&lt;br /&gt;
got softened and how this pollutes makefiles.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=shl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#win32&lt;br /&gt;
USE_DEFFILE=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1TARGET=myshl&lt;br /&gt;
SHL1LIBS=$(SLB)$/shl_source.lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# needed to link against&lt;br /&gt;
SHL1IMPLIB=i$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1VERSIONMAP=myshl.map&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
DEF1NAME=$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Beside the common lines we have already&lt;br /&gt;
seen in the first example, the interesting lines are&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SHL1TARGET=myshl&lt;br /&gt;
SHL1LIBS=$(SLB)$/shl_source.lib&lt;br /&gt;
SHL1VERSIONMAP=myshl.map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Ideally this is all that&amp;#039;s needed to&lt;br /&gt;
create a shared library. The basename, the source files and a map to&lt;br /&gt;
define the exports. Unfortunately some more lines are required to do&lt;br /&gt;
the same thing for windows but this difference will vanish.&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;For completion an other example linking&lt;br /&gt;
a share library using the old win32 way of defining exports.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=shl_cxx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# must collect all archives to have one file to dump&lt;br /&gt;
# symbols from&lt;br /&gt;
&lt;br /&gt;
LIB1TARGET=$(SLB)$/myshl_cxx.lib&lt;br /&gt;
LIB1FILES=$(SLB)$/shl_source_cxx.lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1TARGET=myshl_cxx&lt;br /&gt;
SHL1LIBS=$(LIB1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# needed to link against&lt;br /&gt;
SHL1IMPLIB=i$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
DEF1NAME=$(SHL1TARGET)&lt;br /&gt;
DEF1LIBNAME=myshl_cxx&lt;br /&gt;
DEF1DEPN=$(MISC)$/$(SHL1TARGET).flt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
$(MISC)$/$(SHL1TARGET).flt : myshl.flt makefile.mk&lt;br /&gt;
	+-$(RM) $@&lt;br /&gt;
	$(TYPE) myshl.flt &amp;amp;gt; $@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;It strikes that, beside other&lt;br /&gt;
disadvantages, there&amp;#039;s even more platform specific bloat. It also&lt;br /&gt;
illustrates that when section V. comes into play, things are getting&lt;br /&gt;
a bit more cryptic.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The last but one example builds an&lt;br /&gt;
application or two. It takes some more lines in this example because&lt;br /&gt;
one has to cope with some handling/defaults not applicable for this&lt;br /&gt;
example.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=test_app&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some defaults&lt;br /&gt;
&lt;br /&gt;
NO_DEFAULT_STL=TRUE&lt;br /&gt;
LIBTARGET=NO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJFILES= \&lt;br /&gt;
    $(OBJ)$/app_source.obj \&lt;br /&gt;
    $(OBJ)$/app_source_cxx.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# normay defined in &amp;quot;solenv/inc/libs.mk&amp;quot;&lt;br /&gt;
.IF &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
MYSHLLIB=-lmyshl&lt;br /&gt;
MYSHLLIB_CXX=-lmyshl_cxx&lt;br /&gt;
.ELSE        # &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
MYSHLLIB=imyshl.lib&lt;br /&gt;
MYSHLLIB_CXX=imyshl_cxx.lib&lt;br /&gt;
.ENDIF     # &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some more defaults&lt;br /&gt;
APP1LIBSALCPPRT=&lt;br /&gt;
APP1NOSAL=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
APP1TARGET=myapp&lt;br /&gt;
APP1STDLIBS=$(MYSHLLIB)&lt;br /&gt;
APP1OBJS=$(OBJ)$/app_source.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some more defaults&lt;br /&gt;
APP2LIBSALCPPRT=&lt;br /&gt;
APP2NOSAL=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
APP2TARGET=myapp_cxx&lt;br /&gt;
APP2STDLIBS=$(MYSHLLIB_CXX)&lt;br /&gt;
APP2OBJS=$(OBJ)$/app_source_cxx.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Beside this “example specific”&lt;br /&gt;
stuff, the requirements for linking an application are quite simple.&lt;br /&gt;
Just fill three variables to define input and output. No need to care&lt;br /&gt;
about fancy linker switches or similar.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Note also that the linked object files&lt;br /&gt;
appear twice. Once in OBJFILES to make them a  regular target and&lt;br /&gt;
twice in APPnOBJS to link them to the application. Both occurrences&lt;br /&gt;
are required if the objects are not built elsewhere.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Getting to the end of those examples,&lt;br /&gt;
some Java stuff.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..$/..$/..$/..&lt;br /&gt;
TARGET=cssu&lt;br /&gt;
PACKAGE=com$/sun$/star$/unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JAVACLASSFILES= \&lt;br /&gt;
	$(CLASSDIR)$/$(PACKAGE)$/something.class&lt;br /&gt;
&lt;br /&gt;
JARTARGET=something.jar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ALLTAR : runjar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
runjar : $(CLASSDIR)$/$(JARTARGET)&lt;br /&gt;
    java -classpath $(CLASSDIR)$/$(JARTARGET) com.sun.star.unsupported.something&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Simple as this is creating a jar file&lt;br /&gt;
containing compiled Java files located in the current directory. For&lt;br /&gt;
supporting the Java package structures, section I. contains one more&lt;br /&gt;
variable which contains the package defined in the files located in&lt;br /&gt;
this directory.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As a final goodie an example how to&lt;br /&gt;
include an own target and make sure it is handled according to it&amp;#039;s&lt;br /&gt;
dependencies.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ALLTAR : runjar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This simply inserts the target in the&lt;br /&gt;
global dependency tree. As “runjar” doesn&amp;#039;t correspond with a&lt;br /&gt;
filename, it&amp;#039;s regarded “out of date” in each dmake run.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;runjar : $(CLASSDIR)$/$(JARTARGET)&lt;br /&gt;
    java -classpath $(CLASSDIR)$/$(JARTARGET) com.sun.star.unsupported.something&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As “runjar” requires the jar file&lt;br /&gt;
to exist, it&amp;#039;s lined up as a dependency of this target. This makes&lt;br /&gt;
sure that the command line isn&amp;#039;t executed before the jarfile exists.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;An often seen construct&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
all: \&lt;br /&gt;
	ALLTAR \&lt;br /&gt;
	runjar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;is by no means a useful alternative!&lt;br /&gt;
(still remember the first part?)&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Recalling the content of the previous&lt;br /&gt;
topics of this document and looking at the samples given, it should&lt;br /&gt;
be possible to get an idea of how to write a makefile.mk and what to&lt;br /&gt;
avoid. Nevertheless the next section of this document tries to&lt;br /&gt;
summarize and also give some additional rules of thumb.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Summary&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;With centralized targets as available&lt;br /&gt;
in SO/OOo environment, writing a makefile.mk normally is done in two &lt;br /&gt;
steps:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;First make sure to create a&lt;br /&gt;
	skeleton which contains the required variables matching your&lt;br /&gt;
	module/directory and the standard includes.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Second fill up section III. with&lt;br /&gt;
	the variables needed to define your targets. It may be quite&lt;br /&gt;
	convenient to recycle an existing makfile.mk but just copying all&lt;br /&gt;
	isn&amp;#039;t that useful (see “Rules of thumb” later on).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;When writing own targets (section V.)&lt;br /&gt;
there some more things to check:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is it required to write an own&lt;br /&gt;
	target?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is my target stating it&amp;#039;s&lt;br /&gt;
	dependencies?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Are there other targets that&lt;br /&gt;
	depend on mine? At least ALLTAR should or your target will never be&lt;br /&gt;
	touched.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is all output protected against&lt;br /&gt;
	colliding with an other platform building this target at the same&lt;br /&gt;
	time?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is there any time consuming action&lt;br /&gt;
	done more than once? This primary addresses file system operations&lt;br /&gt;
	like zip, unzip and copying.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;And last but not least, some general&lt;br /&gt;
rules which may help writing makefiles that do not cause unexpected&lt;br /&gt;
behavior some day later on:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;A sane makefile.mk shouldn&amp;#039;t build&lt;br /&gt;
	anything on second dmake call (there are some very rare exceptions&lt;br /&gt;
	otherwise it would have been a must).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;A sane makefile.mk must rebuild&lt;br /&gt;
	the according targets when any source file gets touched.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Do not write targets that require&lt;br /&gt;
	manual intervention when rebuilding after encountering an error.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Use real files as targets to avoid&lt;br /&gt;
	unnecessary rebuilds.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;And my private favorite:&amp;lt;BR&amp;gt;remove&lt;br /&gt;
	all lines you do not understand!&amp;lt;BR&amp;gt;You&amp;#039;ll either not need them&lt;br /&gt;
	(most cases) or you should learn why they are required and what&lt;br /&gt;
	they&amp;#039;re doing.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Links&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;Some links which might be helpful when dealing with makefiles in&lt;br /&gt;
the OOo/SO environment:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;The dmake documentation&lt;br /&gt;
	itself:&amp;lt;BR&amp;gt;http://tools.openoffice.org/source/browse/*checkout*/tools/dmake/man/dmake.nc (plain text)&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;The environment documentation on&lt;br /&gt;
	OOo:&amp;lt;BR&amp;gt;http://tools.openoffice.org/build_env.html http://tools.openoffice.org/build_env.html&lt;br /&gt;
	(although slightly outdated)&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;And the main entry point for building&lt;br /&gt;
	OOo:&amp;lt;BR&amp;gt;http://tools.openoffice.org/&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Glossary&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;Not yet&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Dmake_and_OOo_environment&amp;diff=13218</id>
		<title>Talk:Dmake and OOo environment</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Dmake_and_OOo_environment&amp;diff=13218"/>
		<updated>2006-06-30T15:20:02Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;i found this doc on my disk. it may have suffered from converting .odt -&amp;gt; .html -&amp;gt; wiki. also there are quite some overlappings with the existing tutorial. maybe someone finds it usefull.&lt;br /&gt;
--[[User:Hjs|Hjs]] 17:20, 30 June 2006 (CEST)&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Right_deps.png&amp;diff=13217</id>
		<title>File:Right deps.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Right_deps.png&amp;diff=13217"/>
		<updated>2006-06-30T15:13:29Z</updated>

		<summary type="html">&lt;p&gt;Hjs: right dependency graph&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;right dependency graph&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Wrong_deps.png&amp;diff=13216</id>
		<title>File:Wrong deps.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Wrong_deps.png&amp;diff=13216"/>
		<updated>2006-06-30T15:12:58Z</updated>

		<summary type="html">&lt;p&gt;Hjs: wrong dependency graph&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;wrong dependency graph&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Dmake_and_OOo_environment&amp;diff=13215</id>
		<title>Dmake and OOo environment</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Dmake_and_OOo_environment&amp;diff=13215"/>
		<updated>2006-06-30T15:12:13Z</updated>

		<summary type="html">&lt;p&gt;Hjs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Introduction&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This document is mainly &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;targeting&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
developers who are working in a &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;OOo&amp;lt;/SPAN&amp;gt;/SO&lt;br /&gt;
environment but also gives some general background on using&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefiles.&amp;lt;/SPAN&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;No scripting or how make works&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;One of the most common mistakes is to&lt;br /&gt;
regard a &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; as a script which is&lt;br /&gt;
executed in a sequential order. This may lead to some surprises as&lt;br /&gt;
the order of the lines in the &amp;lt;SPAN LANG=&amp;quot;ko-KR&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; does&lt;br /&gt;
not &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;correspond&amp;lt;/SPAN&amp;gt; with the order of processing&lt;br /&gt;
targets.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Take the following example:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all : my_app_object my_app my_lib_object my_library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_lib_object:&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_library :&lt;br /&gt;
    link library from my_lib_object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app : my_library&lt;br /&gt;
    link my application from “my_app_object” and “my_library”&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;although “my_lib_object” appears&lt;br /&gt;
before “my_library” in the main target “all” and in  the&lt;br /&gt;
target description, this &amp;lt;SPAN LANG=&amp;quot;ko-KR&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; will fail&lt;br /&gt;
when linking “my_library”. The reason is that  there  is no&lt;br /&gt;
stated dependency from “my_library” to “my_lib_object”.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;What  make does is parsing the complete&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt; and keeping the first target in&lt;br /&gt;
mind. From this target a dependency tree is generated which &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;controls&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all further action. In this case this tree will look like&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;[[Image:wrong_deps.png]]&amp;lt;BR CLEAR=LEFT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Starting from this first target, make&lt;br /&gt;
descends through the tree, building all targets (knots) with&lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;satisfied&amp;lt;/SPAN&amp;gt; dependencies in a quite&lt;br /&gt;
unpredictable order. This order depends on the implementation details&lt;br /&gt;
of each make among other  things (e.g. parallel processes).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To get a clean build, the created tree&lt;br /&gt;
has to look like this&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;[[Image:right_deps.png]]&amp;lt;BR CLEAR=LEFT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;where the red arrow are marking the&lt;br /&gt;
missing dependencies which caused errors while the dependencies&lt;br /&gt;
marked in blue are simply not needed in this simple example (there &lt;br /&gt;
are circumstances where adding &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;redundant&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
dependencies may be needed for standardization).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To complete this first example, here is&lt;br /&gt;
the makefile, cleaned up a bit:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
all : my_app&lt;br /&gt;
&lt;br /&gt;
my_lib_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
my_app_object :&lt;br /&gt;
    compile source&lt;br /&gt;
&lt;br /&gt;
my_library : my_lib_object&lt;br /&gt;
    link library from my_lib_object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_app : my_library my_app_object&lt;br /&gt;
    link my application from “my_app_object” and “my_library”&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;Even the “all”&lt;br /&gt;
target could have been removed when pushing “my_app” to first&lt;br /&gt;
position but it&amp;#039;s quite &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;useful&amp;lt;/SPAN&amp;gt; to keep a&lt;br /&gt;
standard “first target”, especially when things get more&lt;br /&gt;
complicated.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Variable handling&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;An other remarkable&lt;br /&gt;
point is the handling of variables. A variable can change it&amp;#039;s&lt;br /&gt;
content as long it&amp;#039;s only referenced but not used. The following&lt;br /&gt;
(note the colon when defining VAR2)  example tries to illustrate&lt;br /&gt;
this:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=first&lt;br /&gt;
VAR2:=$(VAR1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mytarget :&lt;br /&gt;
    +echo $(VAR1)&lt;br /&gt;
    +echo $(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=second&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;font-style: normal&amp;quot;&amp;gt;The &lt;br /&gt;
output when running &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt; &amp;lt;/SPAN&amp;gt;is:&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt;: &lt;br /&gt;
&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile.mk&amp;lt;/SPAN&amp;gt;:  line 9:  Warning -- Macro&lt;br /&gt;
`VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;echo second&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;echo first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in; font-style: normal&amp;quot;&amp;gt;The warning already&lt;br /&gt;
gives a hint what is going on. When parsing the &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;makefile&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
as described above, the content  of “VAR1” may change several&lt;br /&gt;
times. What it contains depends on the current value when using it.&lt;br /&gt;
Defining “VAR2” with forced expansion ( this is the colon) gets&lt;br /&gt;
the value “first” as this is the current content of “VAR1”&lt;br /&gt;
when parsing. the command line in “mytarget” gets the value&lt;br /&gt;
“second” as it is the last redefinition of “VAR1”. The&lt;br /&gt;
content of “VAR1” when parsing the target description (called the&lt;br /&gt;
recipe)  doesn&amp;#039;t matter. Be aware that it does when the variable&lt;br /&gt;
appears in either the right or left side of the colon when stating a&lt;br /&gt;
dependency. Here&amp;#039;s some more, just for the record:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
VAR1=first&lt;br /&gt;
VAR2=$(VAR1) third&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ttt1 : $(VAR2)&lt;br /&gt;
    @+echo $(VAR1)&lt;br /&gt;
    &amp;gt;@+echo $(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAR1=second&lt;br /&gt;
VAR1:=$(VAR2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
first second third :&lt;br /&gt;
    @+echo subtarget $@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The output is:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;&amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;dmake&amp;lt;/SPAN&amp;gt;: &lt;br /&gt;
makefile.mk:  line 9:  Warning -- Macro `VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;dmake:  makefile.mk:  line 10: &lt;br /&gt;
Warning -- Macro `VAR1&amp;#039; redefined after use&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;subtarget first&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;subtarget third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;I&amp;gt;second third third&amp;lt;/I&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Centralized targets&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;In SO/OOo build environment some&lt;br /&gt;
measures have been taken to simplify multi-platform building. One &lt;br /&gt;
approach was to create  a set of makefiles which wrap all platform&lt;br /&gt;
specific handling of common targets. This also has the advantage that&lt;br /&gt;
changes to a special target or &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;behavior&amp;lt;/SPAN&amp;gt; can&lt;br /&gt;
be done for all modules in a single place.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Since there is an increasing number of&lt;br /&gt;
requests to do things different than all &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;others&amp;lt;/SPAN&amp;gt;,&lt;br /&gt;
the number of variables modifying those &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;centralized&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
targets are growing but the concept of these targets still exists and&lt;br /&gt;
is illustrated here.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;From the developer view a “centralized&lt;br /&gt;
target” is just a couple of variables to to fill with their&lt;br /&gt;
according values. To build e.g. a resource library for OOo/SO the&lt;br /&gt;
makefile snippet may look like&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RESLIB1NAME=myres&lt;br /&gt;
&lt;br /&gt;
RESLIB1SRSFILES= \&lt;br /&gt;
	$(SRS)$/mydlg1.srs \&lt;br /&gt;
	$(SRS)$/mytabbar.srs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To make this result in a resource&lt;br /&gt;
library, several things have to be handled by the central makefiles:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;First of all&lt;br /&gt;
	a huge amount of variables is &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;initialized&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	to match the requirements of used platform, set default output&lt;br /&gt;
	directories, locations, switches etc.&lt;br /&gt;
	For example the	used “$(SRS)” variable is defined now.&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Second a filename is computed from the variables supplied in the makefile.&lt;br /&gt;
	This happens depending on naming, versioning, platform or other&lt;br /&gt;
	conventions. It also contains a directory portion which points&lt;br /&gt;
	somewhere in the output tree. In this case it is stored in the&lt;br /&gt;
	variable RESLIB1TARGETN and can act as a “real” target as it&lt;br /&gt;
	represents a real file.&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Now a&lt;br /&gt;
	centralized target &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;hierarchy&amp;lt;/SPAN&amp;gt; has to be&lt;br /&gt;
	established. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;Normally&amp;lt;/SPAN&amp;gt; this is done in the&lt;br /&gt;
	form of&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #c0c0c0&amp;quot;&amp;gt;&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;ALLTAR:&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	...&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB1TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB2TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	$(RESLIB3TARGETN)&lt;br /&gt;
	\&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;	...&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;	Note that ALLTAR doesn&amp;#039;t represent a file. It is also meant to be the first target the make process encounters and takes care of inserting all other targets in the global dependency tree.&amp;lt;BR&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;Last but not least, the target&lt;br /&gt;
	itself is defined. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;Normally&amp;lt;/SPAN&amp;gt; this is the&lt;br /&gt;
	most complex part of the game. Here the dependencies, partially&lt;br /&gt;
	taken from the developer makefile, are handled. Also remaining&lt;br /&gt;
	differences between platforms are taken care of. And in some cases&lt;br /&gt;
	the whole processing takes place in different &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;flavors&amp;lt;/SPAN&amp;gt;,&lt;br /&gt;
	depending on boundary conditions.&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Only the target itself is about 100&lt;br /&gt;
lines of makefile code, not counting the code setting the required&lt;br /&gt;
variables. &amp;lt;SPAN LANG=&amp;quot;en-US&amp;quot;&amp;gt;That&amp;#039;s&amp;lt;/SPAN&amp;gt; another reason for using&lt;br /&gt;
a lot of common targets this way.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Going for examples&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;To get some examples for using the most&lt;br /&gt;
common targets I&amp;#039;ve prepared a module for demonstration purpose only&lt;br /&gt;
(no license header!). it contains a couple of makefiles which will be&lt;br /&gt;
the base of this part. &lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;It&amp;#039;s a good idea to imagine a&lt;br /&gt;
makefile.mk to be divided into five sections:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;OL TYPE=I&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ffffcc&amp;quot;&amp;gt;Pre&lt;br /&gt;
	settings&amp;lt;/SPAN&amp;gt; – some data to identify the actual makefile and&lt;br /&gt;
	control initialization of the make process.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ccffff&amp;quot;&amp;gt;Initialization&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
	– normally just including “settings.mk” but also module wide&lt;br /&gt;
	settings can be included here.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ffcc99&amp;quot;&amp;gt;Regular&lt;br /&gt;
	work&amp;lt;/SPAN&amp;gt; – define all variables for central targets.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #99ccff&amp;quot;&amp;gt;Common&lt;br /&gt;
	targets&amp;lt;/SPAN&amp;gt; – include “target.mk” to get involved with&lt;br /&gt;
	“ALLTAR” and all the central targets.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;SPAN STYLE=&amp;quot;background: #ff8080&amp;quot;&amp;gt;Freestyle&amp;lt;/SPAN&amp;gt;&lt;br /&gt;
	– define your own targets and do things nobody else ever dreamed&lt;br /&gt;
	of...&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/OL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;First of all a simple makefile.mk to&lt;br /&gt;
compile some C sources. It will also help to cover some basics which&lt;br /&gt;
are common for all makefiles used in SO/OOo environment. I&amp;#039;ll call&lt;br /&gt;
them “makefile.mk” to ease my work.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #ffffcc&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
case sensitive modulename&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;PRJNAME=prjsample&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
path to module root&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;PRJ=..&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;#&lt;br /&gt;
unique module wide&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;TARGET=shl_source&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.08in; background: #ccffff&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;.INCLUDE : settings.mk&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.00in; background: #ffcc99&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;SLOFILES= \&amp;lt;BR&amp;gt;&lt;br /&gt;
$(SLO)$/shlobj.obj&amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-top: 0.00in; background: #99ccff&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=2&amp;gt;&amp;lt;I&amp;gt;.INCLUDE : target.mk &amp;lt;/I&amp;gt;&amp;lt;/FONT&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;There are three variables at the&lt;br /&gt;
beginning of this file which are obligatory for each makefile.mk:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;PRJNAME is the case sensitive&lt;br /&gt;
	module name. If the module name changes for any reason, this&lt;br /&gt;
	variable needs to be changed too.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;PRJ indicates the relative path to&lt;br /&gt;
	the module root. Normally it contains just an assembly of  “..”&lt;br /&gt;
	and “$/” (the platform independent directory delimiter).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;TARGET is a user defined string&lt;br /&gt;
	that has to full fill two requirements: it may only contain the&lt;br /&gt;
	characters “0-9”, “a-z” and “_” and it must not be used&lt;br /&gt;
	as TARGET in an other makefile.mk of the same module.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This can easily be identified as&lt;br /&gt;
section I..&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Section III. Defines “SLOFILES” to&lt;br /&gt;
be just one object file in the directory pointed to by the variable&lt;br /&gt;
“SLO”. This triggers all required actions, from checking&lt;br /&gt;
dependencies to included header files and looking for the source file&lt;br /&gt;
up to selecting the compiler command line and compiling. It also&lt;br /&gt;
causes the build process to collect those objects (just one in this&lt;br /&gt;
case) in one file with the extension “.lib” in the output tree.&lt;br /&gt;
The basename is taken from the “TARGET” variable as it is&lt;br /&gt;
guaranteed to be unique. This is done as default to ease the handling&lt;br /&gt;
of lots of objects later on.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As this a quite simple makefile.mk, it&lt;br /&gt;
doesn&amp;#039;t make much sense to talk a lot about the other sections. They&lt;br /&gt;
are either empty (V.) or contain their defaults (II. And IV.).&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The next example is linking a shared&lt;br /&gt;
library from the results of the previous makefile.mk. It&amp;#039;s also a&lt;br /&gt;
good example how the idea of platform independent centralized targets&lt;br /&gt;
got softened and how this pollutes makefiles.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=shl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#win32&lt;br /&gt;
USE_DEFFILE=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1TARGET=myshl&lt;br /&gt;
SHL1LIBS=$(SLB)$/shl_source.lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# needed to link against&lt;br /&gt;
SHL1IMPLIB=i$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1VERSIONMAP=myshl.map&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
DEF1NAME=$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Beside the common lines we have already&lt;br /&gt;
seen in the first example, the interesting lines are&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SHL1TARGET=myshl&lt;br /&gt;
SHL1LIBS=$(SLB)$/shl_source.lib&lt;br /&gt;
SHL1VERSIONMAP=myshl.map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Ideally this is all that&amp;#039;s needed to&lt;br /&gt;
create a shared library. The basename, the source files and a map to&lt;br /&gt;
define the exports. Unfortunately some more lines are required to do&lt;br /&gt;
the same thing for windows but this difference will vanish.&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;For completion an other example linking&lt;br /&gt;
a share library using the old win32 way of defining exports.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=shl_cxx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# must collect all archives to have one file to dump&lt;br /&gt;
# symbols from&lt;br /&gt;
&lt;br /&gt;
LIB1TARGET=$(SLB)$/myshl_cxx.lib&lt;br /&gt;
LIB1FILES=$(SLB)$/shl_source_cxx.lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SHL1TARGET=myshl_cxx&lt;br /&gt;
SHL1LIBS=$(LIB1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
# needed to link against&lt;br /&gt;
SHL1IMPLIB=i$(SHL1TARGET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
DEF1NAME=$(SHL1TARGET)&lt;br /&gt;
DEF1LIBNAME=myshl_cxx&lt;br /&gt;
DEF1DEPN=$(MISC)$/$(SHL1TARGET).flt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# win32&lt;br /&gt;
$(MISC)$/$(SHL1TARGET).flt : myshl.flt makefile.mk&lt;br /&gt;
	+-$(RM) $@&lt;br /&gt;
	$(TYPE) myshl.flt &amp;amp;gt; $@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;It strikes that, beside other&lt;br /&gt;
disadvantages, there&amp;#039;s even more platform specific bloat. It also&lt;br /&gt;
illustrates that when section V. comes into play, things are getting&lt;br /&gt;
a bit more cryptic.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;The last but one example builds an&lt;br /&gt;
application or two. It takes some more lines in this example because&lt;br /&gt;
one has to cope with some handling/defaults not applicable for this&lt;br /&gt;
example.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..&lt;br /&gt;
TARGET=test_app&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some defaults&lt;br /&gt;
&lt;br /&gt;
NO_DEFAULT_STL=TRUE&lt;br /&gt;
LIBTARGET=NO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJFILES= \&lt;br /&gt;
    $(OBJ)$/app_source.obj \&lt;br /&gt;
    $(OBJ)$/app_source_cxx.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# normay defined in &amp;quot;solenv/inc/libs.mk&amp;quot;&lt;br /&gt;
.IF &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
MYSHLLIB=-lmyshl&lt;br /&gt;
MYSHLLIB_CXX=-lmyshl_cxx&lt;br /&gt;
.ELSE        # &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
MYSHLLIB=imyshl.lib&lt;br /&gt;
MYSHLLIB_CXX=imyshl_cxx.lib&lt;br /&gt;
.ENDIF     # &amp;quot;$(GUI)&amp;quot;==&amp;quot;UNX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some more defaults&lt;br /&gt;
APP1LIBSALCPPRT=&lt;br /&gt;
APP1NOSAL=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
APP1TARGET=myapp&lt;br /&gt;
APP1STDLIBS=$(MYSHLLIB)&lt;br /&gt;
APP1OBJS=$(OBJ)$/app_source.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# avoid some more defaults&lt;br /&gt;
APP2LIBSALCPPRT=&lt;br /&gt;
APP2NOSAL=TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
APP2TARGET=myapp_cxx&lt;br /&gt;
APP2STDLIBS=$(MYSHLLIB_CXX)&lt;br /&gt;
APP2OBJS=$(OBJ)$/app_source_cxx.obj&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Beside this “example specific”&lt;br /&gt;
stuff, the requirements for linking an application are quite simple.&lt;br /&gt;
Just fill three variables to define input and output. No need to care&lt;br /&gt;
about fancy linker switches or similar.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Note also that the linked object files&lt;br /&gt;
appear twice. Once in OBJFILES to make them a  regular target and&lt;br /&gt;
twice in APPnOBJS to link them to the application. Both occurrences&lt;br /&gt;
are required if the objects are not built elsewhere.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Getting to the end of those examples,&lt;br /&gt;
some Java stuff.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PRJNAME=prjsample&lt;br /&gt;
PRJ=..$/..$/..$/..&lt;br /&gt;
TARGET=cssu&lt;br /&gt;
PACKAGE=com$/sun$/star$/unsupported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : settings.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JAVACLASSFILES= \&lt;br /&gt;
	$(CLASSDIR)$/$(PACKAGE)$/something.class&lt;br /&gt;
&lt;br /&gt;
JARTARGET=something.jar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.INCLUDE : target.mk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ALLTAR : runjar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
runjar : $(CLASSDIR)$/$(JARTARGET)&lt;br /&gt;
    java -classpath $(CLASSDIR)$/$(JARTARGET) com.sun.star.unsupported.something&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Simple as this is creating a jar file&lt;br /&gt;
containing compiled Java files located in the current directory. For&lt;br /&gt;
supporting the Java package structures, section I. contains one more&lt;br /&gt;
variable which contains the package defined in the files located in&lt;br /&gt;
this directory.&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As a final goodie an example how to&lt;br /&gt;
include an own target and make sure it is handled according to it&amp;#039;s&lt;br /&gt;
dependencies.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ALLTAR : runjar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;This simply inserts the target in the&lt;br /&gt;
global dependency tree. As “runjar” doesn&amp;#039;t correspond with a&lt;br /&gt;
filename, it&amp;#039;s regarded “out of date” in each dmake run.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;runjar : $(CLASSDIR)$/$(JARTARGET)&lt;br /&gt;
    java -classpath $(CLASSDIR)$/$(JARTARGET) com.sun.star.unsupported.something&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;As “runjar” requires the jar file&lt;br /&gt;
to exist, it&amp;#039;s lined up as a dependency of this target. This makes&lt;br /&gt;
sure that the command line isn&amp;#039;t executed before the jarfile exists.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;An often seen construct&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
all: \&lt;br /&gt;
	ALLTAR \&lt;br /&gt;
	runjar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;is by no means a useful alternative!&lt;br /&gt;
(still remember the first part?)&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Recalling the content of the previous&lt;br /&gt;
topics of this document and looking at the samples given, it should&lt;br /&gt;
be possible to get an idea of how to write a makefile.mk and what to&lt;br /&gt;
avoid. Nevertheless the next section of this document tries to&lt;br /&gt;
summarize and also give some additional rules of thumb.&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Summary&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;With centralized targets as available&lt;br /&gt;
in SO/OOo environment, writing a makefile.mk normally is done in two &lt;br /&gt;
steps:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;First make sure to create a&lt;br /&gt;
	skeleton which contains the required variables matching your&lt;br /&gt;
	module/directory and the standard includes.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Second fill up section III. with&lt;br /&gt;
	the variables needed to define your targets. It may be quite&lt;br /&gt;
	convenient to recycle an existing makfile.mk but just copying all&lt;br /&gt;
	isn&amp;#039;t that useful (see “Rules of thumb” later on).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;When writing own targets (section V.)&lt;br /&gt;
there some more things to check:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is it required to write an own&lt;br /&gt;
	target?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is my target stating it&amp;#039;s&lt;br /&gt;
	dependencies?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Are there other targets that&lt;br /&gt;
	depend on mine? At least ALLTAR should or your target will never be&lt;br /&gt;
	touched.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is all output protected against&lt;br /&gt;
	colliding with an other platform building this target at the same&lt;br /&gt;
	time?&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Is there any time consuming action&lt;br /&gt;
	done more than once? This primary addresses file system operations&lt;br /&gt;
	like zip, unzip and copying.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;And last but not least, some general&lt;br /&gt;
rules which may help writing makefiles that do not cause unexpected&lt;br /&gt;
behavior some day later on:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;A sane makefile.mk shouldn&amp;#039;t build&lt;br /&gt;
	anything on second dmake call (there are some very rare exceptions&lt;br /&gt;
	otherwise it would have been a must).&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;A sane makefile.mk must rebuild&lt;br /&gt;
	the according targets when any source file gets touched.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Do not write targets that require&lt;br /&gt;
	manual intervention when rebuilding after encountering an error.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;Use real files as targets to avoid&lt;br /&gt;
	unnecessary rebuilds.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;And my private favorite:&amp;lt;BR&amp;gt;remove&lt;br /&gt;
	all lines you do not understand!&amp;lt;BR&amp;gt;You&amp;#039;ll either not need them&lt;br /&gt;
	(most cases) or you should learn why they are required and what&lt;br /&gt;
	they&amp;#039;re doing.&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P STYLE=&amp;quot;margin-bottom: 0in&amp;quot;&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Links&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;Some links which might be helpful when dealing with makefiles in&lt;br /&gt;
the OOo/SO environment:&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;The dmake documentation&lt;br /&gt;
	itself:&amp;lt;BR&amp;gt;http://tools.openoffice.org/source/browse/*checkout*/tools/dmake/man/dmake.nc (plain text)&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;The environment documentation on&lt;br /&gt;
	OOo:&amp;lt;BR&amp;gt;http://tools.openoffice.org/build_env.html http://tools.openoffice.org/build_env.html&lt;br /&gt;
	(although slightly outdated)&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
	&amp;lt;LI&amp;gt;&amp;lt;P&amp;gt;And the main entry point for building&lt;br /&gt;
	OOo:&amp;lt;BR&amp;gt;http://tools.openoffice.org/&amp;lt;/P&amp;gt;&amp;lt;/LI&amp;gt;&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;H1 CLASS=&amp;quot;western&amp;quot;&amp;gt;Glossary&amp;lt;/H1&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;Not yet&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hjs</name></author>
	</entry>
</feed>