AM_CPPFLAGS = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@

EXEEXT=$(ISSMEXT)

#Library declaration {{{
lib_LIBRARIES = libISSMCore.a libISSMOverload.a

if WRAPPERS
lib_LIBRARIES += libISSMModules.a 
endif
#}}}

#sources
#Core sources{{{
core_sources = ./main/issm.h\
			   ./main/globals.h\
			   ./datastructures/DataSet.h\
					./datastructures/DataSet.cpp\
					./datastructures/Object.h\
					./datastructures/datastructures.h\
					./classes/classes.h\
					./classes/gauss/GaussTria.h\
					./classes/gauss/GaussTria.cpp\
					./classes/Update.h\
					./classes/Element.h\
					./classes/FemModel.h\
					./classes/FemModel.cpp\
					./classes/Material.h\
					./classes/Load.h\
					./classes/Contour.h\
					./classes/Loads/Friction.h\
					./classes/Loads/Friction.cpp\
					./classes/Inputs/TransientInput.h\
					./classes/Inputs/TransientInput.cpp\
					./classes/Constraints/SpcTransient.cpp\
					./classes/Constraints/SpcTransient.h\
					./classes/IndependentObject.h\
					./classes/IndependentObject.cpp\
					./classes/DependentObject.h\
					./classes/DependentObject.cpp\
					./classes/DofIndexing.h\
					./classes/DofIndexing.cpp\
					./classes/IoModel.h\
					./classes/IoModel.cpp\
					./classes/Contours.h\
					./classes/Contours.cpp\
					./classes/Nodes.h\
					./classes/Nodes.cpp\
					./classes/Vertices.h\
					./classes/Vertices.cpp\
					./classes/Node.h\
					./classes/Node.cpp\
					./classes/Segment.h\
					./classes/Vertex.h\
					./classes/Vertex.cpp\
					./classes/Hook.h\
					./classes/Hook.cpp\
					./classes/Patch.h\
					./classes/Patch.cpp\
					./classes/ElementResults/ElementResultLocal.h\
					./classes/ElementResults/DoubleElementResult.h\
					./classes/ElementResults/DoubleElementResult.cpp\
					./classes/ElementResults/TriaP1ElementResult.h\
					./classes/ElementResults/TriaP1ElementResult.cpp\
					./classes/ElementResults/BoolElementResult.h\
					./classes/ElementResults/BoolElementResult.cpp\
					./classes/ExternalResults/Results.h\
					./classes/ExternalResults/Results.cpp\
					./classes/ExternalResults/ExternalResult.h\
					./classes/ExternalResults/GenericExternalResult.h\
					./classes/Elements/Elements.h\
					./classes/Elements/Elements.cpp\
					./classes/Elements/Tria.h\
					./classes/Elements/Tria.cpp\
					./classes/Elements/TriaHook.h\
					./classes/Elements/TriaHook.cpp\
					./classes/Elements/TriaRef.h\
					./classes/Elements/TriaRef.cpp\
					./classes/Inputs/Inputs.h\
					./classes/Inputs/Inputs.cpp\
					./classes/Inputs/Input.h\
					./classes/Inputs/InputLocal.h\
					./classes/Inputs/TriaP1Input.h\
					./classes/Inputs/TriaP1Input.cpp\
					./classes/Inputs/BoolInput.h\
					./classes/Inputs/BoolInput.cpp\
					./classes/Inputs/IntInput.h\
					./classes/Inputs/IntInput.cpp\
					./classes/Inputs/DoubleInput.h\
					./classes/Inputs/DoubleInput.cpp\
					./classes/Inputs/DatasetInput.h\
					./classes/Inputs/DatasetInput.cpp\
					./classes/Materials/Materials.h\
					./classes/Materials/Materials.cpp\
					./classes/Materials/Matice.h\
					./classes/Materials/Matice.cpp\
					./classes/Materials/Matdamageice.h\
					./classes/Materials/Matdamageice.cpp\
					./classes/Materials/Matpar.h\
					./classes/Materials/Matpar.cpp\
					./classes/Constraints/Constraints.h\
					./classes/Constraints/Constraints.cpp\
					./classes/Constraints/Constraint.h\
					./classes/Constraints/SpcStatic.cpp\
					./classes/Constraints/SpcStatic.h\
					./classes/Constraints/SpcDynamic.cpp\
					./classes/Constraints/SpcDynamic.h\
					./classes/Loads/Loads.h\
					./classes/Loads/Loads.cpp\
					./classes/Loads/Penpair.cpp\
					./classes/Loads/Penpair.h\
					./classes/Loads/Pengrid.cpp\
					./classes/Loads/Pengrid.h\
					./classes/Loads/Icefront.cpp\
					./classes/Loads/Icefront.h\
					./classes/Loads/Numericalflux.cpp\
					./classes/Loads/Numericalflux.h\
					./classes/matrix/matrixobjects.h\
					./classes/matrix/ElementMatrix.h\
					./classes/matrix/ElementMatrix.cpp\
					./classes/matrix/ElementVector.h\
					./classes/matrix/ElementVector.cpp\
					./classes/Params/Parameters.h\
					./classes/Params/Parameters.cpp\
					./classes/Params/Param.h\
					./classes/Params/GenericParam.h\
					./classes/Params/BoolParam.cpp\
					./classes/Params/BoolParam.h\
					./classes/Params/IntParam.cpp\
					./classes/Params/IntParam.h\
					./classes/Params/IntVecParam.cpp\
					./classes/Params/IntVecParam.h\
					./classes/Params/IntMatParam.cpp\
					./classes/Params/IntMatParam.h\
					./classes/Params/DoubleParam.cpp\
					./classes/Params/DoubleParam.h\
					./classes/Params/FileParam.cpp\
					./classes/Params/FileParam.h\
					./classes/Params/StringArrayParam.cpp\
					./classes/Params/StringArrayParam.h\
					./classes/Params/DoubleMatParam.cpp\
					./classes/Params/DoubleMatParam.h\
					./classes/Params/DoubleTransientMatParam.cpp\
					./classes/Params/DoubleTransientMatParam.h\
					./classes/Params/DoubleMatArrayParam.cpp\
					./classes/Params/DoubleMatArrayParam.h\
					./classes/Params/DoubleVecParam.cpp\
					./classes/Params/DoubleVecParam.h\
					./classes/Params/StringParam.cpp\
					./classes/Params/StringParam.h\
					./classes/Params/MatrixParam.h\
					./classes/Params/MatrixParam.cpp\
					./classes/Params/VectorParam.h\
					./classes/Params/VectorParam.cpp\
					./classes/Params/TransientParam.h\
					./classes/Params/TransientParam.cpp\
					./classes/Params/DataSetParam.h\
					./classes/Params/DataSetParam.cpp\
					./classes/Profiler.h\
					./classes/Profiler.cpp\
					./shared/shared.h\
					./shared/MemOps/MemOps.h\
					./shared/Matrix/matrix.h\
					./shared/Matrix/MatrixUtils.cpp\
					./shared/io/io.h\
					./shared/io/Disk/diskio.h\
					./shared/io/Disk/pfopen.cpp\
					./shared/io/Disk/pfclose.cpp\
					./shared/io/Disk/WriteLockFile.cpp\
					./shared/io/Print/PrintfFunction.cpp\
					./shared/io/Print/Print.h\
					./shared/io/Comm/Comm.h\
					./shared/io/Comm/CommDef.h\
					./shared/io/Comm/IssmComm.h\
					./shared/io/Comm/IssmComm.cpp\
					./shared/LatLong/Ll2xyx.cpp\
					./shared/LatLong/Xy2llx.cpp\
					./shared/Enum/Enum.h\
					./shared/Enum/EnumDefinitions.h\
					./shared/Enum/EnumToStringx.cpp\
					./shared/Enum/StringToEnumx.cpp\
					./shared/Numerics/numerics.h\
					./shared/Numerics/types.h\
					./shared/Numerics/constants.h\
					./shared/Numerics/Verbosity.h\
					./shared/Numerics/Verbosity.cpp\
					./shared/Numerics/GaussPoints.h\
					./shared/Numerics/GaussPoints.cpp\
					./shared/Numerics/cross.cpp\
					./shared/Numerics/isnan.h\
					./shared/Numerics/isnan.cpp\
					./shared/Numerics/cubic.cpp\
					./shared/Numerics/extrema.cpp\
					./shared/Numerics/XZvectorsToCoordinateSystem.cpp\
					./shared/Numerics/UnitConversion.cpp\
					./shared/Numerics/OptArgs.h\
					./shared/Numerics/OptPars.h\
					./shared/Exceptions/exceptions.h\
					./shared/Exceptions/Exceptions.cpp\
					./shared/Exceptions/exprintf.cpp\
					./shared/Sorting/binary_search.cpp\
					./shared/Sorting/sorting.h\
					./shared/Elements/elements.h\
					./shared/Elements/Paterson.cpp\
					./shared/Elements/Arrhenius.cpp\
					./shared/Elements/PrintArrays.cpp\
					./shared/Elements/PddSurfaceMassBalance.cpp\
					./shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp\
					./shared/String/sharedstring.h\
					./shared/String/DescriptorIndex.cpp\
					./toolkits/metis/metisincludes.h\
					./toolkits/issm/issmtoolkit.h\
					./toolkits/issm/IssmToolkitUtils.h\
					./toolkits/issm/IssmToolkitUtils.cpp\
					./toolkits/issm/IssmAbsMat.h\
					./toolkits/issm/IssmAbsVec.h\
					./toolkits/issm/IssmDenseMat.h\
					./toolkits/issm/IssmMat.h\
					./toolkits/issm/IssmSeqVec.h\
					./toolkits/issm/IssmVec.h\
					./toolkits/issm/IssmSolver.h\
					./toolkits/issm/IssmSolver.cpp\
					./toolkits/issm/Bucket.h\
					./toolkits/adolc/adolcincludes.h\
					./toolkits/adolc/AdolcEdf.h\
					./toolkits/ToolkitOptions.h\
					./toolkits/ToolkitOptions.cpp\
					./toolkits/triangle/triangleincludes.h\
					./toolkits/objects/toolkitobjects.h\
					./toolkits/objects/Matrix.h\
					./toolkits/objects/Vector.h\
					./toolkits/objects/Solver.h\
					./toolkitsenums.h\
					./toolkits.h\
					./modules/ModelProcessorx/ModelProcessorx.h\
					./modules/ModelProcessorx/ModelProcessorx.cpp\
					./modules/ModelProcessorx/DistributeNumDofs.cpp\
					./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\
					./modules/ModelProcessorx/NodesPartitioning.cpp\
					./modules/ModelProcessorx/SortDataSets.cpp\
					./modules/ModelProcessorx/UpdateCounters.cpp\
					./modules/ModelProcessorx/CreateDataSets.cpp\
					./modules/ModelProcessorx/CreateParameters.cpp\
					./modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp\
					./modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp\
					./modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp\
					./modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\
					./modules/ParseToolkitsOptionsx/ParseToolkitsOptionsx.h\
					./modules/ParseToolkitsOptionsx/ParseToolkitsOptionsx.cpp\
					./modules/NodesDofx/NodesDofx.h\
					./modules/NodesDofx/NodesDofx.cpp\
					./modules/NodalValuex/NodalValuex.h\
					./modules/NodalValuex/NodalValuex.cpp\
					./modules/VerticesDofx/VerticesDofx.h\
					./modules/VerticesDofx/VerticesDofx.cpp\
					./modules/VertexCoordinatesx/VertexCoordinatesx.h\
					./modules/VertexCoordinatesx/VertexCoordinatesx.cpp\
					./modules/OutputResultsx/OutputResultsx.h\
					./modules/OutputResultsx/OutputResultsx.cpp\
					./modules/InputDuplicatex/InputDuplicatex.h\
					./modules/InputDuplicatex/InputDuplicatex.cpp\
					./modules/InputScalex/InputScalex.h\
					./modules/InputScalex/InputScalex.cpp\
					./modules/SurfaceAreax/SurfaceAreax.h\
					./modules/SurfaceAreax/SurfaceAreax.cpp\
					./modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h\
					./modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp\
					./modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h\
					./modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp\
					./modules/IoModelToConstraintsx/IoModelToConstraintsx.h\
					./modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp\
					./modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h\
					./modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp\
					./modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h\
					./modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp\
					./modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h\
					./modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp\
					./modules/GetVectorFromInputsx/GetVectorFromInputsx.h\
					./modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp\
					./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h\
					./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp\
					./modules/InputArtificialNoisex/InputArtificialNoisex.h\
					./modules/InputArtificialNoisex/InputArtificialNoisex.cpp\
					./modules/ConfigureObjectsx/ConfigureObjectsx.h\
					./modules/ConfigureObjectsx/ConfigureObjectsx.cpp\
					./modules/ComputeBasalStressx/ComputeBasalStressx.h\
					./modules/ComputeBasalStressx/ComputeBasalStressx.cpp\
					./modules/ComputeStrainRatex/ComputeStrainRatex.h\
					./modules/ComputeStrainRatex/ComputeStrainRatex.cpp\
					./modules/SpcNodesx/SpcNodesx.h\
					./modules/SpcNodesx/SpcNodesx.cpp\
					./modules/PositiveDegreeDayx/PositiveDegreeDayx.h\
					./modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp\
					./modules/Delta18oParameterizationx/Delta18oParameterizationx.h\
					./modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp\
					./modules/SmbGradientsx/SmbGradientsx.h\
					./modules/SmbGradientsx/SmbGradientsx.cpp\
					./modules/MeshPartitionx/MeshPartitionx.h\
					./modules/Reducevectorgtofx/Reducevectorgtofx.cpp\
					./modules/Reducevectorgtofx/Reducevectorgtofx.h\
					./modules/Reduceloadx/Reduceloadx.h\
					./modules/Reduceloadx/Reduceloadx.cpp\
					./modules/ConstraintsStatex/ConstraintsStatex.cpp\
					./modules/ConstraintsStatex/ConstraintsStatex.h\
					./modules/ConstraintsStatex/ConstraintsStateLocal.h\
					./modules/ResetConstraintsx/ResetConstraintsx.h\
					./modules/ResetConstraintsx/ResetConstraintsx.cpp\
					./modules/ResetCoordinateSystemx/ResetCoordinateSystemx.h\
					./modules/ResetCoordinateSystemx/ResetCoordinateSystemx.cpp\
					./modules/Solverx/Solverx.cpp\
					./modules/Solverx/Solverx.h\
					./modules/VecMergex/VecMergex.cpp\
					./modules/VecMergex/VecMergex.h\
					./modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp\
					./modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h\
					./modules/InputToResultx/InputToResultx.cpp\
					./modules/InputToResultx/InputToResultx.h\
					./analyses/ProcessArguments.cpp\
					./analyses/ResetBoundaryConditions.cpp\
					./analyses/AnalysisConfiguration.cpp\
					./analyses/WrapperCorePointerFromSolutionEnum.cpp\
					./analyses/CorePointerFromSolutionEnum.cpp\
					./analyses/EnvironmentInit.cpp\
					./analyses/EnvironmentFinalize.cpp\
					./analyses/ad_core.cpp\
					./solutionsequences/solutionsequence_linear.cpp\
					./solutionsequences/solutionsequence_nonlinear.cpp\
					./solutionsequences/solutionsequence_newton.cpp\
					./solutionsequences/convergence.cpp\
					./classes/Options/Options.h\
					./classes/Options/Options.cpp\
					./classes/Options/Option.h\
					./classes/Options/GenericOption.h\
					./classes/Options/OptionUtilities.cpp\
					./classes/Options/OptionUtilities.h\
					./classes/RiftStruct.cpp\
					./classes/RiftStruct.h
