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 2718 2018-01-02 08:49:38Z kanani $ |
---|
27 | # Initial revision |
---|
28 | # |
---|
29 | # |
---|
30 | # |
---|
31 | # Authors: |
---|
32 | # -------- |
---|
33 | # @author Eckhard Kadasch |
---|
34 | # |
---|
35 | # Description: |
---|
36 | # ------------ |
---|
37 | # This file serves as a templete makefile for compiling INIFOR with gfortran. |
---|
38 | #------------------------------------------------------------------------------# |
---|
39 | PROJECT = inifor |
---|
40 | PROJECT_PATH = . |
---|
41 | BIN_PATH = $(PROJECT_PATH)/bin |
---|
42 | SRC_PATH = $(PROJECT_PATH)/src |
---|
43 | TEST_PATH = $(PROJECT_PATH)/tests |
---|
44 | |
---|
45 | MODULES = $(SRC_PATH)/defs.mod $(SRC_PATH)/control.mod $(SRC_PATH)/util.mod $(SRC_PATH)/types.mod $(SRC_PATH)/transform.mod $(SRC_PATH)/io.mod $(SRC_PATH)/grid.mod |
---|
46 | SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90 |
---|
47 | OBJECTS = $(SOURCES:%.f90=%.o) |
---|
48 | |
---|
49 | FC = gfortran |
---|
50 | WRNGS = -Wall -Wextra -Wsurprising -Waliasing -Wcharacter-truncation \ |
---|
51 | -Wline-truncation -fbacktrace -fcheck=all -pedantic \ |
---|
52 | -ffpe-trap=invalid,zero,underflow,overflow |
---|
53 | FFLAGS = -fdefault-real-8 -Og -g $(WRNGS) |
---|
54 | INCLUDE = -I/home/ekadasch/local/include |
---|
55 | LIBRARY = -L/home/ekadasch/local/lib64 -lnetcdff |
---|
56 | |
---|
57 | .PHONY: all clean doc run tags test test-verbose $(PROJECT) |
---|
58 | |
---|
59 | $(PROJECT): $(OBJECTS) $(MODULES) |
---|
60 | @echo "" |
---|
61 | mkdir -p $(BIN_PATH) |
---|
62 | $(FC) $(FFLAGS) $(OBJECTS) -o $(BIN_PATH)/$(PROJECT) -I$(SRC_PATH) $(LIBRARY) |
---|
63 | |
---|
64 | $(SRC_PATH)/%.o: $(SRC_PATH)/%.f90 |
---|
65 | @echo "" |
---|
66 | $(FC) $(FFLAGS) -c $< -o $@ -J$(SRC_PATH) $(INCLUDE) |
---|
67 | |
---|
68 | $(SRC_PATH)/%.mod: $(SRC_PATH)/%.f90 |
---|
69 | @echo "" |
---|
70 | $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) -J$(SRC_PATH) $(INCLUDE) |
---|
71 | |
---|
72 | all: clean $(PROJECT) test doc |
---|
73 | |
---|
74 | clean: |
---|
75 | @echo "" |
---|
76 | rm -rf $(OBJECTS) $(MODULES) $(BIN_PATH)/$(PROJECT) |
---|
77 | rm -rf *.mod *.o |
---|
78 | rm -rf ./doc/latex ./doc/html |
---|
79 | rm -f $(SRC_PATH)/tags |
---|
80 | rm -f *.files |
---|
81 | rm -f palm-hsurf.nc |
---|
82 | $(MAKE) -C $(TEST_PATH) clean |
---|
83 | $(MAKE) -C $(SRC_PATH) clean |
---|
84 | |
---|
85 | doc: |
---|
86 | @echo "" |
---|
87 | doxygen ./doc/doxygen.config |
---|
88 | |
---|
89 | run: $(PROJECT) |
---|
90 | @echo "" |
---|
91 | $(BIN_PATH)/$(PROJECT) |
---|
92 | |
---|
93 | tags: |
---|
94 | @echo "" |
---|
95 | $(MAKE) -C $(SRC_PATH) tags |
---|
96 | |
---|
97 | test: |
---|
98 | @echo "Running tests" |
---|
99 | $(MAKE) -C $(TEST_PATH) test | grep Test |
---|
100 | @echo "...done testing" |
---|
101 | |
---|
102 | test-verbose: |
---|
103 | @echo "Running tests" |
---|
104 | $(MAKE) -C $(TEST_PATH) test |
---|
105 | @echo "...done testing" |
---|