diff options
Diffstat (limited to 'tmake/doc/tmake_ref.html')
-rw-r--r-- | tmake/doc/tmake_ref.html | 117 |
1 files changed, 36 insertions, 81 deletions
diff --git a/tmake/doc/tmake_ref.html b/tmake/doc/tmake_ref.html index 0b89b28..c9124c4 100644 --- a/tmake/doc/tmake_ref.html +++ b/tmake/doc/tmake_ref.html @@ -1,67 +1,11 @@ <!doctype HTML public "-//W3C//DTD HTML 3.2//EN"> <html><head><title> -tmake Reference Manual +Reference Manual - tmake </title></head><body bgcolor="#ffffff"> -<p><h1 align=center>tmake Reference Manual</h1> +<p><h1 align=center>Reference Manual - tmake</h1> <hr> -<h2>Project Settings</h2> - -tmake recognizes several project tags. The syntax for setting a -project variable is:<pre> - TAG = value -</pre> -You can also do tag expansion using $$:<pre> - ALLFILES = Project files: $$HEADERS $$SOURCES -</pre> -Normally you assign to a tag, but you can also add to a tag, subtract -from a tag or replace parts of the tag.<pre> - A = abc - X = xyz - A += def # A = abc def - X *= xyz # X = xyz - B = $$A # B = abc def - B -= abc # B = def - X /= s/y/Y/ # X = xYz -</pre> -The *= operation adds the value if the tag does not already contain it. -The /= operation performs regular expression substitution. - -<p> -You can also set tags from the command line when running the tmake program. -For instance, if you want to generate a makefile with debug information:<pre> - tmake hello.pro "CONFIG+=debug" -</pre> - -<p> -Use the <tt>unix:</tt> or <tt>win32:</tt> qualifier if you want a -platform-specific tag:<pre> - SOURCES = common.cpp # common for all platforms - unix:SOURCES += unix.cpp # additional sources for Unix - win32:SOURCES += win32.cpp # additional sources for Windows - unix:LIBS += -lm # on Unix we need the math lib -</pre> -If none of the platforms match, tmake looks for the tag in <a -href="#CONFIG">CONFIG</a> setting:<pre> - debug:SOURCES += dbgstuff.cpp # additional source for debugging -</pre> - -Finally, you can set platform and compiler-dependent tags:<pre> - linux-g++:TMAKE_CFLAGS = -fno-rtti -</pre> - -<p> -You may define your own project tags to be used by custom templates. A -project tag is stored in <code>%project</code>, which is an associative -Perl array. Access it like this: <code>$project{"tag"}</code> or via the -function <code>Project('tag')</code>. For example, after reading -"hello.pro", <code>$project{"SOURCES"}</code> contains "hello.cpp -main.cpp". One limitation of tmake is that it cannot handle file names -with white space.<p> - - -<hr> -<h2>Project Tag Reference</h2> +<h2>Project Variable Reference</h2> <h4><a name="ALL_DEPS"></a>ALL_DEPS</h4> Specifies additional dependencies for the makefile target "all:".<p> @@ -158,6 +102,12 @@ These options defines the application/library type: </table> +<h4><a name="DEFINES"></a>DEFINES</h4> +Specifies C/C++ macros (-D compiler option). On Windows you need +to let DEFINES contain "QT_DLL" if you are building a Qt program +which should link with the Qt DLL. + + <h4><a name="DEF_FILE"></a>DEF_FILE</h4> Win32/app.t only: Specifies a .def file. @@ -175,14 +125,14 @@ Defines the header files of the project. <h4><a name="INCPATH"></a>INCPATH</h4> -This tag is generated from <code>INCLUDEPATH</code>. The ';' or ':' +This variable is generated from <code>INCLUDEPATH</code>. The ';' or ':' separators have been replaced by ' ' (single space). This makes it easier to split. qtapp.t and other templates expand <code>INCPATH</code> to set -I options for the C++ compiler. <h4><a name="INCLUDEPATH"></a>INCLUDEPATH</h4> -This tag specifies the #include directories. It can be set in the +This variable specifies the #include directories. It can be set in the project file, or by the <a href="#AddIncludePath">AddIncludePath()</a> function.<p> Example:<pre> @@ -214,7 +164,7 @@ See also: <a href="#OBJECTS_DIR">OBJECTS_DIR</a>. <h4><a name="OBJECTS"></a>OBJECTS</h4> -This tag is generated from <code>SOURCES</code> by the StdInit() function. +This varialble is generated from <code>SOURCES</code> by the StdInit() function. The extension of each source file has been replaced by .o (Unix) or .obj (Win32).<p> Example:<pre> @@ -236,7 +186,7 @@ See also: <a href="#MOC_DIR">MOC_DIR</a>. <h4><a name="OBJMOC"></a>OBJMOC</h4> -This tag is generated by the <a href="#StdInit">StdInit()</a> function if +This variable is generated by the <a href="#StdInit">StdInit()</a> function if <code>$moc_aware</code> is true. <code>OBJMOC</code> contains the name of all intermediate moc object files.<p> Example:<pre> @@ -258,7 +208,7 @@ file, excluding the .pro extension. <h4><a name="RC_FILE"></a>RC_FILE</h4> Win32/app.t only: Specifies a .rc file. Cannot be used with the RES_FILE -tag. +variable. <h4><a name="RES_FILE"></a>RES_FILE</h4> @@ -271,7 +221,7 @@ Defines the source files of the project. <h4><a name="SRCMOC"></a>SRCMOC</h4> -This tag is generated by the <a href="#StdInit">StdInit()</a> function if +This variable is generated by the <a href="#StdInit">StdInit()</a> function if <code>CONFIG</code> contains "qt". <code>SRCMOC</code> contains the name of all intermediate moc files.<p> Example:<pre> @@ -303,8 +253,8 @@ Contains the name of the compiler. Contains the default compiler flags. -<h4><a name="TMAKE_FILETAGS"></a>TMAKE_FILETAGS</h4> -Tells tmake which tags contain file names. This is because tmake +<h4><a name="TMAKE_FILEVARS"></a>TMAKE_FILEVARS</h4> +Tells tmake which variables contain file names. This is because tmake on Windows replace the directory separator / with \. @@ -370,7 +320,7 @@ Example:<pre> <h3>Config(string)</h3> -Returns true if the <code>CONFIG</code> tag contains the given string. +Returns true if the <code>CONFIG</code> variable contains the given string. <p>Example:<pre> #$ if ( Config("release") { } </pre> @@ -390,20 +340,20 @@ EnableOutput() is called. Enables tmake output after DisableOutput() was called. -<h3>Expand(tag)</h3> -Expands a project tag. Equivalent to <code>$text = $project{$tag}</code>. +<h3>Expand(var)</h3> +Expands a project variable. Equivalent to <code>$text = $project{$var}</code>. <p>Example:<pre> VERSION = #$ Expand("VERSION"); </pre>Output:<pre> VERSION = 1.1 </pre> -<h3>ExpandGlue(tag,prepend,glue,append)</h3> -Expands a $project{} tag, splits on whitespace +<h3>ExpandGlue(var,prepend,glue,append)</h3> +Expands a $project{} variable, splits on whitespace and joins with $glue. $prepend is put at the start of the string and $append is put at the end of the string. The resulting string ($text) becomes "" if -the project tag is empty or not defined.<p> +the project variable is empty or not defined.<p> Example:<pre> clear: #$ ExpandGlue("OBJECTS","-del","\n\t-del ",""); @@ -414,9 +364,9 @@ Example:<pre> </pre> -<h3>ExpandList(tag)</h3> +<h3>ExpandList(var)</h3> This function is suitable for expanding lists of files. -Equivalent with <code>ExpandGlue($tag,""," \\\n\t\t","")</code>.<p> +Equivalent with <code>ExpandGlue($var,""," \\\n\t\t","")</code>.<p> Example:<pre> OBJECTS = #$ ExpandList("OBJECTS"); </pre>Output:<pre> @@ -425,6 +375,11 @@ Example:<pre> </pre> +<h3>ExpandPath(var,prepend,glue,append)</h3> +Similar to ExpandGlue, except that it splits the items on a semicolon +instead of space (if the variable contains at least one semicolon). + + <h3>IncludeTemplate(file)</h3> Includes a template file. The ".t" extension is optional.<p> Example:<pre> @@ -477,7 +432,7 @@ between). <h3><a name="ScanProject"></a>ScanProject(file)</h3> -Scans a project file and stores the project tags and values in the +Scans a project file and stores the project variables and values in the global associative <code>%project</code> array. @@ -485,7 +440,7 @@ global associative <code>%project</code> array. Standard initialization of tmake. StdInit() should be called from one of the first lines in the template.<p> -This function creates some new project tags:<ul> +This function creates some new project variables:<ul> <li><code><a href="#OBJECTS">OBJECTS</a></code> - Object files corresponding to <code><a href="#SOURCES">SOURCES</a></code>. @@ -493,16 +448,16 @@ This function creates some new project tags:<ul> <li><code><a href="#OBJMOC">OBJMOC</a></code> - moc object files. </ul> -The moc-related tags are created only if <code>CONFIG</code> contains "qt" +The moc-related variables are created only if <code>CONFIG</code> contains "qt" <h3>Substitute(string)</h3> -This function takes a string and substitutes any occurrence of $$tag -with the actual content of the tag. Returns the substituted string. +This function takes a string and substitutes any occurrence of $$var +with the actual content of the variable. Returns the substituted string. Also sets $text. <p> Important: Use single quotes around the string, otherwise perl will expand -any $tags it finds. +any $vars it finds. <p>Example:<pre> Substitute('Project name: $$PROJECT, uses template $$TEMPLATE'); </pre> |