#}}}
#DAKOTA sources  {{{
dakota_sources = ./modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h\
					  ./modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp\
					  ./modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h\
					  ./modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp\
					  ./modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.h\
					  ./modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.cpp\
					  ./modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp\
					  ./modules/AverageOntoPartitionx/AverageOntoPartitionx.h\
					  ./modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp\
					  ./analyses/dakota_core.cpp\
					  ./analyses/DakotaSpawnCore.h\
					  ./analyses/DakotaSpawnCore.cpp
#}}}
#Transient sources  {{{
transient_sources  = ./modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp \
							./analyses/transient_core.cpp
#}}}
#Steadystate sources  {{{
steadystate_sources = ./analyses/steadystate_core.cpp
#}}}
#Prognostic sources  {{{
prognostic_sources = ./modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp\
					      ./modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp\
					      ./modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp\
					      ./modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp\
							./analyses/prognostic_core.cpp
#}}}
#Thermal sources  {{{
thermal_sources = ./modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp\
					   ./modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp\
					   ./modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp\
					   ./modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp\
					   ./modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp\
					   ./modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp\
					   ./modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp\
					   ./modules/ModelProcessorx/Enthalpy/CreateLoadsEnthalpy.cpp\
					   ./modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp\
					   ./modules/ModelProcessorx/Melting/CreateNodesMelting.cpp\
					   ./modules/ModelProcessorx/Melting/CreateConstraintsMelting.cpp\
					   ./modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp\
					   ./modules/ConstraintsStatex/ThermalConstraintsState.cpp\
					   ./modules/ConstraintsStatex/ThermalIsPresent.cpp\
					   ./modules/ResetConstraintsx/ThermalConstraintsReset.cpp \
					   ./analyses/thermal_core.cpp\
					   ./analyses/enthalpy_core.cpp\
					   ./solutionsequences/solutionsequence_thermal_nonlinear.cpp
