1 | #------------------------------------------------------------------------------# |
---|
2 | # This file is part of the PALM model system. |
---|
3 | # |
---|
4 | # PALM is free software: you can redistribute it and/or modify it under the |
---|
5 | # terms of the GNU General Public License as published by the Free Software |
---|
6 | # Foundation, either version 3 of the License, or (at your option) any later |
---|
7 | # version. |
---|
8 | # |
---|
9 | # PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
10 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
11 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
12 | # |
---|
13 | # You should have received a copy of the GNU General Public License along with |
---|
14 | # PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | # |
---|
16 | # Copyright 2017-2020 Leibniz Universitaet Hannover |
---|
17 | # Copyright 2017-2020 Deutscher Wetterdienst Offenbach |
---|
18 | #------------------------------------------------------------------------------# |
---|
19 | # |
---|
20 | # Current revisions: |
---|
21 | # ----------------- |
---|
22 | # |
---|
23 | # |
---|
24 | # Former revisions: |
---|
25 | # ----------------- |
---|
26 | # $Id: Makefile.gnu 4481 2020-03-31 18:55:54Z moh.hefny $ |
---|
27 | # Updated copyright note |
---|
28 | # |
---|
29 | # |
---|
30 | # 3716 2019-02-05 17:02:38Z eckhard |
---|
31 | # Added __netcdf preprocessor flag |
---|
32 | # |
---|
33 | # |
---|
34 | # 3447 2018-10-29 15:52:54Z eckhard |
---|
35 | # Renamed source files for compatibilty with PALM build system |
---|
36 | # |
---|
37 | # 3395 2018-10-22 17:32:49Z eckhard |
---|
38 | # Updated build order |
---|
39 | # |
---|
40 | # 3183 2018-07-27 14:25:55Z suehring |
---|
41 | # Added __netcdf4 preprocessor flag |
---|
42 | # Corrected compilation order |
---|
43 | # |
---|
44 | # |
---|
45 | # 3182 2018-07-27 13:36:03Z suehring |
---|
46 | # Initial revision |
---|
47 | # |
---|
48 | # |
---|
49 | # |
---|
50 | # Authors: |
---|
51 | # -------- |
---|
52 | # @author Eckhard Kadasch |
---|
53 | # |
---|
54 | # Description: |
---|
55 | # ------------ |
---|
56 | # This file serves as a templete makefile for compiling INIFOR with gfortran. |
---|
57 | #------------------------------------------------------------------------------# |
---|
58 | PROJECT = inifor |
---|
59 | PROJECT_PATH = . |
---|
60 | BIN_PATH = $(PROJECT_PATH)/../../SCRIPTS |
---|
61 | SRC_PATH = $(PROJECT_PATH)/src |
---|
62 | TEST_PATH = $(PROJECT_PATH)/tests |
---|
63 | |
---|
64 | MODULES = $(SRC_PATH)/inifor_defs.mod $(SRC_PATH)/inifor_types.mod \ |
---|
65 | $(SRC_PATH)/inifor_util.mod $(SRC_PATH)/inifor_control.mod \ |
---|
66 | $(SRC_PATH)/inifor_transform.mod $(SRC_PATH)/inifor_io.mod \ |
---|
67 | $(SRC_PATH)/inifor_grid.mod |
---|
68 | SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90 |
---|
69 | OBJECTS = $(SOURCES:%.f90=%.o) |
---|
70 | |
---|
71 | FC = gfortran |
---|
72 | WRNGS = -Wall -Wextra -Wsurprising -Waliasing -Wcharacter-truncation \ |
---|
73 | -Wline-truncation -fbacktrace -fcheck=all -pedantic \ |
---|
74 | -ffpe-trap=invalid,zero,underflow,overflow |
---|
75 | FFLAGS = -fdefault-real-8 -Og -g $(WRNGS) -cpp -D__netcdf4 -D__netcdf |
---|
76 | INCLUDE = -I/home/ekadasch/local/include |
---|
77 | LIBRARY = -L/home/ekadasch/local/lib64 -lnetcdff |
---|
78 | |
---|
79 | .PHONY: all clean doc run tags test test-verbose $(PROJECT) |
---|
80 | |
---|
81 | $(PROJECT): $(OBJECTS) $(MODULES) tags |
---|
82 | @echo "" |
---|
83 | mkdir -p $(BIN_PATH) |
---|
84 | $(FC) $(FFLAGS) $(OBJECTS) -o $(BIN_PATH)/$(PROJECT) -I$(SRC_PATH) $(LIBRARY) |
---|
85 | |
---|
86 | $(SRC_PATH)/%.o: $(SRC_PATH)/%.f90 |
---|
87 | @echo "" |
---|
88 | $(FC) $(FFLAGS) -c $< -o $@ -J$(SRC_PATH) $(INCLUDE) |
---|
89 | |
---|
90 | $(SRC_PATH)/%.mod: $(SRC_PATH)/%.f90 |
---|
91 | @echo "" |
---|
92 | $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) -J$(SRC_PATH) $(INCLUDE) |
---|
93 | |
---|
94 | all: clean $(PROJECT) test doc |
---|
95 | |
---|
96 | clean: |
---|
97 | @echo "" |
---|
98 | rm -rf $(OBJECTS) $(MODULES) $(BIN_PATH)/$(PROJECT) |
---|
99 | rm -rf *.mod *.o |
---|
100 | rm -rf ./doc/latex ./doc/html |
---|
101 | rm -f $(SRC_PATH)/tags |
---|
102 | $(MAKE) -C $(TEST_PATH) clean |
---|
103 | $(MAKE) -C $(SRC_PATH) clean |
---|
104 | |
---|
105 | doc: |
---|
106 | @echo "" |
---|
107 | doxygen ./doc/doxygen.config |
---|
108 | |
---|
109 | run: $(PROJECT) |
---|
110 | @echo "" |
---|
111 | $(BIN_PATH)/$(PROJECT) |
---|
112 | |
---|
113 | tags: |
---|
114 | @echo "" |
---|
115 | $(MAKE) -C $(SRC_PATH) tags |
---|
116 | |
---|
117 | test: |
---|
118 | @echo "Running tests" |
---|
119 | $(MAKE) -C $(TEST_PATH) test | grep Test |
---|
120 | @echo "...done testing" |
---|
121 | |
---|
122 | test-verbose: |
---|
123 | @echo "Running tests" |
---|
124 | $(MAKE) -C $(TEST_PATH) test |
---|
125 | @echo "...done testing" |
---|