blob: ac4696a2e8008b351e58df33e2bdd69096f6530c (
plain)
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
|
~~ Licensed to the Ant-Contrib Project under one or more
~~ contributor license agreements. See the NOTICE file distributed with
~~ this work for additional information regarding copyright ownership.
~~ The Ant-Contrib Project licenses this file to You under the Apache License, Version 2.0
~~ (the "License"); you may not use this file except in compliance with
~~ the License. You may obtain a copy of the License at
~~
~~ http://www.apache.org/licenses/LICENSE-2.0
~~
~~ Unless required by applicable law or agreed to in writing, software
~~ distributed under the License is distributed on an "AS IS" BASIS,
~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~~ See the License for the specific language governing permissions and
~~ limitations under the License.
------
cpptasks for Apache Ant
------
------
------
cpptasks for Apache Ant
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.
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.
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.
* Add type and task definitions in build file using either taskdef or antlib.
* Add {{{antdocs/CCTask.html}cc}} element to some target in your build file.
* Set path and environment variables to be able to run compiler from command line.
* Build project.
Trivial Sample using taskdef (compatible with Ant 1.5 or later):
+--
<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>
+--
Trivial Sample using antlib (compatible with Ant 1.6 or later):
+--
<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>
+--
More complex samples appear in src/samples.
|