#}}}
#Control sources  {{{
control_sources= ./modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp\
					  ./modules/ControlInputGetGradientx/ControlInputGetGradientx.h\
					  ./modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp\
					  ./modules/ControlInputSetGradientx/ControlInputSetGradientx.h\
					  ./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp\
					  ./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h\
					  ./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp\
					  ./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h\
					  ./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp\
					  ./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h\
					  ./modules/ModelProcessorx/Control/CreateParametersControl.cpp\
					  ./modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp\
					  ./modules/InputControlUpdatex/InputControlUpdatex.h\
					  ./modules/InputControlUpdatex/InputControlUpdatex.cpp\
					  ./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h\
					  ./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp\
					  ./modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h\
					  ./modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp\
					  ./modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h\
					  ./modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp\
					  ./modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h\
					  ./modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp\
					  ./modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h\
					  ./modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp\
					  ./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h\
					  ./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp\
					  ./modules/Orthx/Orthx.h\
					  ./modules/Orthx/Orthx.cpp\
					  ./modules/Gradjx/Gradjx.h\
					  ./modules/Gradjx/Gradjx.cpp\
					  ./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp\
					  ./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h\
					  ./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp\
					  ./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h\
					  ./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp\
					  ./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h\
					  ./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp\
					  ./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h\
					  ./classes/Inputs/ControlInput.h\
					  ./classes/Inputs/ControlInput.cpp\
					  ./shared/Numerics/BrentSearch.cpp\
					  ./shared/Numerics/OptimalSearch.cpp \
					  ./analyses/control_core.cpp\
					  ./analyses/controltao_core.cpp\
					  ./analyses/objectivefunction.cpp\
					  ./analyses/gradient_core.cpp\
					  ./analyses/adjointdiagnostic_core.cpp\
					  ./analyses/adjointbalancethickness_core.cpp\
					  ./analyses/AdjointCorePointerFromSolutionEnum.cpp\
					  ./solutionsequences/solutionsequence_adjoint_linear.cpp

