<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
      <groupId>io.silverspoon</groupId>
      <artifactId>bulldog-linux-native</artifactId>
      <version>0.2.1</version>
      <relativePath>../pom.xml</relativePath>
   </parent>
   <artifactId>bulldog-linux-native-beagleboneblack</artifactId>
   <packaging>so</packaging>
   <name>${project.groupId}:${project.artifactId}</name>
   <build>
      <!-- Use shared *.c sources from parent project for sources generation -->
      <sourceDirectory>..</sourceDirectory>
      <plugins>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>native-maven-plugin</artifactId>
            <extensions>true</extensions>
            <executions>
               <!-- Disable parent execution -->
               <execution>
                  <id>javah-linux</id>
                  <phase/>
               </execution>
             <execution>
                 <id>javah-bbb</id>
                 <inherited>false</inherited>
                 <phase>generate-sources</phase>
                 <goals>
                     <goal>javah</goal>
                 </goals>
                 <configuration>
                     <javahClassNames>
                         <javahClassName>io.silverspoon.bulldog.beagleboneblack.jni.NativeAdc</javahClassName>
                         <javahClassName>io.silverspoon.bulldog.beagleboneblack.jni.NativeGpio</javahClassName>
                         <javahClassName>io.silverspoon.bulldog.beagleboneblack.jni.NativePwm</javahClassName>
                     </javahClassNames>
                     <javahVerbose>true</javahVerbose>
                     <javahOutputDirectory>src/main/c/beagleboneblack/jni</javahOutputDirectory>
                 </configuration>
             </execution>
             </executions>
            <!-- Default execution to compile native library -->
            <configuration>
               <sources>
                  <source>
                     <directory>../src/main/c</directory>
                     <includes>
                        <include>**/*.c</include>
                     </includes>
                  </source>
                  <source>
                     <directory>src/main/c</directory>
                     <includes>
                        <include>**/*.c</include>
                     </includes>
                  </source>
               </sources>
               <compilerExecutable>${compiler.exec}</compilerExecutable>
               <linkerExecutable>${linker.exec}</linkerExecutable>
               <compilerStartOptions>
                  <compilerStartOption>${compiler.includes}</compilerStartOption>
                  <compilerStartOption>-std=gnu11 -O3 -fPIC -fgnu89-inline -mfloat-abi=hard -mtune=cortex-a8</compilerStartOption>
               </compilerStartOptions>
               <linkerStartOptions>
                  <linkerStartOption>${linker.options}</linkerStartOption>
               </linkerStartOptions>
            </configuration>
         </plugin>

      </plugins>
   </build>
</project>
