1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>cpptasks: Compile tasks for Apache Ant - cpptasks for Apache Ant</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body class="composite">
<div id="banner">
<a href="http://ant-contrib.sourceforge.net/" id="bannerLeft">
ant-contrib
</a>
<a href="http://www.sourceforge.net/" id="bannerRight">
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
Last Published: 2008-04-02
|
<a href="http://ant-contrib.sourceforge.net/" class="externalLink">ant-contrib</a>
>
cpptasks
</div>
<div class="xright">
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Get cpptasks</h5>
<ul>
<li class="none">
<a href="http://sourceforge.net/project/showfiles.php?group_id=36177" class="externalLink">Download</a>
</li>
<li class="none">
<a href="changes-report.html">Changes</a>
</li>
<li class="none">
<a href="license.html">License</a>
</li>
</ul>
<h5>About cpptasks</h5>
<ul>
<li class="none">
<strong>Usage</strong>
</li>
</ul>
<h5>Elements</h5>
<ul>
<li class="none">
<a href="antdocs/CCTask.html">cc</a>
</li>
<li class="none">
<a href="antdocs/CompilerDef.html">compiler</a>
</li>
<li class="none">
<a href="antdocs/DefineSet.html">defineset</a>
</li>
<li class="none">
<a href="antdocs/DistributerDef.html">distributer</a>
</li>
<li class="none">
<a href="antdocs/LibrarySet.html">libraryset</a>
</li>
<li class="none">
<a href="antdocs/LinkerDef.html">linker</a>
</li>
<li class="none">
<a href="antdocs/SystemLibrarySet.html">syslibraryset</a>
</li>
<li class="none">
<a href="antdocs/TargetDef.html">targetplatform</a>
</li>
<li class="none">
<a href="antdocs/VersionInfo.html">versioninfo</a>
</li>
</ul>
<h5>Community</h5>
<ul>
<li class="none">
<a href="mail-lists.html">Mailing Lists</a>
</li>
<li class="none">
<a href="issue-tracking.html">Issue Tracking</a>
</li>
<li class="none">
<a href="http://sourceforge.net/projects/ant-contrib/" class="externalLink">Project Page</a>
</li>
<li class="none">
<a href="http://sourceforge.net/news/?group_id=36177" class="externalLink">News</a>
</li>
</ul>
<h5>Development</h5>
<ul>
<li class="none">
<a href="source-repository.html">Repository</a>
</li>
<li class="none">
<a href="apidocs/index.html">JavaDoc</a>
</li>
<li class="none">
<a href="integration.html">Continuous Integration</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section"><h2>cpptasks for Apache Ant</h2>
<p>The cc task can compile various source languages and produce executables, shared libraries (aka DLL's) and static libraries. Compiler adaptors are currently available for C/C++, FORTRAN, MIDL and Windows Resource compilers.</p>
<p>The task can be used with Apache Ant 1.5 and later. This software is not a product of the Apache Software Foundation (ASF) and no endorsement by the ASF is implied.</p>
<p>To use: * Place cpptasks.jar into Ant's classpath by placing in Ant's lib directory, adding to CLASSPATH environment variable or using the -lib command line option.</p>
<ul><li>Add type and task definitions in build file using either taskdef or antlib.</li>
<li>Add <a href="antdocs/CCTask.html">cc</a>
element to some target in your build file.</li>
<li>Set path and environment variables to be able to run compiler from command line.</li>
<li>Build project.</li>
</ul>
<p>Trivial Sample using taskdef (compatible with Ant 1.5 or later):</p>
<div class="source"><pre><project name="hello" default="compile">
<taskdef resource="cpptasks.tasks"/>
<target name="compile">
<mkdir dir="target/main/obj"/>
<cc outtype="executable" subsystem="console" outfile="target/hello" objdir="target/main/obj">
<fileset dir="src/main/c" includes="*.c"/>
</cc>
</target>
</project></pre>
</div>
<p>Trivial Sample using antlib (compatible with Ant 1.6 or later):</p>
<div class="source"><pre><project name="hello" default="compile" xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks">
<target name="compile">
<mkdir dir="target/main/obj"/>
<cpptasks:cc outtype="executable" subsystem="console" outfile="target/hello" objdir="target/main/obj">
<fileset dir="src/main/c" includes="*.c"/>
</cpptasks:cc>
</target>
</project></pre>
</div>
<p>More complex samples appear in src/samples.</p>
</div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">©
2001-2008
Ant-Contrib Project
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>
|