author | szarinda <> |
Thu, 21 Jan 2010 17:29:01 +0000 | |
changeset 0 | 42188c7ea2d9 |
permissions | -rw-r--r-- |
0
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
1 |
<!doctype HTML public "-//W3C//DTD HTML 3.2//EN"> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
2 |
<html><head><title> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
3 |
User's Guide - tmake |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
4 |
</title></head><body bgcolor="#ffffff"> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
5 |
<p><h1 align=center>User's Guide - tmake</h1> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
6 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
7 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
8 |
<hr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
9 |
<h2>Introduction</h2> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
10 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
11 |
tmake is an easy-to-use tool from Troll Tech to create and maintain |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
12 |
makefiles for software projects. It can be a painful task to manage |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
13 |
makefiles manually, especially if you develop for more than one platform |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
14 |
or use more than one compiler. tmake automates and streamlines this |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
15 |
process and lets you spend your valuable time on writing code, not |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
16 |
makefiles. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
17 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
18 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
19 |
Our main motivation for developing tmake was that we spent far too much |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
20 |
time maintaining makefiles for <a href="http://www.troll.no/qt">Qt</a>, |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
21 |
our cross-platform GUI toolkit. Qt supports around 15 flavors of Unix, |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
22 |
Microsoft Windows, and around 15 different C++ compilers. We looked at |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
23 |
GNU autoconf, but it was Unix-specific and not flexible enough in our |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
24 |
opinion. Our makefile system also had to deal with Qt <a |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
25 |
href="http://www.troll.no/qt/metaobjects.html">meta object compiler</a> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
26 |
(moc) issues. The moc program extracts meta information from C++ files and |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
27 |
generates a C++ file with data tables etc. It takes extra work to add |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
28 |
makefile rules for the moc and wanted to automate this task. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
29 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
30 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
31 |
tmake is written in Perl and requires that you have installed perl version |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
32 |
5 or newer. Basic use of tmake requires no perl knowledge, but if you know |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
33 |
perl you can extend tmake and write your own makefile templates. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
34 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
35 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
36 |
<b>Windows users:</b> The tmake distribution for Win32 includes tmake.exe |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
37 |
(built by the perl2exe utility) and you do not need to download and |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
38 |
install perl unless you want to modify the tmake source code or run other |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
39 |
perl scripts. You can download perl for Win32 (Windows NT and 95) from <a |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
40 |
href="http://www.activestate.com">www.activestate.com</a> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
41 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
42 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
43 |
tmake is free software and you may use, copy, modify and distribute tmake |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
44 |
and its documentation for any purpose and without any fee. See the |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
45 |
LICENSE file for details. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
46 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
47 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
48 |
Feedback is highly appreciated. Contact the author, Haavard Nord <a |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
49 |
href="mailto:hanord@troll.no">(hanord@troll.no)</a>, if you have ideas, |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
50 |
patches etc. for tmake. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
51 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
52 |
<hr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
53 |
<h2>Installation</h2> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
54 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
55 |
<ol> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
56 |
<li>Make sure you have perl version 5 or later installed (optional |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
57 |
for Windows users). |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
58 |
<li>Unpack the tmake tar.gz archive for Unix or the tmake .zip file for Windows. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
59 |
<li>Set the TMAKEPATH environment variable to the directories |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
60 |
containing the template files (see below). |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
61 |
<li>Add the tmake/bin directory to your PATH. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
62 |
</ol> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
63 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
64 |
Here are some examples:<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
65 |
<strong>Unix Bourne shell:</strong><pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
66 |
TMAKEPATH=/local/tmake/lib/linux-g++ |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
67 |
PATH=$PATH:/local/tmake/bin |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
68 |
export TMAKEPATH PATH |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
69 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
70 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
71 |
<strong>Unix C shell:</strong><pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
72 |
setenv TMAKEPATH /local/tmake/lib/linux-g++ |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
73 |
setenv PATH $PATH:/local/tmake/bin |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
74 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
75 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
76 |
<strong>Microsoft Windows:</strong><pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
77 |
set TMAKEPATH=c:\tmake\lib\win32-msvc |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
78 |
set PATH=%PATH%;c:\tmake\bin |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
79 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
80 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
81 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
82 |
The template directory name has the form <em>platform</em>-<em>compiler</em> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
83 |
and contains a platform configuration file (tmake.conf) and tmake template |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
84 |
files. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
85 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
86 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
87 |
Supported platforms: AIX, Data General, FreeBSD, HPUX, SGI Irix, Linux, |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
88 |
NetBSD, OpenBSD, OSF1/DEC, SCO, Solaris, SunOS, Ultrix, Unixware and |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
89 |
Win32. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
90 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
91 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
92 |
You can find your platform-compiler combination in the <tt>tmake/lib</tt>. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
93 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
94 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
95 |
<b>Unix users:</b> tmake requires that perl is in /usr/bin. If your |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
96 |
version of perl is elsewehere, either change the first line of tmake or |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
97 |
make a small shell script which invokes tmake with the correct perl. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
98 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
99 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
100 |
<hr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
101 |
<h2>Getting Started</h2> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
102 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
103 |
Let's assume you have a small Qt application consisting of one C++ header |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
104 |
file and two source files. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
105 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
106 |
First you need to create a tmake project file, e.g. hello.pro:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
107 |
HEADERS = hello.h |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
108 |
SOURCES = hello.cpp main.cpp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
109 |
TARGET = hello |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
110 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
111 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
112 |
Then run tmake to create a Makefile:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
113 |
tmake hello.pro -o Makefile |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
114 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
115 |
And finally:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
116 |
make |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
117 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
118 |
This builds the hello program. Remember to set the <code>TMAKEPATH</code> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
119 |
environment variable before you run tmake. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
120 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
121 |
See <a href="m-linux-gcc.html">Makefile for Linux/g++</a>.<br> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
122 |
See <a href="m-win32-msvc.html">Makefile for Win32/msvc</a> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
123 |
(Microsoft Visual C++).<br> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
124 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
125 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
126 |
<hr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
127 |
<h2>Makefile Templates</h2> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
128 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
129 |
The tmake distribution includes three makefile templates and one |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
130 |
configuration file for each platform/compiler combination. The |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
131 |
<code>TMAKEPATH</code> environment variable tells tmake where to find |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
132 |
these files: |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
133 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
134 |
<table border="0"> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
135 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
136 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
137 |
<td>app.t</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
138 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
139 |
<td>Creates a makefile for building applications.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
140 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
141 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
142 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
143 |
<td>lib.t</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
144 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
145 |
<td>Creates a makefile for building libraries.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
146 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
147 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
148 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
149 |
<td>subdirs.t</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
150 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
151 |
<td>Creates a makefile for building targets in subdirectories.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
152 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
153 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
154 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
155 |
<td>tmake.conf</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
156 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
157 |
<td>This configuration file contains compiler options and lists |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
158 |
tools and libraries. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
159 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
160 |
</table> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
161 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
162 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
163 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
164 |
The hello.pro project file above does not have a <code>TEMPLATE</code> or |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
165 |
a <code>CONFIG</code> variable. The default template is <tt>app</tt> (the .t |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
166 |
extension is optional) and the default configuration is <tt>qt warn_on |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
167 |
release</tt>. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
168 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
169 |
This project file produces exactly the same result as the hello.pro |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
170 |
above:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
171 |
TEMPLATE = app |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
172 |
CONFIG = qt warn_on release |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
173 |
HEADERS = hello.h |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
174 |
SOURCES = hello.cpp main.cpp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
175 |
TARGET = hello |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
176 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
177 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
178 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
179 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
180 |
<h4>Makefile Configuration</h4> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
181 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
182 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
183 |
The <code>CONFIG</code> variable is recognized by both the app.t and lib.t |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
184 |
templates and specifies what compiler options to use and which extra |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
185 |
libraries to link in. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
186 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
187 |
These options control the compilation flags: |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
188 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
189 |
<table border="0"> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
190 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
191 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
192 |
<td>release</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
193 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
194 |
<td>Compile with optimization enabled, ignored if |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
195 |
"debug" is specified.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
196 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
197 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
198 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
199 |
<td>debug</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
200 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
201 |
<td>Compile with debug options enabled.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
202 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
203 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
204 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
205 |
<td>warn_on</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
206 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
207 |
<td>The compiler should emit more warnings than normally, ignored if |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
208 |
"warn_off" is specified.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
209 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
210 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
211 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
212 |
<td>warn_off</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
213 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
214 |
<td>The compiler should emit no warnings or as few as possible.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
215 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
216 |
</table> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
217 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
218 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
219 |
These options defines the application/library type: |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
220 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
221 |
<table border="0"> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
222 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
223 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
224 |
<td>qt</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
225 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
226 |
<td>The target is a Qt application/library and requires Qt header |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
227 |
files/library.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
228 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
229 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
230 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
231 |
<td>opengl</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
232 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
233 |
<td>The target requires the OpenGL (or Mesa) headers/libraries.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
234 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
235 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
236 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
237 |
<td>x11</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
238 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
239 |
<td>The target is a X11 application or library.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
240 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
241 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
242 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
243 |
<td>windows</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
244 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
245 |
<td>The target is a Win32 window application (app.t only).</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
246 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
247 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
248 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
249 |
<td>console</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
250 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
251 |
<td>The target is a Win32 console application (app.t only).</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
252 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
253 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
254 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
255 |
<td>dll</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
256 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
257 |
<td>The target is a shared object/DLL.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
258 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
259 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
260 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
261 |
<td>staticlib</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
262 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
263 |
<td>The target is a static library (lib.t only).</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
264 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
265 |
</table> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
266 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
267 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
268 |
As an example, if the hello application uses both Qt and OpenGL and you |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
269 |
want to compile it for debugging, your <code>CONFIG</code> line should |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
270 |
read:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
271 |
CONFIG = qt opengl debug |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
272 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
273 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
274 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
275 |
The most common tmake options and project variables are described here. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
276 |
See the tmake <a href="tmake_ref.html">reference manual</a> for |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
277 |
details.<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
278 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
279 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
280 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
281 |
<h4>The Application Template</h4> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
282 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
283 |
The application template, app.t, lets you compile and link executable |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
284 |
programs or shared objects (DLLs). |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
285 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
286 |
This template recognizes several variabless. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
287 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
288 |
<table border="0"> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
289 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
290 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
291 |
<td>HEADERS</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
292 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
293 |
<td>Header files.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
294 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
295 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
296 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
297 |
<td>SOURCES</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
298 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
299 |
<td>Source files.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
300 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
301 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
302 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
303 |
<td>TARGET</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
304 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
305 |
<td>Name of executable (adds .exe if on Windows).</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
306 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
307 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
308 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
309 |
<td>DESTDIR</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
310 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
311 |
<td>Where to put the target.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
312 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
313 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
314 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
315 |
<td>DEFINES</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
316 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
317 |
<td>Tell compiler to define C preprocessor macros (-D option).</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
318 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
319 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
320 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
321 |
<td>INCLUDEPATH</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
322 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
323 |
<td>Sets the include file search path for the compiler (-I |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
324 |
option). |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
325 |
</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
326 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
327 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
328 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
329 |
<td>DEPENDPATH</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
330 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
331 |
<td>Sets the dependency search path for tmake.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
332 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
333 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
334 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
335 |
<td>DEF_FILE</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
336 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
337 |
<td>Win32 only: Link with a .def file.</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
338 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
339 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
340 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
341 |
<td>RC_FILE</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
342 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
343 |
<td>Win32 only: Use a .rc file (compile to temporary .res). |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
344 |
</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
345 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
346 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
347 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
348 |
<td>RES_FILE</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
349 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
350 |
<td>Win32 only: Link with a .res file. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
351 |
</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
352 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
353 |
</table> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
354 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
355 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
356 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
357 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
358 |
<h4>The Library Template</h4> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
359 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
360 |
The library template, lib.t, lets you compile and create static or shared |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
361 |
libraries. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
362 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
363 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
364 |
The lib.t template supports the same project variables as app.t, but also |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
365 |
<code>VERSION</code>. <code>VERSION</code> is the version number of the |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
366 |
target library, e.g. 1.40. The version is important for shared libraries. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
367 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
368 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
369 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
370 |
<h4>The Subdirs Template</h4> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
371 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
372 |
The subdirs template, subdirs.t, lets you invoke make in subdirectories. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
373 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
374 |
<p>The <code>SUBDIRS</code> variable contains the name of all subdirectories to |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
375 |
be processed. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
376 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
377 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
378 |
<h4>Special Templates for Microsoft Visual C++</h4> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
379 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
380 |
If you have Microsoft Visual C++ 5.0, you can use two special templates to |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
381 |
generate a MSVC++ IDE project (.dsp file). After you have generated |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
382 |
e.g. hello.dsp, choose "File"->"Open Workspace" and select the hello.dsp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
383 |
file. Visual C++ will then create a workspace (.dsw file) for you.<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
384 |
<table border="0"> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
385 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
386 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
387 |
<td>vcapp.t</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
388 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
389 |
<td>Creates an application project file (Microsoft Visual C++ 5.0 |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
390 |
only).</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
391 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
392 |
<tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
393 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
394 |
<td>vclib.t</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
395 |
<td> </td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
396 |
<td>Creates a library project file (Microsoft Visual C++ 5.0 |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
397 |
only).</td> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
398 |
</tr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
399 |
</table> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
400 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
401 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
402 |
Run tmake to create a hello.dsp file (use -t to override the default |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
403 |
template):<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
404 |
tmake -t vcapp -o hello.dsp hello.pro |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
405 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
406 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
407 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
408 |
<hr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
409 |
<h2>Project File Syntax</h2> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
410 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
411 |
The tmake project file has a very simple syntax. You may set |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
412 |
project variables, append to project variables, remove from |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
413 |
project variable and substitute project variables. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
414 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
415 |
To set a project variable:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
416 |
HEADERS = gui.h xml.h url.h |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
417 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
418 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
419 |
If you cannot fit everything on one line, use '\' to split it up:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
420 |
HEADERS = gui.h \ |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
421 |
xml.h \ |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
422 |
url.h |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
423 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
424 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
425 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
426 |
Project variables contains lists of items (such as header files, |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
427 |
compiler options etc.) and use whitespace to separate the items. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
428 |
This means that tmake cannot deal with items containing whitespace. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
429 |
The INCLUDEPATH variable is an exception. If INCLUDEPATH contains |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
430 |
one or more semicolons (;), tmake uses the semicolon to separate |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
431 |
the include directories, hence you can have include directories |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
432 |
containing whitespace (this is quite common on Windows). |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
433 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
434 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
435 |
Here is an example:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
436 |
INCLUDEPATH = C:\Program Files\DBLib\Include;C:\qt\include |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
437 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
438 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
439 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
440 |
tmake supports <em>project variable expension</em>. Use $$ to expand |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
441 |
any project variable:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
442 |
ALLFILES = $$HEADERS $$SOURCES |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
443 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
444 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
445 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
446 |
Most often you assign some value to a project variable, but you can |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
447 |
also add to, remove from or replace parts of a project variable.<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
448 |
A = abc |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
449 |
X = xyz |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
450 |
A += def # A = abc def |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
451 |
X *= xyz # X = xyz |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
452 |
B = $$A # B = abc def |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
453 |
B -= abc # B = def |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
454 |
X /= s/y/Y/ # X = xYz |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
455 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
456 |
The *= operation adds the value if the variable does not already contain it. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
457 |
The /= operation performs regular expression substitution. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
458 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
459 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
460 |
You can also set variables from the command line when running the tmake |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
461 |
program. For instance, if you want to generate a makefile with debug |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
462 |
information:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
463 |
tmake "CONFIG+=debug" hello.pro |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
464 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
465 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
466 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
467 |
Use the <tt>unix:</tt> or <tt>win32:</tt> (conditional) qualifier if you want a |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
468 |
platform-specific variable:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
469 |
SOURCES = common.cpp # common for all platforms |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
470 |
unix:SOURCES += unix.cpp # additional sources for Unix |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
471 |
win32:SOURCES += win32.cpp # additional sources for Windows |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
472 |
unix:LIBS += -lm # on Unix we need the math lib |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
473 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
474 |
If none of the platforms match, tmake looks for the variable in CONFIG |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
475 |
variable:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
476 |
debug:SOURCES += dbgstuff.cpp # additional source for debugging |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
477 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
478 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
479 |
Finally, you can set platform and compiler-dependent variables:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
480 |
linux-g++:TMAKE_CFLAGS = -fno-rtti |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
481 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
482 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
483 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
484 |
You may define your own project variables to be used by custom templates. A |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
485 |
project variable is stored in <code>%project</code>, which is an associative |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
486 |
Perl array. Access it like this: <code>$project{"var"}</code> or via the |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
487 |
function <code>Project("var")</code>. For example, after reading |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
488 |
"hello.pro", <code>$project{"SOURCES"}</code> contains "hello.cpp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
489 |
main.cpp".<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
490 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
491 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
492 |
<hr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
493 |
<h2><a name="usage"></a>Running tmake</h2> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
494 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
495 |
Usage:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
496 |
tmake [options] <em>project files or project settings</em> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
497 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
498 |
Options:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
499 |
-e expr Evaluate the Perl expression. Ignores the template file. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
500 |
-nodepend Don't generate dependency information. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
501 |
-o <em>file</em> Write output to <em>file</em> instead of stdout. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
502 |
-t <em>file</em> Specify a template <em>file</em>. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
503 |
-unix Force tmake into Unix mode. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
504 |
-v Verbose/debugging on. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
505 |
-win32 Force tmake into Win32 mode. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
506 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
507 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
508 |
The -t option overrides any <code>TEMPLATE</code> variable in the project file. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
509 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
510 |
The default project file extension is ".pro". The default template file |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
511 |
extension is ".t". If you do not specify these extension tmake will |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
512 |
automatically add them for you. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
513 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
514 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
515 |
Example of basic use:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
516 |
tmake hello -o Makefile |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
517 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
518 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
519 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
520 |
Example of how to create a makefile with debugging information:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
521 |
tmake "CONFIG+=debug" hello -o Makefile |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
522 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
523 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
524 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
525 |
Exmaple of how to specify a TMAKEPATH:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
526 |
tmake "TMAKEPATH=/local/tmake/lib/hpux-g++" hello.pro -o Makefile |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
527 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
528 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
529 |
Example of how to evaluate a perl expression (print names of headers |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
530 |
and source files):<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
531 |
tmake hello -e 'Expand("HEADERS","SOURCES")' |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
532 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
533 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
534 |
<hr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
535 |
<h2><a name="progen"></a>The progen Utility</h2> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
536 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
537 |
The progen utility creates project files for you. It can be used like |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
538 |
this:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
539 |
progen -n hello -o hello.pro |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
540 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
541 |
If no .cpp or .h files are specified on the command line, progen |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
542 |
searches for .cpp and .h (except moc_*.cpp) in the current directory |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
543 |
and below. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
544 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
545 |
Usage:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
546 |
progen [options] [<em>C/C++ header files and source files</em>] |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
547 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
548 |
Options:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
549 |
-lower Lower-case letters in filenames (useful on Windows). |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
550 |
-n <em>name</em> Specify a project name (<code>TARGET</code>). |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
551 |
-o <em>file</em> Write output to <em>file</em> instead of stdout. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
552 |
-t <em>file</em> Specify a template <em>file</em>. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
553 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
554 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
555 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
556 |
<hr> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
557 |
<h2>Advanced Topics</h2> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
558 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
559 |
In most cases you will be happy with using tmake as described above, but |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
560 |
sometimes you need to add special compiler options or even add new |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
561 |
makefile rules. This chapter describes how to customize your makefiles. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
562 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
563 |
<h4>Conditional Project Settings</h4> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
564 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
565 |
If you need a special compiler option etc., you can add platform-dependent |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
566 |
settings in your project file:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
567 |
solaris-cc:TMAKE_CC = /opt/bin/CC_5.0 |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
568 |
solaris-cc:TMAKE_CFLAGS = -pts |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
569 |
unix:TMAKE_LIBS = -lXext |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
570 |
win32:INCLUDEPATH = c:\myinclude |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
571 |
win32-borland:DEFINES = NO_BOOL |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
572 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
573 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
574 |
You can prefix a project variable with unix: or win32: to make it specific for |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
575 |
either Unix or Windows. You can also prefix a variable with |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
576 |
<em>platform-compiler</em> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
577 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
578 |
<h4>Your Own Templates</h4> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
579 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
580 |
If you know Perl programming, there is virtually no limitation to what you |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
581 |
can do with tmake. First you need to know how tmake works. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
582 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
583 |
<h4>Template Processing</h4> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
584 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
585 |
When you run tmake, it first reads the <tt>tmake.conf</tt> file. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
586 |
This configuration file has the same syntax as the project file. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
587 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
588 |
tmake then reads the project file and sets the project variables it |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
589 |
finds, e.g. <code>HEADERS</code>, <code>SOURCES</code> etc. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
590 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
591 |
All variables and values are stored in a global associative Perl hash |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
592 |
array called <code>project</code>. For example, |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
593 |
<code>$project{"SOURCES"}</code> contains "hello.cpp main.cpp" |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
594 |
after processing hello.pro. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
595 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
596 |
When both the <tt>tmake.conf</tt> and the project files have been |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
597 |
read, tmake starts reading the template file line by line and |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
598 |
executes any Perl code it finds in the template. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
599 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
600 |
<ul> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
601 |
<li>Anything after <code>#$</code> until newline is |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
602 |
evaluated as perl code. The perl code is substituted |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
603 |
with the contents of the <code>$text</code> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
604 |
variable. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
605 |
<li>Block of perl code: <code>#${</code> until |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
606 |
<code>#$}</code>. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
607 |
<li>Comments; <code>#!</code> until newline is stripped. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
608 |
<li>Anything else is copied directly from the template to |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
609 |
the output. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
610 |
</ul> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
611 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
612 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
613 |
Example:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
614 |
#! This is a comment which will be removed. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
615 |
This text will appear in the output. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
616 |
#$ $text = "The header file(s) are: " . $project{"HEADERS"}; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
617 |
# This text also appears in the output. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
618 |
#${ |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
619 |
$a = 12; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
620 |
$b = 13; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
621 |
$text = $a * $b; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
622 |
#$} |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
623 |
That's all. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
624 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
625 |
Output:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
626 |
This text will appear in the output. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
627 |
The header file(s) are: hello.h |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
628 |
# This text also appears in the output. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
629 |
156 |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
630 |
That's all. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
631 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
632 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
633 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
634 |
<h3>Using tmake With Lex and Yacc</h3> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
635 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
636 |
The standard tmake templates knows how to process C and C++ files, but |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
637 |
sometimes you need to process additional files and link them into your |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
638 |
project. A typical example is to process lex and yacc files when you're |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
639 |
building a parser. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
640 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
641 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
642 |
Parser template:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
643 |
#! |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
644 |
#! parser.t: This is a custom template for building a parser |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
645 |
#! |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
646 |
#$ IncludeTemplate("app.t"); |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
647 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
648 |
####### Lex/yacc programs and options |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
649 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
650 |
LEX = flex |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
651 |
YACC = #$ $text = ($is_unix ? "yacc -d" : "byacc -d"); |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
652 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
653 |
####### Lex/yacc files |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
654 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
655 |
LEXIN = #$ Expand("LEXINPUT"); |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
656 |
LEXOUT = lex.yy.c |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
657 |
YACCIN = #$ Expand("YACCINPUT"); |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
658 |
YACCOUT = y.tab.c |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
659 |
YACCHDR = y.tab.h |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
660 |
PARSER = #$ Expand("PARSER"); |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
661 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
662 |
####### Process lex/yacc files |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
663 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
664 |
$(LEXOUT): $(LEXIN) |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
665 |
$(LEX) $(LEXIN) |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
666 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
667 |
$(PARSER): $(YACCIN) $(LEXOUT) |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
668 |
$(YACC) $(YACCIN) |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
669 |
#$ $text = ($is_unix ? "-rm -f " : "-del ") . '$(PARSER)'; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
670 |
#$ $text = ($is_unix ? "-mv " : "-ren ") . '$(YACCOUT) $(PARSER)'; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
671 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
672 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
673 |
The parser template adds some extra rules to the application template |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
674 |
in order to build the lex and yacc portions of the project. This |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
675 |
template is portable across Unix and Windows since it generates different |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
676 |
commands depending on the <code>$is_unix</code> variable. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
677 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
678 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
679 |
To learn more about the Expand() function and other Perl functions which |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
680 |
tmake provides, consult the <a href="tmake_ref.html">reference manual</a>. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
681 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
682 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
683 |
Example project file:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
684 |
TEMPLATE = parser.t |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
685 |
CONFIG = console release |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
686 |
LEXINPUT = lexer.l |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
687 |
YACCINPUT = grammar.y |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
688 |
PARSER = parser.cpp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
689 |
SOURCES = $$PARSER \ |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
690 |
node.cpp \ |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
691 |
asmgen.cpp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
692 |
TARGET = parser |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
693 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
694 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
695 |
Here we use macro expansion <code>$$PARSER</code> to avoid writing parser.cpp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
696 |
two places. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
697 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
698 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
699 |
<h3>Counting the Number of Code Lines</h3> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
700 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
701 |
tmake is generic since it is based on Perl. You can create your own |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
702 |
templates for other purposes than producing makefiles. Here is an example |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
703 |
template that counts the number of code lines in our project. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
704 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
705 |
<p> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
706 |
Template wc.t:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
707 |
#! Template that count number of C++ lines. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
708 |
The number of C++ code lines for #$ $text=$project_name; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
709 |
#${ |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
710 |
$files = $project{"HEADERS"} . " " . $project{"SOURCES"}; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
711 |
$text = `wc -l $files`; |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
712 |
#$} |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
713 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
714 |
Run it:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
715 |
tmake -t wc hello |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
716 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
717 |
Output:<pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
718 |
The number of C++ code lines for hello.pro |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
719 |
25 hello.h |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
720 |
98 hello.cpp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
721 |
38 main.cpp |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
722 |
161 total |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
723 |
</pre> |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
724 |
This will only work if the wc program is installed on your system. |
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
725 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
726 |
|
42188c7ea2d9
Initial contribution of ORB delivering Feature bug 1460
szarinda <>
parents:
diff
changeset
|
727 |
</body></html> |