#}}}
#Hydrology sources  {{{
hydrology_sources  = ./modules/ModelProcessorx/HydrologyShreve/UpdateElementsHydrologyShreve.cpp\
					      ./modules/ModelProcessorx/HydrologyShreve/CreateNodesHydrologyShreve.cpp\
					      ./modules/ModelProcessorx/HydrologyShreve/CreateConstraintsHydrologyShreve.cpp\
					      ./modules/ModelProcessorx/HydrologyShreve/CreateLoadsHydrologyShreve.cpp \
							./modules/ModelProcessorx/HydrologyShreve/CreateParametersHydrologyShreve.cpp \
							./modules/ModelProcessorx/HydrologyDCInefficient/UpdateElementsHydrologyDCInefficient.cpp\
							./modules/ModelProcessorx/HydrologyDCInefficient/CreateNodesHydrologyDCInefficient.cpp\
							./modules/ModelProcessorx/HydrologyDCInefficient/CreateConstraintsHydrologyDCInefficient.cpp\
							./modules/ModelProcessorx/HydrologyDCInefficient/CreateLoadsHydrologyDCInefficient.cpp \
							./modules/ModelProcessorx/HydrologyDCInefficient/CreateParametersHydrologyDCInefficient.cpp \
							./modules/ModelProcessorx/HydrologyDCEfficient/UpdateElementsHydrologyDCEfficient.cpp\
							./modules/ModelProcessorx/HydrologyDCEfficient/CreateNodesHydrologyDCEfficient.cpp\
							./modules/ModelProcessorx/HydrologyDCEfficient/CreateConstraintsHydrologyDCEfficient.cpp\
							./modules/ModelProcessorx/HydrologyDCEfficient/CreateLoadsHydrologyDCEfficient.cpp \
							./modules/ModelProcessorx/HydrologyDCEfficient/CreateParametersHydrologyDCEfficient.cpp \
							./analyses/hydrology_core.cpp\
							./solutionsequences/solutionsequence_hydro_nonlinear.cpp
#}}}
#Diagnostic sources  {{{
diagnostic_sources = ./modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp\
					      ./modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp \
					      ./modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp \
					      ./modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp\
					      ./modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp\
					      ./modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp \
					      ./modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp \
					      ./modules/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp\
					      ./modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp\
					      ./modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp \
					      ./modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp \
							./modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp \
							./analyses/diagnostic_core.cpp\
							./solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp
