source: palm/trunk/UTIL/inifor/Makefile.gnu @ 3538

Last change on this file since 3538 was 3447, checked in by eckhard, 6 years ago

inifor: Renamed source files for compatibilty with PALM build system

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