-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.xml
76 lines (64 loc) · 2.38 KB
/
build.xml
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
<?xml version="1.0"?>
<project name="COOJA Serial2Pty" default="compile" basedir=".">
<property name="java" location="java"/>
<property name="native" location="native"/>
<property name="build" location="build"/>
<property name="lib" location="lib"/>
<property name ="contiki_base" value="../../../../../contiki" />
<property name="log4j_jar" value="${contiki_base}/tools/cooja/dist/lib/log4j.jar"/>
<property name="cooja_jar" value="${contiki_base}/tools/cooja/dist/cooja.jar"/>
<property name="cooja_mspsim_jar" value="${contiki_base}/tools/cooja/apps/mspsim/lib/cooja_mspsim.jar"/>
<target name="init">
<tstamp/>
</target>
<target name="compile" depends="init">
<mkdir dir="${build}"/>
<javac srcdir="${java}" destdir="${build}" debug="on">
<classpath>
<pathelement path="."/>
<pathelement location="${log4j_jar}"/>
<pathelement location="${cooja_jar}"/>
<pathelement location="${cooja_mspsim_jar}"/>
</classpath>
</javac>
</target>
<target name="clean" depends="init, clean-native">
<delete dir="${build}"/>
<delete file="${lib}/serial2pty.jar"/>
</target>
<target name="jar" depends="clean, init, compile, compile-native">
<mkdir dir="${lib}"/>
<jar destfile="${lib}/serial2pty.jar" basedir="${build}">
<manifest>
<attribute name="Class-Path" value="."/>
</manifest>
</jar>
</target>
<!-- ==================== JNI stuff ==================== -->
<target name="compile-header" depends="compile">
<javah outputFile="${build}/LinuxPseudoTerminal.h" classpath="${build}"
class="de.fau.cooja.plugins.LinuxPseudoTerminal" />
</target>
<target name="copy-native-includes" depends="compile-header">
<mkdir dir="${native}/include" />
<copy todir="${native}/include">
<fileset dir="${build}">
<include name="**/*.h" />
</fileset>
</copy>
</target>
<target name="compile-native" depends="copy-native-includes">
<exec executable="make" dir="${native}" failonerror="true" newenvironment="false" />
<copy todir="${lib}">
<fileset dir="${native}">
<include name="*.so" />
</fileset>
</copy>
</target>
<target name="clean-native" depends="init">
<exec executable="make" dir="${native}" failonerror="false">
<arg value="clean"/>
</exec>
<delete file="${lib}/libpty.so"/>
</target>
</project>