#}}}
#Balanced sources  {{{
balanced_sources = ./modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp\
					    ./modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp\
					    ./modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp\
						 ./modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp\
						 ./analyses/balancethickness_core.cpp \
						 ./analyses/dummy_core.cpp
#}}}
#Slope sources  {{{
slope_sources =  ./modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp\
					  ./modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp \
					  ./modules/ModelProcessorx/BedSlope/CreateConstraintsBedSlope.cpp\
					  ./modules/ModelProcessorx/BedSlope/CreateLoadsBedSlope.cpp\
					  ./modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp\
					  ./modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp \
					  ./modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp\
					  ./modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp\
					  ./analyses/surfaceslope_core.cpp\
					  ./analyses/bedslope_core.cpp
#}}}
#Gia sources  {{{
gia_sources =  ./analyses/gia_core.cpp\
					./modules/ModelProcessorx/Gia/UpdateElementsGia.cpp\
					./modules/ModelProcessorx/Gia/CreateNodesGia.cpp \
					./modules/ModelProcessorx/Gia/CreateConstraintsGia.cpp\
					./modules/ModelProcessorx/Gia/CreateLoadsGia.cpp\
					./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp\
					./modules/GiaDeflectionCorex/GiaDeflectionCorex.h\
					./modules/GiaDeflectionCorex/distme.f\
					./modules/GiaDeflectionCorex/freed.f\
					./modules/GiaDeflectionCorex/ojrule.f\
					./modules/GiaDeflectionCorex/pwise.f\
					./modules/GiaDeflectionCorex/qwise.f\
					./modules/GiaDeflectionCorex/stot.f\
					./modules/GiaDeflectionCorex/what0.f\
					./classes/GiaDeflectionCoreArgs.h

#}}}
#Groundingline sources  {{{
groundingline_sources= ./modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp\
					        ./modules/GroundinglineMigrationx/GroundinglineMigrationx.h
#}}}
#Rifts sources  {{{
rifts_sources = ./classes/Loads/Riftfront.cpp\
				    ./classes/Loads/Riftfront.h\
				    ./modules/ConstraintsStatex/RiftConstraintsState.cpp
#}}}
#Android sources  {{{
android_sources = 
#}}}
#3D sources  {{{
threed_sources = ./classes/gauss/GaussPenta.h\
				     ./classes/gauss/GaussPenta.cpp\
				     ./classes/ElementResults/PentaP1ElementResult.h\
				     ./classes/ElementResults/PentaP1ElementResult.cpp\
				     ./classes/Inputs/PentaP1Input.h\
				     ./classes/Inputs/PentaP1Input.cpp\
				     ./classes/Elements/Penta.h\
				     ./classes/Elements/Penta.cpp\
				     ./classes/Elements/PentaHook.h\
				     ./classes/Elements/PentaHook.cpp\
				     ./classes/Elements/PentaRef.h\
				     ./classes/Elements/PentaRef.cpp
#}}}
#Bamg sources  {{{
bamg_sources =  ./bamg/bamgobjects.h\
				./bamg/BamgGeom.h\
				./bamg/BamgGeom.cpp\
				./bamg/BamgMesh.h\
				./bamg/BamgMesh.cpp\
				./bamg/BamgOpts.h\
				./bamg/BamgOpts.cpp\
				./bamg/CrackedEdge.h\
				./bamg/CrackedEdge.cpp\
				./bamg/Curve.h\
				./bamg/Curve.cpp\
				./bamg/Direction.h\
				./bamg/Direction.cpp\
				./bamg/DoubleAndInt.h\
				./bamg/Edge.h\
				./bamg/Edge.cpp\
				./bamg/GeomEdge.h\
				./bamg/GeomEdge.cpp\
				./bamg/GeomSubDomain.h\
				./bamg/GeomSubDomain.cpp\
				./bamg/GeomVertex.h\
				./bamg/GeomVertex.cpp\
				./bamg/Geometry.cpp\
				./bamg/Geometry.h\
				./bamg/ListofIntersectionTriangles.cpp\
				./bamg/ListofIntersectionTriangles.h\
				./bamg/EigenMetric.cpp\
				./bamg/Metric.cpp\
				./bamg/Metric.h\
				./bamg/BamgQuadtree.cpp\
				./bamg/BamgQuadtree.h\
				./bamg/R2.h\
				./bamg/SetOfE4.cpp\
				./bamg/SetOfE4.h\
				./bamg/SubDomain.h\
				./bamg/SubDomain.cpp\
				./bamg/AdjacentTriangle.h\
				./bamg/AdjacentTriangle.cpp\
				./bamg/Triangle.cpp\
				./bamg/det.h \
				./bamg/Triangle.h\
				./bamg/BamgVertex.cpp\
				./bamg/BamgVertex.h\
				./bamg/VertexOnEdge.h\
				./bamg/VertexOnEdge.cpp\
				./bamg/VertexOnGeom.h\
				./bamg/VertexOnGeom.cpp\
				./bamg/VertexOnVertex.h\
				./bamg/VertexOnVertex.cpp\
				./bamg/Mesh.cpp\
				./bamg/Mesh.h\
				./shared/Bamg/Abs.h \
				./shared/Bamg/BigPrimeNumber.h\
				./shared/Bamg/BigPrimeNumber.cpp\
				./shared/Bamg/BinaryRand.h \
				./shared/Bamg/Exchange.h \
				./shared/Bamg/extrema.h \
				./shared/Bamg/HeapSort.h \
				./shared/Bamg/OppositeAngle.h \
				./modules/Bamgx/Bamgx.cpp\
				./modules/Bamgx/Bamgx.h\
				./modules/BamgConvertMeshx/BamgConvertMeshx.cpp\
				./modules/BamgConvertMeshx/BamgConvertMeshx.h\
				./modules/BamgTriangulatex/BamgTriangulatex.cpp\
				./modules/BamgTriangulatex/BamgTriangulatex.h
#}}}
#Kriging sources  {{{
kriging_sources = ./classes/kriging/Observations.h\
						./classes/kriging/Observations.cpp\
						./classes/kriging/Variogram.h \
						./classes/kriging/GaussianVariogram.h\
						./classes/kriging/GaussianVariogram.cpp\
						./classes/kriging/ExponentialVariogram.h\
						./classes/kriging/ExponentialVariogram.cpp\
						./classes/kriging/SphericalVariogram.h\
						./classes/kriging/SphericalVariogram.cpp\
						./classes/kriging/PowerVariogram.h\
						./classes/kriging/PowerVariogram.cpp\
						./classes/kriging/Quadtree.h\
						./classes/kriging/Quadtree.cpp\
						./classes/kriging/Observation.h\
						./classes/kriging/Observation.cpp\
						./modules/Krigingx/Krigingx.cpp\
						./modules/Krigingx/Krigingx.h

#For parallel kriging, only difference is ./modules/Krigingx/pKrigingx.cpp with no multithreading
pkriging_sources = ./classes/kriging/Observations.h\
						./classes/kriging/Observations.cpp\
						./classes/kriging/Variogram.h \
						./classes/kriging/GaussianVariogram.h\
						./classes/kriging/GaussianVariogram.cpp\
						./classes/kriging/ExponentialVariogram.h\
						./classes/kriging/ExponentialVariogram.cpp\
						./classes/kriging/SphericalVariogram.h\
						./classes/kriging/SphericalVariogram.cpp\
						./classes/kriging/PowerVariogram.h\
						./classes/kriging/PowerVariogram.cpp\
						./classes/kriging/Quadtree.h\
						./classes/kriging/Quadtree.cpp\
						./classes/kriging/Observation.h\
						./classes/kriging/Observation.cpp\
						./modules/Krigingx/pKrigingx.cpp\
						./modules/Krigingx/Krigingx.h

#}}}
#Kml sources  {{{
kml_sources = ./modules/Exp2Kmlx/Exp2Kmlx.h\
			     ./modules/Exp2Kmlx/Exp2Kmlx.cpp\
			     ./modules/Kml2Expx/Kml2Expx.h\
			     ./modules/Kml2Expx/Kml2Expx.cpp\
			     ./modules/Shp2Expx/Shp2Expx.h\
			     ./modules/Shp2Expx/Shp2Expx.cpp\
			     ./modules/Shp2Kmlx/Shp2Kmlx.h\
			     ./modules/Shp2Kmlx/Shp2Kmlx.cpp\
			     ./modules/KMLFileReadx/KMLFileReadx.h\
			     ./modules/KMLFileReadx/KMLFileReadx.cpp\
			     ./modules/KMLMeshWritex/KMLMeshWritex.h\
			     ./modules/KMLMeshWritex/KMLMeshWritex.cpp\
			     ./modules/KMLOverlayx/KMLOverlayx.h\
			     ./modules/KMLOverlayx/KMLOverlayx.cpp\
			     ./kml/kmlobjects.h\
			     ./kml/KML_Attribute.cpp\
			     ./kml/KML_Attribute.h\
			     ./kml/KML_Comment.cpp\
			     ./kml/KML_Comment.h\
			     ./kml/KML_ColorStyle.cpp\
			     ./kml/KML_ColorStyle.h\
			     ./kml/KML_Container.cpp\
			     ./kml/KML_Container.h\
			     ./kml/KML_Document.cpp\
			     ./kml/KML_Document.h\
			     ./kml/KML_Feature.cpp\
			     ./kml/KML_Feature.h\
			     ./kml/KML_File.cpp\
			     ./kml/KML_File.h\
			     ./kml/KML_Folder.cpp\
			     ./kml/KML_Folder.h\
			     ./kml/KML_Geometry.cpp\
			     ./kml/KML_Geometry.h\
			     ./kml/KML_GroundOverlay.cpp\
			     ./kml/KML_GroundOverlay.h\
			     ./kml/KML_Icon.cpp\
			     ./kml/KML_Icon.h\
			     ./kml/KML_LatLonBox.cpp\
		  	     ./kml/KML_LatLonBox.h\
			     ./kml/KML_LinearRing.cpp\
			     ./kml/KML_LinearRing.h\
			     ./kml/KML_LineString.cpp\
			     ./kml/KML_LineString.h\
			     ./kml/KML_LineStyle.cpp\
			     ./kml/KML_LineStyle.h\
			     ./kml/KML_MultiGeometry.cpp\
			     ./kml/KML_MultiGeometry.h\
			     ./kml/KML_Object.cpp\
			     ./kml/KML_Object.h\
			     ./kml/KML_Overlay.cpp\
			     ./kml/KML_Overlay.h\
			     ./kml/KML_Point.cpp\
			     ./kml/KML_Point.h\
			     ./kml/KML_Placemark.cpp\
			     ./kml/KML_Placemark.h\
			     ./kml/KML_Polygon.cpp\
			     ./kml/KML_Polygon.h\
			     ./kml/KML_PolyStyle.cpp\
			     ./kml/KML_PolyStyle.h\
			     ./kml/KML_Style.cpp\
			     ./kml/KML_Style.h\
			     ./kml/KML_StyleSelector.cpp\
			     ./kml/KML_StyleSelector.h\
			     ./kml/KML_SubStyle.cpp\
			     ./kml/KML_SubStyle.h\
			     ./kml/KML_Unknown.cpp\
			     ./kml/KML_Unknown.h\
			     ./kml/KMLFileReadUtils.cpp\
			     ./kml/KMLFileReadUtils.h
