source: palm/trunk/UTIL/inifor/Makefile @ 3719

Last change on this file since 3719 was 3716, checked in by eckhard, 6 years ago

inifor: bugfix: removed dependency on soilmoisture input files; added netcdf preprocessor flag

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
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 3716 2019-02-05 17:02:38Z kanani $
27# Added __netcdf preprocessor flag
28#
29#
30# 3447 2018-10-29 15:52:54Z eckhard
31# Renamed source files for compatibilty with PALM build system
32#
33# 3395 2018-10-22 17:32:49Z eckhard
34# Updated build order
35#
36# 3183 2018-07-27 14:25:55Z suehring
37# Added __netcdf4 preprocessor flag
38#
39#
40# 3182 2018-07-27 13:36:03Z suehring
41# Initial revision
42#
43#
44#
45# Authors:
46# --------
47# @author Eckhard Kadasch
48#
49# Description:
50# ------------
51# This makefile may be used to exclusively compile INIFOR.
52#------------------------------------------------------------------------------#
53PROJECT = inifor
54PROJECT_PATH = .
55BIN_PATH  = $(PROJECT_PATH)/../../SCRIPTS
56SRC_PATH  = $(PROJECT_PATH)/src
57TEST_PATH = $(PROJECT_PATH)/tests
58
59MODULES = $(SRC_PATH)/inifor_defs.mod $(SRC_PATH)/inifor_types.mod \
60                  $(SRC_PATH)/inifor_util.mod $(SRC_PATH)/inifor_control.mod \
61                  $(SRC_PATH)/inifor_transform.mod $(SRC_PATH)/inifor_io.mod \
62                  $(SRC_PATH)/inifor_grid.mod
63SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90
64OBJECTS = $(SOURCES:%.f90=%.o)
65
66FC      = gfortran
67WRNGS   = -Wall -Wextra -Wsurprising -Waliasing -Wcharacter-truncation \
68                  -Wline-truncation -fbacktrace -fcheck=all -pedantic \
69                  -ffpe-trap=invalid,zero,underflow,overflow
70FFLAGS  = -fdefault-real-8 -Og -g $(WRNGS) -cpp -D__netcdf4 -D__netcdf
71INCLUDE = -I/home/ekadasch/local/include
72LIBRARY = -L/home/ekadasch/local/lib64 -lnetcdff
73
74.PHONY: all clean doc run tags test test-verbose $(PROJECT)
75
76$(PROJECT): $(OBJECTS) $(MODULES) tags
77        @echo ""
78        mkdir -p $(BIN_PATH)
79        $(FC) $(FFLAGS) $(OBJECTS) -o $(BIN_PATH)/$(PROJECT) -I$(SRC_PATH) $(LIBRARY)
80
81$(SRC_PATH)/%.o: $(SRC_PATH)/%.f90
82        @echo ""
83        $(FC) $(FFLAGS) -c $< -o $@ -J$(SRC_PATH) $(INCLUDE)
84
85$(SRC_PATH)/%.mod: $(SRC_PATH)/%.f90
86        @echo ""
87        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) -J$(SRC_PATH) $(INCLUDE)
88
89all: clean $(PROJECT) test doc
90
91clean:
92        @echo ""
93        rm -rf $(OBJECTS) $(MODULES) $(BIN_PATH)/$(PROJECT)
94        rm -rf *.mod *.o
95        rm -rf ./doc/latex ./doc/html
96        rm -f $(SRC_PATH)/tags
97        rm -f *.files
98        rm -f palm-hsurf.nc
99        $(MAKE) -C $(TEST_PATH) clean
100        $(MAKE) -C $(SRC_PATH) clean
101
102doc:
103        @echo ""
104        doxygen ./doc/doxygen.config
105
106run: $(PROJECT)
107        @echo ""
108        $(BIN_PATH)/$(PROJECT)
109
110tags:
111        @echo ""
112        $(MAKE) -C $(SRC_PATH) tags
113
114test:
115        @echo "Running tests"
116        $(MAKE) -C $(TEST_PATH) test | grep Test
117        @echo "...done testing"
118
119test-verbose:
120        @echo "Running tests"
121        $(MAKE) -C $(TEST_PATH) test
122        @echo "...done testing"
Note: See TracBrowser for help on using the repository browser.