diff options
author | LKedward <laurence.kedward@bristol.ac.uk> | 2020-11-01 13:41:39 +0000 |
---|---|---|
committer | LKedward <laurence.kedward@bristol.ac.uk> | 2020-11-01 13:41:39 +0000 |
commit | 1cf62c0accda7294a230cb89912bad2d03863c46 (patch) | |
tree | af32c64cdd87db46cf585c275f01c5909a160535 | |
parent | 11bebfcbbd114655b38ee0dd7e47ade9a15252d6 (diff) | |
download | fpm-1cf62c0accda7294a230cb89912bad2d03863c46.tar.gz fpm-1cf62c0accda7294a230cb89912bad2d03863c46.zip |
Cleanup for PR
-rw-r--r-- | fpm/src/fpm.f90 | 28 | ||||
-rw-r--r-- | fpm/src/fpm_backend.f90 | 8 | ||||
-rw-r--r-- | fpm/src/fpm_model.f90 | 4 | ||||
-rw-r--r-- | fpm/src/fpm_targets.f90 | 4 |
4 files changed, 22 insertions, 22 deletions
diff --git a/fpm/src/fpm.f90 b/fpm/src/fpm.f90 index 402a1e4..97c1f42 100644 --- a/fpm/src/fpm.f90 +++ b/fpm/src/fpm.f90 @@ -170,18 +170,18 @@ subroutine build_model(model, settings, package, error) & -fmax-errors=1 & & -ffast-math & & -funroll-loops ' // & - & '-J'//join_path(model%output_directory,'lib') + & '-J'//join_path(model%output_directory,model%package_name) else model%output_directory = 'build/gfortran_debug' model%fortran_compile_flags = ' -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g '// & '-fbounds-check -fcheck-array-temporaries -fbacktrace '// & - '-J'//join_path(model%output_directory,'lib') + '-J'//join_path(model%output_directory,model%package_name) endif model%link_flags = '' ! Add sources from executable directories if (is_dir('app') .and. package%build_config%auto_executables) then - call add_sources_from_dir(sources,'app', FPM_SCOPE_APP, & + call add_sources_from_dir(model%sources,'app', FPM_SCOPE_APP, & with_executables=.true., error=error) if (allocated(error)) then @@ -190,7 +190,7 @@ subroutine build_model(model, settings, package, error) end if if (is_dir('test') .and. package%build_config%auto_tests) then - call add_sources_from_dir(sources,'test', FPM_SCOPE_TEST, & + call add_sources_from_dir(model%sources,'test', FPM_SCOPE_TEST, & with_executables=.true., error=error) if (allocated(error)) then @@ -199,7 +199,7 @@ subroutine build_model(model, settings, package, error) end if if (allocated(package%executable)) then - call add_executable_sources(sources, package%executable, FPM_SCOPE_APP, & + call add_executable_sources(model%sources, package%executable, FPM_SCOPE_APP, & auto_discover=package%build_config%auto_executables, & error=error) @@ -209,7 +209,7 @@ subroutine build_model(model, settings, package, error) end if if (allocated(package%test)) then - call add_executable_sources(sources, package%test, FPM_SCOPE_TEST, & + call add_executable_sources(model%sources, package%test, FPM_SCOPE_TEST, & auto_discover=package%build_config%auto_tests, & error=error) @@ -220,25 +220,23 @@ subroutine build_model(model, settings, package, error) endif ! Add library sources, including local dependencies - call add_libsources_from_package(sources,package_list,package, & + call add_libsources_from_package(model%sources,package_list,package, & package_root='.',dev_depends=.true.,error=error) if (allocated(error)) then return end if + call targets_from_sources(model,model%sources) + if(settings%list)then - do i=1,size(sources) - write(stderr,'(*(g0,1x))')'fpm::build<INFO>:file expected at',sources(i)%file_name, & - & merge('exists ','does not exist',exists(sources(i)%file_name) ) + do i=1,size(model%targets) + write(stderr,*) model%targets(i)%ptr%output_file enddo stop - else - - call targets_from_sources(model,sources) - - call resolve_module_dependencies(model%targets,error) endif + call resolve_module_dependencies(model%targets,error) + end subroutine build_model diff --git a/fpm/src/fpm_backend.f90 b/fpm/src/fpm_backend.f90 index 88f3317..d3fa785 100644 --- a/fpm/src/fpm_backend.f90 +++ b/fpm/src/fpm_backend.f90 @@ -28,13 +28,13 @@ subroutine build_package(model) if (.not.exists(model%output_directory)) then call mkdir(model%output_directory) end if - - if (.not.exists(join_path(model%output_directory,'lib'))) then - call mkdir(join_path(model%output_directory,'lib')) + if (.not.exists(join_path(model%output_directory,model%package_name))) then + call mkdir(join_path(model%output_directory,model%package_name)) end if if (model%targets(1)%ptr%target_type == FPM_TARGET_ARCHIVE) then - linking = ' -l'//model%package_name//" -L"//join_path(model%output_directory,'lib') + linking = ' -l'//model%package_name//" -L"//& + join_path(model%output_directory,model%package_name) else linking = " " end if diff --git a/fpm/src/fpm_model.f90 b/fpm/src/fpm_model.f90 index 44b7d39..b8c3220 100644 --- a/fpm/src/fpm_model.f90 +++ b/fpm/src/fpm_model.f90 @@ -75,8 +75,10 @@ end type build_target_t type :: fpm_model_t character(:), allocatable :: package_name ! Name of package + type(srcfile_t), allocatable :: sources(:) + ! Array of sources type(build_target_ptr), allocatable :: targets(:) - ! Array of sources with module-dependencies resolved + ! Array of targets with module-dependencies resolved character(:), allocatable :: fortran_compiler ! Command line name to invoke fortran compiler character(:), allocatable :: fortran_compile_flags diff --git a/fpm/src/fpm_targets.f90 b/fpm/src/fpm_targets.f90 index 0c46aac..54f0764 100644 --- a/fpm/src/fpm_targets.f90 +++ b/fpm/src/fpm_targets.f90 @@ -20,7 +20,7 @@ subroutine targets_from_sources(model,sources) if (with_lib) call add_target(model%targets,type = FPM_TARGET_ARCHIVE,& output_file = join_path(model%output_directory,& - 'lib','lib'//model%package_name//'.a')) + model%package_name,'lib'//model%package_name//'.a')) do i=1,size(sources) @@ -98,7 +98,7 @@ subroutine targets_from_sources(model,sources) object_file = join_path(model%output_directory,'test',object_file)//'.o' case default - object_file = join_path(model%output_directory,'lib',object_file)//'.o' + object_file = join_path(model%output_directory,model%package_name,object_file)//'.o' end select |