diff options
author | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-14 09:24:55 -0500 |
---|---|---|
committer | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-14 09:24:55 -0500 |
commit | b5b16cf826d468e79b4087500192a4a9e07c140f (patch) | |
tree | 1f615ee9ed6500bb1f6964ef2af0478b2fe51e4e /example_packages/makefile_complex | |
parent | d3a65e36b28808c2c51ae41fc107f1179e27a08c (diff) | |
download | fpm-b5b16cf826d468e79b4087500192a4a9e07c140f.tar.gz fpm-b5b16cf826d468e79b4087500192a4a9e07c140f.zip |
Better organize example packages and bootstrap tests
Diffstat (limited to 'example_packages/makefile_complex')
-rw-r--r-- | example_packages/makefile_complex/.gitignore | 1 | ||||
-rw-r--r-- | example_packages/makefile_complex/Makefile | 9 | ||||
-rw-r--r-- | example_packages/makefile_complex/app/main.f90 | 7 | ||||
-rw-r--r-- | example_packages/makefile_complex/fpm.toml | 8 | ||||
-rw-r--r-- | example_packages/makefile_complex/src/wrapper_mod.f90 | 12 |
5 files changed, 37 insertions, 0 deletions
diff --git a/example_packages/makefile_complex/.gitignore b/example_packages/makefile_complex/.gitignore new file mode 100644 index 0000000..a007fea --- /dev/null +++ b/example_packages/makefile_complex/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/example_packages/makefile_complex/Makefile b/example_packages/makefile_complex/Makefile new file mode 100644 index 0000000..497c6b2 --- /dev/null +++ b/example_packages/makefile_complex/Makefile @@ -0,0 +1,9 @@ +INCLUDE_FLAGS = $(addprefix -I,$(INCLUDE_DIRS)) + +$(BUILD_DIR)/libmakefile_complex.a: $(BUILD_DIR)/wrapper_mod.o + ar rs $(@) $(^) + +$(BUILD_DIR)/wrapper_mod.mod: src/wrapper_mod.f90 + +$(BUILD_DIR)/wrapper_mod.o: src/wrapper_mod.f90 + $(FC) -c -J$(BUILD_DIR) $(INCLUDE_FLAGS) $(FFLAGS) -o $(@) $(<) diff --git a/example_packages/makefile_complex/app/main.f90 b/example_packages/makefile_complex/app/main.f90 new file mode 100644 index 0000000..ac9ed51 --- /dev/null +++ b/example_packages/makefile_complex/app/main.f90 @@ -0,0 +1,7 @@ +program makefile_complex + use wrapper_mod, only: do_stuff + + implicit none + + call do_stuff +end program makefile_complex diff --git a/example_packages/makefile_complex/fpm.toml b/example_packages/makefile_complex/fpm.toml new file mode 100644 index 0000000..3282cbe --- /dev/null +++ b/example_packages/makefile_complex/fpm.toml @@ -0,0 +1,8 @@ +name = "makefile_complex" + +[dependencies] +with_makefile = { path = "../with_makefile" } + +[library] +source-dir = "src" +build-script = "Makefile" diff --git a/example_packages/makefile_complex/src/wrapper_mod.f90 b/example_packages/makefile_complex/src/wrapper_mod.f90 new file mode 100644 index 0000000..e8028b5 --- /dev/null +++ b/example_packages/makefile_complex/src/wrapper_mod.f90 @@ -0,0 +1,12 @@ +module wrapper_mod + use hello_makefile, only: say_hello_from_makefile + + implicit none + private + + public :: do_stuff +contains + subroutine do_stuff + call say_hello_from_makefile + end subroutine do_stuff +end module wrapper_mod |