mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2026-04-04 14:07:53 +00:00
Linux building under maven
This commit is contained in:
parent
294629a312
commit
b2fd759065
78 changed files with 418 additions and 297 deletions
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project basedir="." default="all" name="Linux Plugin">
|
||||
<project basedir="." default="compileNativeJinputLib" name="Linux Plugin">
|
||||
<property name="libname64" value="libjinput-linux64.so"/>
|
||||
<property name="libname32" value="libjinput-linux.so"/>
|
||||
|
||||
<target name="init">
|
||||
<mkdir dir="classes"/>
|
||||
<mkdir dir="bin"/>
|
||||
<mkdir dir="target/natives"/>
|
||||
<mkdir dir="target/generated-sources/natives"/>
|
||||
<condition property="linux" >
|
||||
<!--<os family="unix" />-->
|
||||
<os name="Linux" />
|
||||
|
|
@ -10,63 +13,50 @@
|
|||
|
||||
</target>
|
||||
|
||||
<target depends="init" name="compile">
|
||||
<!-- <ant dir="src/native" target="createNativeDefinitions.java"/>-->
|
||||
<javac debug="true" deprecation="true" destdir="classes" source="1.4" target="1.4" srcdir="src/java">
|
||||
<target name="createNativeDefinitions.java">
|
||||
<exec dir="src/main/native" 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 depends="createJNIHeaders" 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="target/natives" executable="cc" os="Linux" dest="target/natives" 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"/>
|
||||
<arg value="-I../generated-sources/natives"/>
|
||||
<mapper type="glob" from="*.c" to="*.o"/>
|
||||
<fileset dir="src/main/native" includes="*.c"/>
|
||||
<fileset dir="../common/src/native" includes="*.c"/>
|
||||
</apply>
|
||||
<apply dir="target/natives" parallel="true" executable="cc" os="Linux" failonerror="true">
|
||||
<arg line="-shared -O2 -Wall -o ${libname}"/>
|
||||
<fileset dir="target/natives" includes="*.o"/>
|
||||
</apply>
|
||||
<apply dir="target/natives" parallel="true" executable="strip" os="Linux" failonerror="true">
|
||||
<fileset file="target/natives/${libname}"/>
|
||||
</apply>
|
||||
</target>
|
||||
|
||||
<target depends="init" name="createJNIHeaders">
|
||||
<javah destdir="target/generated-sources/natives">
|
||||
<classpath>
|
||||
<pathelement location="../../coreAPI/bin/jinput-core.jar"/>
|
||||
<pathelement location="../../lib/jutils.jar"/>
|
||||
</classpath>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target depends="init,compile" name="jar">
|
||||
<jar jarfile="bin/linux.jar" compress="true" basedir="classes">
|
||||
<include name="**/*.class"/>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target depends="jar,compileNativeJinputLib" description="Build everything." name="all">
|
||||
</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/jinput-core.jar"/>
|
||||
<pathelement location="../../coreAPI/lib/jutils.jar"/>
|
||||
</classpath>
|
||||
</javadoc>
|
||||
</target>
|
||||
|
||||
<target description="Clean all build products." name="clean">
|
||||
<delete dir="classes" failonerror="no"/>
|
||||
<delete dir="bin" failonerror="no"/>
|
||||
<delete dir="apidocs" failonerror="no"/>
|
||||
<ant inheritAll="false" antfile="src/native/build.xml" target="clean"/>
|
||||
</target>
|
||||
|
||||
<target depends="init,compile" name="createJNIHeaders">
|
||||
<javah destdir="src/native">
|
||||
<classpath>
|
||||
<pathelement location="classes"/>
|
||||
<pathelement location="../../coreAPI/bin/jinput-core.jar"/>
|
||||
<pathelement location="target/classes"/>
|
||||
<pathelement location="../../coreAPI/target/classes"/>
|
||||
</classpath>
|
||||
<class name="net.java.games.input.LinuxEventDevice"/>
|
||||
<class name="net.java.games.input.LinuxJoystickDevice"/>
|
||||
</javah>
|
||||
</target>
|
||||
|
||||
<target depends="init,createJNIHeaders" name="compileNativeJinputLib" if="linux">
|
||||
<ant dir="src/native" target="compileNativeJinputLib"/>
|
||||
<copy todir="bin">
|
||||
<fileset dir="src/native" includes="libjinput-linux*.so"/>
|
||||
</copy>
|
||||
</target>
|
||||
</project>
|
||||
|
|
|
|||
48
plugins/linux/pom.xml
Normal file
48
plugins/linux/pom.xml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>linux-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>JInput - Linux Plugin</name>
|
||||
|
||||
<parent>
|
||||
<groupId>net.java.jinput</groupId>
|
||||
<artifactId>plugins</artifactId>
|
||||
<version>2.0.8-SNAPSHOT</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.java.jinput</groupId>
|
||||
<artifactId>coreapi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<ant dir="." target="compileNativeJinputLib"/>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
6
plugins/linux/src/native/.gitignore
vendored
6
plugins/linux/src/native/.gitignore
vendored
|
|
@ -1,6 +0,0 @@
|
|||
/net_java_games_input_LinuxEventDevice.h
|
||||
/net_java_games_input_LinuxJoystickDevice.h
|
||||
/libjinput-linux64.so
|
||||
/net_java_games_input_LinuxEventDevice.o
|
||||
/net_java_games_input_LinuxJoystickDevice.o
|
||||
/util.o
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<?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"/>
|
||||
|
||||
<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>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue