aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpm/src/fpm_command_line.f902
-rw-r--r--fpm/src/fpm_compiler.f9010
-rw-r--r--fpm/src/fpm_environment.f9013
-rw-r--r--fpm/src/fpm_strings.f903
4 files changed, 22 insertions, 6 deletions
diff --git a/fpm/src/fpm_command_line.f90 b/fpm/src/fpm_command_line.f90
index 4d184e4..3c8edbd 100644
--- a/fpm/src/fpm_command_line.f90
+++ b/fpm/src/fpm_command_line.f90
@@ -15,7 +15,7 @@
!> wanted command line and the expected default values.
!> Some of the following points also apply if you add a new option or argument
!> to an existing *fpm* subcommand.
-!> Add this point you should create a help page for the new command in a simple
+!> At this point you should create a help page for the new command in a simple
!> catman-like format as well in the ``set_help`` procedure.
!> Make sure to register new subcommands in the ``fpm-manual`` command by adding
!> them to the manual character array and in the help/manual case as well.
diff --git a/fpm/src/fpm_compiler.f90 b/fpm/src/fpm_compiler.f90
index ba840e6..cc36d8c 100644
--- a/fpm/src/fpm_compiler.f90
+++ b/fpm/src/fpm_compiler.f90
@@ -1,14 +1,18 @@
+!># Define compiler command options
+!!
+!! This module defines compiler options to use for the debug and release builds.
module fpm_compiler
use fpm_model, only: fpm_model_t
use fpm_filesystem, only: join_path
public add_compile_flag_defaults
contains
+!> Choose compile flags based on cli settings & manifest inputs
subroutine add_compile_flag_defaults(build_name,compiler,model)
-! Choose compile flags based on cli settings & manifest inputs
-character(len=*),intent(in) :: build_name, compiler
+character(len=*),intent(in) :: build_name !! select build from {release,debug}
+character(len=*),intent(in) :: compiler !! compiler name
+type(fpm_model_t), intent(inout) :: model !! model to add compiler options to
-type(fpm_model_t), intent(inout) :: model
! could just be a function to return a string instead of passing model
! but likely to change other components like matching C compiler
diff --git a/fpm/src/fpm_environment.f90 b/fpm/src/fpm_environment.f90
index 929a704..e70d581 100644
--- a/fpm/src/fpm_environment.f90
+++ b/fpm/src/fpm_environment.f90
@@ -14,8 +14,8 @@ module fpm_environment
integer, parameter, public :: OS_SOLARIS = 5
integer, parameter, public :: OS_FREEBSD = 6
contains
+ !> Determine the OS type
integer function get_os_type() result(r)
- !! Determine the OS type
!!
!! Returns one of OS_UNKNOWN, OS_LINUX, OS_MACOS, OS_WINDOWS, OS_CYGWIN,
!! OS_SOLARIS, OS_FREEBSD.
@@ -106,6 +106,9 @@ contains
end if
end function get_os_type
+ !> Compare the output of [[get_os_type]] or the optional
+ !! passed INTEGER value to the value for OS_WINDOWS
+ !! and return .TRUE. if they match and .FALSE. otherwise
logical function os_is_unix(os) result(unix)
integer, intent(in), optional :: os
integer :: build_os
@@ -117,6 +120,7 @@ contains
unix = os /= OS_WINDOWS
end function os_is_unix
+ !> echo command string and pass it to the system for execution
subroutine run(cmd,echo)
character(len=*), intent(in) :: cmd
logical,intent(in),optional :: echo
@@ -137,10 +141,15 @@ contains
end if
end subroutine run
+ !> get named environment variable value. It it is blank or
+ !! not set return the optional default value
function get_env(NAME,DEFAULT) result(VALUE)
implicit none
- character(len=*),intent(in) :: NAME
+ !> name of environment variable to get the value of
+ character(len=*),intent(in) :: NAME
+ !> default value to return if the requested value is undefined or blank
character(len=*),intent(in),optional :: DEFAULT
+ !> the returned value
character(len=:),allocatable :: VALUE
integer :: howbig
integer :: stat
diff --git a/fpm/src/fpm_strings.f90 b/fpm/src/fpm_strings.f90
index 9066d67..3a47d67 100644
--- a/fpm/src/fpm_strings.f90
+++ b/fpm/src/fpm_strings.f90
@@ -1,3 +1,6 @@
+!> This module defines general procedures for **string operations** for both CHARACTER and
+!! TYPE(STRING_T) variables
+!
!>## general routines for performing __string operations__
!!
!!### Types