398481c8 by Nathan Lighthart

Improve build script

- Make compilation of fortran files occur when ran (avoids clean and building each time)
- Add checks for gfortran before compiling
- Add flag to prevent fortran compilation
- Fix NAP on partial rebuilds
1 parent 18312dd9
......@@ -9,7 +9,7 @@
<!-- in the project's Project Properties dialog box.-->
<project name="AgES-W" default="default" basedir=".">
<description>Builds, tests, and runs the project AgES-W.</description>
<import file="nbproject/build-impl.xml"/>
<import file="nbproject/build-impl.xml" as="netbeans" />
There exist several targets which are by default empty and which can be
......@@ -71,6 +71,9 @@
<property file=".oms/project.properties"/>
<!-- Environment properties -->
<property environment="env" />
<!-- Directory properties -->
<property name="src.dir" value="src"/>
......@@ -87,10 +90,13 @@
<property name="cpp.files" value="**/*.cpp, **/*.cpp, **/*.c++, **/*.C"/>
<property name="nl.files" value="**/*.nlogo"/>
<!--<property name="nap.skip" value=""/>-->
<property name="nap.skip" value="false"/>
<property name="nap.gen.logging" value="false"/>
<property name="nap.gen.singleton" value="false"/>
<property name="nap.gen.protected" value="false"/>
<!-- Fortran compilation properties -->
<property name="fortran.compile.flag" value="true" />
<path id="oms-cp" >
<fileset dir="${lib.dir}" erroronmissingdir="false">
......@@ -101,7 +107,7 @@
<taskdef name="nap" classname="oms3.nap.JNAComponentTask" classpathref="oms-cp" />
<taskdef name="cc" classname="net.sf.antcontrib.cpptasks.CCTask" classpathref="oms-cp" />
<target name="nap" depends="init" unless="nap.skip" description="Perform native annotation processing (NAP)">
<target name="nap" depends="init" unless="${nap.skip}" description="Perform native annotation processing (NAP)">
<nap destdir="${gensrc.dir}" dllName="upgm"
......@@ -109,8 +115,29 @@
<fileset dir="${src.dir}" includes="${fortran.files}"/>
<target name="fortran-compiler-exists">
<condition property="fortran.compiler.exists">
<available file="gfortran.exe" filepath="${env.Path}" />
<available file="gfortran" filepath="${env.Path}" />
<available file="gfortran.exe" filepath="${env.PATH}" />
<available file="gfortran" filepath="${env.PATH}" />
<target name="should-compile-fortran" depends="fortran-compiler-exists">
<condition property="should.compile.fortran">
<istrue value="${fortran.compile.flag}" />
<istrue value="${fortran.compiler.exists}" />
<target name="compile-fortran" depends="init" description="Compile UPGM Fortran">
<target name="compile-fortran" depends="init, should-compile-fortran"
if="${should.compile.fortran}" description="Compile UPGM Fortran">
<cc name="gfortran" outtype="shared" subsystem="console" outfile="${dist.dir}/upgm" objdir="${obj.dir}">
<fileset dir="${src.dir}" includes="${fortran.files}"/>
<linker name="gfortran"/>
......@@ -127,6 +154,9 @@
<target name="-post-jar" depends="compile-fortran">
<target name="run" depends="jar, netbeans.run" description="Run hook to force jar creation when running">
<target name="zip-all-projects">
<delete file="${proj.dir}/projects.zip" quiet="true" />
No preview for this file type
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!