#}}}
#Petsc sources  {{{
petsc_sources= ./toolkits/petsc\
					./toolkits/petsc/patches\
					./toolkits/petsc/patches/SolverEnum.h\
					./toolkits/petsc/patches/petscpatches.h\
					./toolkits/petsc/patches/VecToMPISerial.cpp\
					./toolkits/petsc/patches/MatToSerial.cpp\
					./toolkits/petsc/patches/VecMerge.cpp\
					./toolkits/petsc/patches/NewVec.cpp\
					./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
					./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\
					./toolkits/petsc/patches/NewMat.cpp\
					./toolkits/petsc/patches/VecFree.cpp\
					./toolkits/petsc/patches/PetscMatrixToDoubleMatrix.cpp\
					./toolkits/petsc/patches/PetscVectorToDoubleVector.cpp\
					./toolkits/petsc/patches/VecDuplicatePatch.cpp\
					./toolkits/petsc/patches/KSPFree.cpp\
					./toolkits/petsc/patches/MatFree.cpp\
					./toolkits/petsc/patches/MatMultPatch.cpp\
					./toolkits/petsc/patches/ISSMToPetscMatrixType.cpp\
					./toolkits/petsc/patches/ISSMToPetscInsertMode.cpp\
					./toolkits/petsc/patches/ISSMToPetscNormMode.cpp\
					./toolkits/petsc/objects/petscobjects.h\
					./toolkits/petsc/objects/PetscMat.h\
					./toolkits/petsc/objects/PetscMat.cpp\
					./toolkits/petsc/objects/PetscVec.h\
					./toolkits/petsc/objects/PetscVec.cpp\
					./toolkits/petsc/objects/PetscSolver.cpp\
					./toolkits/petsc/objects/PetscSolver.h\
					./toolkits/petsc/petscincludes.h

#}}}
#Mumps sources  {{{
mumps_sources=      ./toolkits/mumps\
					./toolkits/mumps/mumpsincludes.h\
					./toolkits/mumps/MpiDenseMumpsSolve.cpp
#}}}
#Gsl sources  {{{
gsl_sources=      ./toolkits/gsl\
					./toolkits/gsl/gslincludes.h\
					./toolkits/gsl/DenseGslSolve.cpp
#}}}
#Mpi sources  {{{
mpi_sources= ./toolkits/mpi/mpiincludes.h\
				./toolkits/mpi/patches/mpipatches.h\
				./toolkits/mpi/patches/DetermineLocalSize.cpp\
				./toolkits/mpi/patches/DetermineGlobalSize.cpp\
				./toolkits/mpi/patches/DetermineRowRankFromLocalSize.cpp\
				./toolkits/mpi/patches/GetOwnershipBoundariesFromRange.cpp\
				./toolkits/issm/IssmMpiDenseMat.h\
				./toolkits/issm/IssmMpiVec.h
#}}}
#Metis sources  {{{
metis_sources= ./toolkits/metis/patches/metispatches.h\
					./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
#}}}
#Modules sources{{{
modules_sources= ./shared/Threads/issm_threads.h\
			./shared/Threads/LaunchThread.cpp\
			./shared/Threads/PartitionRange.cpp\
			./shared/Exp/exp.h\
			./shared/Exp/exp.cpp\
			./shared/TriMesh/trimesh.h\
			./shared/TriMesh/AssociateSegmentToElement.cpp\
			./shared/TriMesh/GridInsideHole.cpp\
			./shared/TriMesh/OrderSegments.cpp\
			./shared/TriMesh/SplitMeshForRifts.cpp\
			./shared/TriMesh/TriMeshUtils.cpp\
			./modules/Chacox/Chacox.h\
			./modules/Chacox/Chacox.cpp\
			./modules/Chacox/input_parse.cpp\
			./modules/Chacox/chaco_seconds.cpp\
			./modules/Chacox/user_params.cpp\
			./modules/TriaSearchx/TriaSearchx.h\
			./modules/TriaSearchx/TriaSearchx.cpp\
			./modules/TriMeshx/TriMeshx.h\
			./modules/TriMeshx/TriMeshx.cpp\
			./modules/TriMeshProcessRiftsx/TriMeshProcessRiftsx.h\
			./modules/TriMeshProcessRiftsx/TriMeshProcessRiftsx.cpp\
			./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h\
			./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp\
			./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp\
			./modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp\
			./modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h\
			./modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp\
			./modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp\
			./modules/InterpFromMesh2dx/InterpFromMesh2dx.h\
			./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp\
			./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h\
			./modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp\
			./modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h\
			./modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp\
			./modules/InterpFromMeshToGridx/InterpFromMeshToGridx.h\
			./modules/HoleFillerx/HoleFillerx.cpp\
			./modules/HoleFillerx/HoleFillerx.h\
			./modules/EdgeDetectionx/EdgeDetectionx.cpp\
			./modules/EdgeDetectionx/EdgeDetectionx.h\
			./modules/AverageFilterx/AverageFilterx.cpp\
			./modules/AverageFilterx/AverageFilterx.h\
			./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp\
			./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h\
			./modules/ContourToMeshx/ContourToMeshx.cpp\
			./modules/ContourToMeshx/ContourToMeshxt.cpp\
			./modules/ContourToMeshx/ContourToMeshx.h\
			./modules/ContourToNodesx/ContourToNodesx.cpp\
			./modules/ContourToNodesx/ContourToNodesx.h\
			./modules/Reducevectorgtosx/Reducevectorgtosx.cpp\
			./modules/Reducevectorgtosx/Reducevectorgtosx.h\
			./modules/NodeConnectivityx/NodeConnectivityx.cpp\
			./modules/NodeConnectivityx/NodeConnectivityx.h\
			./modules/ElementConnectivityx/ElementConnectivityx.cpp\
			./modules/ElementConnectivityx/ElementConnectivityx.h\
			./modules/Scotchx/Scotchx.cpp\
			./modules/Scotchx/Scotchx.h\
			./modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.cpp\
			./modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.h
