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-2018 Leibniz Universitaet Hannover |
---|
17 | # Copyright 2017-2018 Deutscher Wetterdienst Offenbach |
---|
18 | #------------------------------------------------------------------------------# |
---|
19 | # |
---|
20 | # Current revisions: |
---|
21 | # ----------------- |
---|
22 | # |
---|
23 | # |
---|
24 | # Former revisions: |
---|
25 | # ----------------- |
---|
26 | # $Id: Makefile.gnu 3395 2018-10-22 17:32:49Z gronemeier $ |
---|
27 | # Updated build order |
---|
28 | # |
---|
29 | # 3183 2018-07-27 14:25:55Z suehring |
---|
30 | # Added __netcdf4 preprocessor flag |
---|
31 | # Corrected compilation order |
---|
32 | # |
---|
33 | # |
---|
34 | # 3182 2018-07-27 13:36:03Z suehring |
---|
35 | # Initial revision |
---|
36 | # |
---|
37 | # |
---|
38 | # |
---|
39 | # Authors: |
---|
40 | # -------- |
---|
41 | # @author Eckhard Kadasch |
---|
42 | # |
---|
43 | # Description: |
---|
44 | # ------------ |
---|
45 | # This file serves as a templete makefile for compiling INIFOR with gfortran. |
---|
46 | #------------------------------------------------------------------------------# |
---|
47 | PROJECT = inifor |
---|
48 | PROJECT_PATH = . |
---|
49 | BIN_PATH = $(PROJECT_PATH)/../../SCRIPTS |
---|
50 | SRC_PATH = $(PROJECT_PATH)/src |
---|
51 | TEST_PATH = $(PROJECT_PATH)/tests |
---|
52 | |
---|
53 | MODULES = $(SRC_PATH)/defs.mod $(SRC_PATH)/types.mod $(SRC_PATH)/util.mod $(SRC_PATH)/control.mod $(SRC_PATH)/transform.mod $(SRC_PATH)/io.mod $(SRC_PATH)/grid.mod |
---|
54 | SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90 |
---|
55 | OBJECTS = $(SOURCES:%.f90=%.o) |
---|
56 | |
---|
57 | FC = gfortran |
---|
58 | WRNGS = -Wall -Wextra -Wsurprising -Waliasing -Wcharacter-truncation \ |
---|
59 | -Wline-truncation -fbacktrace -fcheck=all -pedantic \ |
---|
60 | -ffpe-trap=invalid,zero,underflow,overflow |
---|
61 | FFLAGS = -fdefault-real-8 -Og -g $(WRNGS) -cpp -D__netcdf4 |
---|
62 | INCLUDE = -I/home/ekadasch/local/include |
---|
63 | LIBRARY = -L/home/ekadasch/local/lib64 -lnetcdff |
---|
64 | |
---|
65 | .PHONY: all clean doc run tags test test-verbose $(PROJECT) |
---|
66 | |
---|
67 | $(PROJECT): $(OBJECTS) $(MODULES) tags |
---|
68 | @echo "" |
---|
69 | mkdir -p $(BIN_PATH) |
---|
70 | $(FC) $(FFLAGS) $(OBJECTS) -o $(BIN_PATH)/$(PROJECT) -I$(SRC_PATH) $(LIBRARY) |
---|
71 | |
---|
72 | $(SRC_PATH)/%.o: $(SRC_PATH)/%.f90 |
---|
73 | @echo "" |
---|
74 | $(FC) $(FFLAGS) -c $< -o $@ -J$(SRC_PATH) $(INCLUDE) |
---|
75 | |
---|
76 | $(SRC_PATH)/%.mod: $(SRC_PATH)/%.f90 |
---|
77 | @echo "" |
---|
78 | $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) -J$(SRC_PATH) $(INCLUDE) |
---|
79 | |
---|
80 | all: clean $(PROJECT) test doc |
---|
81 | |
---|
82 | clean: |
---|
83 | @echo "" |
---|
84 | rm -rf $(OBJECTS) $(MODULES) $(BIN_PATH)/$(PROJECT) |
---|
85 | rm -rf *.mod *.o |
---|
86 | rm -rf ./doc/latex ./doc/html |
---|
87 | rm -f $(SRC_PATH)/tags |
---|
88 | $(MAKE) -C $(TEST_PATH) clean |
---|
89 | $(MAKE) -C $(SRC_PATH) clean |
---|
90 | |
---|
91 | doc: |
---|
92 | @echo "" |
---|
93 | doxygen ./doc/doxygen.config |
---|
94 | |
---|
95 | run: $(PROJECT) |
---|
96 | @echo "" |
---|
97 | $(BIN_PATH)/$(PROJECT) |
---|
98 | |
---|
99 | tags: |
---|
100 | @echo "" |
---|
101 | $(MAKE) -C $(SRC_PATH) tags |
---|
102 | |
---|
103 | test: |
---|
104 | @echo "Running tests" |
---|
105 | $(MAKE) -C $(TEST_PATH) test | grep Test |
---|
106 | @echo "...done testing" |
---|
107 | |
---|
108 | test-verbose: |
---|
109 | @echo "Running tests" |
---|
110 | $(MAKE) -C $(TEST_PATH) test |
---|
111 | @echo "...done testing" |
---|