aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/linux
diff options
context:
space:
mode:
authorendolf <[email protected]>2003-07-31 18:36:31 +0000
committerendolf <[email protected]>2003-07-31 18:36:31 +0000
commit5c35d9c85a3b151e3c81875c968b649e6a209e15 (patch)
tree33aa0fabbeb70ce107ade2af1221b507d58a9489 /plugins/linux
parent9166957ae68c5ec091d5849b3c0ff228e31ed78f (diff)
no message
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@21 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins/linux')
-rw-r--r--plugins/linux/build.xml83
-rw-r--r--plugins/linux/src/native/build.xml55
2 files changed, 138 insertions, 0 deletions
diff --git a/plugins/linux/build.xml b/plugins/linux/build.xml
new file mode 100644
index 0000000..2666233
--- /dev/null
+++ b/plugins/linux/build.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project basedir="." default="all" name="Linux Plugin">
+
+ <target name="init">
+ <property name="hello" value="world"/>
+ <mkdir dir="classes"/>
+ <mkdir dir="bin"/>
+ </target>
+
+ <target depends="init" name="compile">
+ <javac debug="true" deprecation="true" destdir="classes" source="1.4" srcdir="src/java">
+ <classpath>
+ <pathelement location="../../coreAPI/bin/controller.jar"/>
+ <pathelement location="../../coreAPI/lib/jutils.jar"/>
+ </classpath>
+ </javac>
+ </target>
+
+ <target depends="init,compile" name="jar">
+ <jar jarfile="bin/linux.jar" compress="true" basedir="classes">
+ <exclude name="**/*.java"/>
+ <exclude name="linux.jar"/>
+ <exclude name="apidoc"/>
+ </jar>
+ <copy file="bin/linux.jar" todir="../../coreAPI/src/tests/controller" />
+ </target>
+
+ <target depends="compileNativeJinputLib,jar" description="Build everything." name="all">
+ <echo message="Application built. Hello ${hello}!"/>
+ </target>
+
+ <target name="javadoc" depends="init" description="Javadoc for Linux plugin for JInput.">
+ <mkdir dir="apidocs"/>
+ <javadoc packagenames="net.java.games.input.*"
+ destdir="apidocs"
+ additionalparam="-source 1.4"
+ link="../../../coreAPI/apidocs">
+ <sourcepath>
+ <pathelement location="src/java"/>
+ </sourcepath>
+ <classpath>
+ <pathelement location="../../coreAPI/bin/controller.jar"/>
+ <pathelement location="../../coreAPI/lib/jutils.jar"/>
+ </classpath>
+ </javadoc>
+ </target>
+
+ <target description="Clean all build products." name="clean">
+ <delete>
+ <fileset dir="classes">
+ <include name="**/*.class"/>
+ </fileset>
+ </delete>
+ <delete file="bin/linux.jar" failonerror="no"/>
+ <delete file="src/native/libjinput.so" failonerror="no"/>
+ <delete file="../../coreAPI/src/tests/controller/linux.jar" failonerror="no" />
+ <delete file="../../coreAPI/src/tests/controller/libjinput.so" failonerror="no"/>
+ <delete file="apidoc" failonerror="no"/>
+ </target>
+
+ <target depends="init,compile" name="createJNIHeaders">
+ <javah>
+ <classpath>
+ <pathelement path="src/java"/>
+ <pathelement location="controller.jar"/>
+ </classpath>
+ <class name="net.java.games.input.LinuxDevice"/>
+ <class name="net.java.games.input.LinuxEnvironmentPlugin"/>
+ <class name="net.java.games.input.LinuxKeyboard"/>
+ </javah>
+ </target>
+
+ <target depends="init" name="createNativeDefinitions.java">
+ <exec dir="." executable="./getDefinitions" os="linux" output="src/java/net/java/games/input/NativeDefinitions.java">
+ <arg line="/usr/include/linux/input.h"/>
+ </exec>
+ </target>
+
+ <target depends="init" name="compileNativeJinputLib">
+ <ant dir="src/native" target="compileNativeJinputLib"/>
+ <copy file="src/native/libjinput.so" todir="../../coreAPI/src/tests/controller" />
+ </target>
+</project>
diff --git a/plugins/linux/src/native/build.xml b/plugins/linux/src/native/build.xml
new file mode 100644
index 0000000..d840646
--- /dev/null
+++ b/plugins/linux/src/native/build.xml
@@ -0,0 +1,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="all">
+
+ <!-- Don't worry if you don't know the Ant syntax completely or need help on some tasks! -->
+ <!-- The standard Ant documentation is bundled. See Help | Help Sets | Ant 1.4.1 Manual. -->
+
+ <target name="init">
+ <!-- You can set up any variables you want used throughout the script here. -->
+ <!-- property name="hello" value="world"/-->
+ <!-- To use e.g. Jikes, uncomment this line. -->
+ <!-- (Or make the same change in Tools | Options | Ant Settings | Properties.) -->
+ <!-- <property name="build.compiler" value="jikes"/> -->
+ <!-- You might like to set up some overridable paths, etc.: -->
+ <!-- <property name="mylib" value="../lib/mylib.jar"/> -->
+ <mkdir dir="build"/>
+ <mkdir dir="apidoc"/>
+ </target>
+
+ <target name="createNativeDefinitions.java" depends="init">
+ <exec dir="." executable="./getDefinitions" os="linux" output="../java/net/java/games/input/NativeDefinitions.java">
+ <arg line="/usr/include/linux/input.h"/>
+ </exec>
+ </target>
+
+ <target name="createJNIHeaders" depends="init">
+ <javah>
+ <classpath>
+ <pathelement path="."/>
+ <pathelement location="controller.jar"/>
+ </classpath>
+ <class name="net.java.games.input.LinuxDevice"/>
+ <class name="net.java.games.input.LinuxEnvironmentPlugin"/>
+ <class name="net.java.games.input.LinuxKeyboard"/>
+ </javah>
+ </target>
+
+ <target name="compileNativeEventLib" depends="init">
+ <exec dir="." executable="g++" os="linux">
+ <arg line="--shared -o libeventInterface.so eventInterface.cpp EventDevice.cpp"/>
+ </exec>
+ </target>
+
+ <target name="compileNativeJinputLib" depends="init">
+ <exec dir="." executable="g++">
+ <arg line="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux --shared -o libjinput.so jinput.cpp eventInterface.cpp EventDevice.cpp joystickInterface.cpp JoystickDevice.cpp MixedDevice.cpp"/>
+ </exec>
+ </target>
+</project>
+