#}}}

#{{{ Conditional build-up of sources
#ISSM sources are a combination of core sources and sources related to specific capabilities (which can 
#be activated by autotools conditionals 

#First the core
issm_sources  =  $(core_sources)

#Now the optional source
if DAKOTA
issm_sources  +=  $(dakota_sources)
endif

if PETSC
issm_sources  +=  $(petsc_sources)
endif

if MUMPS
issm_sources  +=  $(mumps_sources)
endif

if GSL
issm_sources  +=  $(gsl_sources)
endif

if TRANSIENT
issm_sources  +=  $(transient_sources)
endif

if STEADYSTATE
issm_sources  +=  $(steadystate_sources)
endif

if PROGNOSTIC
issm_sources  +=  $(prognostic_sources)
endif

if THERMAL
issm_sources  +=  $(thermal_sources)
endif

if GIA
issm_sources  +=  $(gia_sources)
endif

if CONTROL
issm_sources  +=  $(control_sources)
endif

if HYDROLOGY
issm_sources  +=  $(hydrology_sources)
endif

if DIAGNOSTIC
issm_sources  +=  $(diagnostic_sources)
endif

if BALANCED
issm_sources  +=  $(balanced_sources)
endif

if SLOPE
issm_sources  +=  $(slope_sources)
endif

if GROUNDINGLINE
issm_sources +=  $(groundingline_sources)
endif

if RIFTS
issm_sources +=  $(rifts_sources)
endif

if ANDROID
issm_sources +=  $(android_sources)
endif

if THREED
issm_sources +=  $(threed_sources)
endif

if MPI
issm_sources +=  $(mpi_sources)
endif

if METIS
issm_sources +=  $(metis_sources)
endif

if KRIGING
issm_sources +=  $(pkriging_sources)
endif
#}}}
#Library flags and sources {{{
ALLCXXFLAGS= -fPIC -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_  $(CXXFLAGS) $(CXXOPTFLAGS) 

libISSMCore_a_SOURCES  = $(issm_sources)
libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
libISSMCore_a_FFLAGS = $(AM_FFLAGS)

if WRAPPERS
libISSMModules_a_SOURCES = $(modules_sources)
libISSMModules_a_SOURCES += $(bamg_sources)
if KRIGING
libISSMModules_a_SOURCES += $(kriging_sources)
endif
if KML
libISSMModules_a_SOURCES += $(kml_sources)
endif
libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS)
libISSMModules_a_LIBADD = ./libISSMCore.a
endif

if VERSION
AM_LDFLAGS =
else
AM_LDFLAGS = -avoid-version
endif
#}}}
#Overload library, to overload any non-standard symbols. {{{
libISSMOverload_a_SOURCES = ./shared/String/stricmp.c
libISSMOverload_a_CFLAGS  = -fPIC -D_C_ $(COPTFLAGS) $(CFLAGS)
#}}}

#Executable {{{
if ANDROID
if ANDROIDEXE
bin_PROGRAMS = issm 
else
bin_PROGRAMS = 
endif
else
bin_PROGRAMS = issm 
endif

#Standard libraries
LDADD = ./libISSMCore.a ./libISSMOverload.a

#External packages
LDADD += $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB)

if FORTRAN
LDADD += $(FLIBS)
endif

issm_SOURCES = main/issm.cpp
issm_CXXFLAGS= -fPIC $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) 

if KRIGING
bin_PROGRAMS += kriging
kriging_SOURCES = main/kriging.cpp
kriging_CXXFLAGS= -fPIC $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) 
endif
#}}}
#Automatic differentiation: append this fold to the end of the src/c/Makefile.am to get this Makefile.am {{{
if ADIC2 
lib_LIBRARIES += libAD.a libISSMRose.a

#ADIC2 library, for automatic differentiation 
#libAD_a_SOURCES = ./mini1.ad.c
libAD_a_SOURCES = 
libAD_a_CFLAGS = -fPIC -D_C_ $(COPTFLAGS)


#test rose preprocessing 
%.r2cpp.cpp : %.cpp
	testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_C_ -I. -I../.. $(INCLUDES) $<
libISSMRose_a_SOURCES = $(libISSMCore_a_SOURCES:.cpp=.r2cpp.cpp)
libISSMRose_a_CXXFLAGS= -fPIC -D_C_ $(CXXOPTFLAGS)



#Automatic differentiation rules: 
%.ad.c: %.c
	adic2 -mforward  $< --nary



#Executable
bin_PROGRAMS +=  issmRose.exe
issmRose_exe_LDADD = ./libISSMRose.a $(LDADD)
issmRose_exe_SOURCES = main/issm.cpp
issmRose_exe_CXXFLAGS= -fPIC $(CXXOPTFLAGS) $(COPTFLAGS) 
LDADD +=  $(ADIC2LIB) 

endif #}}}
