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

Last change on this file since 3198 was 3183, checked in by suehring, 6 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 3.1 KB
RevLine 
[2696]1#------------------------------------------------------------------------------#
[2718]2# This file is part of the PALM model system.
[2696]3#
[2718]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
[2696]7# version.
8#
[2718]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.
[2696]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#
[2718]16# Copyright 2017-2018 Leibniz Universitaet Hannover
17# Copyright 2017-2018 Deutscher Wetterdienst Offenbach
[2696]18#------------------------------------------------------------------------------#
19#
20# Current revisions:
21# -----------------
22#
23#
24# Former revisions:
25# -----------------
26# $Id: Makefile 3183 2018-07-27 14:25:55Z sward $
[3183]27# Added __netcdf4 preprocessor flag
28#
29#
30# 3182 2018-07-27 13:36:03Z suehring
[2696]31# Initial revision
32#
33#
34#
35# Authors:
36# --------
37# @author Eckhard Kadasch
38#
39# Description:
40# ------------
41# This makefile may be used to exclusively compile INIFOR.
42#------------------------------------------------------------------------------#
43PROJECT = inifor
44PROJECT_PATH = .
45BIN_PATH  = $(PROJECT_PATH)/../../SCRIPTS
46SRC_PATH  = $(PROJECT_PATH)/src
47TEST_PATH = $(PROJECT_PATH)/tests
48
49MODULES = $(SRC_PATH)/defs.mod $(SRC_PATH)/util.mod $(SRC_PATH)/control.mod $(SRC_PATH)/types.mod $(SRC_PATH)/transform.mod $(SRC_PATH)/io.mod $(SRC_PATH)/grid.mod
50SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90
51OBJECTS = $(SOURCES:%.f90=%.o)
52
53FC      = gfortran
54WRNGS   = -Wall -Wextra -Wsurprising -Waliasing -Wcharacter-truncation \
55                  -Wline-truncation -fbacktrace -fcheck=all -pedantic \
56                  -ffpe-trap=invalid,zero,underflow,overflow
[3182]57FFLAGS  = -fdefault-real-8 -Og -g $(WRNGS) -cpp -D__netcdf4
[2696]58INCLUDE = -I/home/ekadasch/local/include
59LIBRARY = -L/home/ekadasch/local/lib64 -lnetcdff
60
61.PHONY: all clean doc run tags test test-verbose $(PROJECT)
62
63$(PROJECT): $(OBJECTS) $(MODULES) tags
64        @echo ""
65        mkdir -p $(BIN_PATH)
66        $(FC) $(FFLAGS) $(OBJECTS) -o $(BIN_PATH)/$(PROJECT) -I$(SRC_PATH) $(LIBRARY)
67
68$(SRC_PATH)/%.o: $(SRC_PATH)/%.f90
69        @echo ""
70        $(FC) $(FFLAGS) -c $< -o $@ -J$(SRC_PATH) $(INCLUDE)
71
72$(SRC_PATH)/%.mod: $(SRC_PATH)/%.f90
73        @echo ""
74        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) -J$(SRC_PATH) $(INCLUDE)
75
76all: clean $(PROJECT) test doc
77
78clean:
79        @echo ""
80        rm -rf $(OBJECTS) $(MODULES) $(BIN_PATH)/$(PROJECT)
81        rm -rf *.mod *.o
82        rm -rf ./doc/latex ./doc/html
83        rm -f $(SRC_PATH)/tags
84        rm -f *.files
85        rm -f palm-hsurf.nc
86        $(MAKE) -C $(TEST_PATH) clean
87        $(MAKE) -C $(SRC_PATH) clean
88
89doc:
90        @echo ""
91        doxygen ./doc/doxygen.config
92
93run: $(PROJECT)
94        @echo ""
95        $(BIN_PATH)/$(PROJECT)
96
97tags:
98        @echo ""
99        $(MAKE) -C $(SRC_PATH) tags
100
101test:
102        @echo "Running tests"
103        $(MAKE) -C $(TEST_PATH) test | grep Test
104        @echo "...done testing"
105
106test-verbose:
107        @echo "Running tests"
108        $(MAKE) -C $(TEST_PATH) test
109        @echo "...done testing"
Note: See TracBrowser for help on using the repository browser.