finish README
[AGH_fortran_course_solution3.git] / Makefile
blobf22582bb3505f9aa0b8ad5bf6a5e4a2b5c1cadd0
1 # Copyright 2019 Wojciech Kosior
3 # This is free and unencumbered software released into the public domain.
5 # Anyone is free to copy, modify, publish, use, compile, sell, or
6 # distribute this software, either in source code form or as a compiled
7 # binary, for any purpose, commercial or non-commercial, and by any
8 # means.
10 # In jurisdictions that recognize copyright laws, the author or authors
11 # of this software dedicate any and all copyright interest in the
12 # software to the public domain. We make this dedication for the benefit
13 # of the public at large and to the detriment of our heirs and
14 # successors. We intend this dedication to be an overt act of
15 # relinquishment in perpetuity of all present and future rights to this
16 # software under copyright law.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 # OTHER DEALINGS IN THE SOFTWARE.
26 # For more information, please refer to <http://unlicense.org/>
28 FC = gfortran
29 FFLAGS = -std=f2008 -Wall -pedantic -fbounds-check -fimplicit-none \
30 -ffree-form -O2 -c
32 all : integrator integrator_single
34 main.o main.mod : quadratures.mod functions.mod
36 %.mod %.o : src/%.f90
37 $(FC) $(FFLAGS) -fcoarray=lib $<
39 %.mod %_single.o : src/%.f90
40 $(FC) $(FFLAGS) -fcoarray=single -o $*_single.o $<
42 integrator : main.o quadratures.o functions.o
43 $(FC) -lcaf_mpi $^ -o $@
45 integrator_single : main_single.o quadratures_single.o functions_single.o
46 $(FC) $^ -o $@
48 results: res/1image_results res/5images_results res/times
50 res/1image_results : integrator run.sh
51 ./run.sh 1 > $@
53 res/5images_results : integrator run.sh
54 ./run.sh 5 > $@
56 res/times : integrator integrator_single measure_times.sh
57 ./measure_times.sh > $@
59 clean :
60 -rm integrator{,_single} *.{mod,o}
62 .PHONY : all clean results