File: build.xml

package info (click to toggle)
jinput 20100502+dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,192 kB
  • ctags: 3,159
  • sloc: java: 9,641; xml: 1,026; ansic: 922; awk: 34; makefile: 32; sh: 11
file content (55 lines) | stat: -rw-r--r-- 2,191 bytes parent folder | download | duplicates (3)
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
<?xml version="1.0"?>

<!-- Written to assume that classpath is rooted in the current directory. -->
<!-- So this should be OK if you make this script in the root of a filesystem. -->
<!-- If not, you may prefer to adjust the basedir, or move some directories around. -->
<!-- The idea is that both Ant and NetBeans have to know what the package root is -->
<!-- for the classes in your application. -->
<project name="JInput Linux port, Native code" basedir="." default="compileNativeJinputLib">
	<property name="libname64" value="libjinput-linux64.so"/>
	<property name="libname32" value="libjinput-linux.so"/>
	<property name="libname" value="libjinput.so"/>
	
	<target name="createNativeDefinitions.java">
		<exec dir="." executable="gawk" os="Linux" output="../java/net/java/games/input/NativeDefinitions.java">
			<arg line="-f"/>
			<arg line="getDefinitions"/>
			<arg line="/usr/include/linux/input.h"/>
		</exec>
	</target>

	<target name="clean">
		<delete>
			<fileset dir="." includes="*.o"/>
			<fileset dir="." includes="*.so"/>
		</delete>
	</target>
	
    <target name="compileNativeJinputLib">
		<exec executable="uname" outputproperty="hwplatform">
			<arg value="-m"/>
		</exec>
<!--		<condition property="libname" value="${libname64}" else="${libname32}">
			<equals arg1="${hwplatform}" arg2="x86_64"/>
		</condition>	-->
		<apply dir="." executable="cc" os="Linux" dest="." skipemptyfilesets="true" failonerror="true">
			<arg line="-O2 -Wall -c -fPIC"/>
			<arg value="-I${java.home}/include"/>
			<arg value="-I${java.home}/include/linux"/>
			<arg value="-I${java.home}/../include"/>
			<arg value="-I${java.home}/../include/linux"/>
			<arg value="-I../../../common/src/native"/>
			<mapper type="glob" from="*.c" to="*.o"/>
			<fileset dir="." includes="*.c"/>
			<fileset dir="../../../common/src/native" includes="*.c"/>
		</apply>
		<apply dir="." parallel="true" executable="cc" os="Linux" failonerror="true">
			<arg line="-shared -O2 -Wall -o ${libname}"/>
			<fileset dir="." includes="*.o"/>
		</apply>
		<apply dir="." parallel="true" executable="strip" os="Linux" failonerror="true">
			<fileset file="${libname}"/>
		</apply>
    </target>
</project>