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