source: palm/trunk/UTIL/inifor/tests/Makefile.ifort @ 4836

Last change on this file since 4836 was 4481, checked in by maronga, 5 years ago

Bugfix for copyright updates in document_changes; copyright update applied to all files

  • Property svn:keywords set to Id
File size: 2.8 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-2020 Leibniz Universitaet Hannover
17# Copyright 2017-2020 Deutscher Wetterdienst Offenbach
18#------------------------------------------------------------------------------#
19#
20# Current revisions:
21# -----------------
22#
23#
24# Former revisions:
25# -----------------
26# $Id: Makefile.ifort 4481 2020-03-31 18:55:54Z raasch $
27# Updated copyright note
28#
29#
30# 3618 2018-12-10 13:25:22Z eckhard
31# Prefixed INIFOR modules with inifor_
32#
33#
34# 2718 2018-01-02 08:49:38Z maronga
35# Initial revision
36#
37#
38#
39# Authors:
40# --------
41# @author Eckhard Kadasch
42#
43# Description:
44# ------------
45# This file serves as a templete makefile for compiling INIFOR tests with
46# ifort.
47#------------------------------------------------------------------------------!
48PROJECT = inifor
49PROJECT_PATH = ..
50BIN_PATH = $(PROJECT_PATH)/bin
51SRC_PATH = $(PROJECT_PATH)/src
52TESTS    = $(patsubst %.f90,%,$(wildcard test-*.f90))
53
54MODULES = util.mod $(SRC_PATH)/inifor_defs.mod $(SRC_PATH)/inifor_control.mod $(SRC_PATH)/inifor_util.mod $(SRC_PATH)/inifor_types.mod $(SRC_PATH)/inifor_transform.mod $(SRC_PATH)/inifor_io.mod $(SRC_PATH)/inifor_grid.mod
55SOURCES = $(MODULES:%.mod=%.f90)
56OBJECTS = $(SOURCES:%.f90=%.o)
57
58FC      = ifort
59FFLAGS  = -g -real-size 64 -no-wrap-margin
60INCLUDE = -I$(SRC_PATH)
61LIBRARY = -L/usr/local/pkg/netcdf/4.3.2/lib -lnetcdff -lutil
62
63.PHONY: clean test $(PROJECT)
64
65test: information $(PROJECT) $(TESTS)
66
67information:
68        @echo $(TESTS)
69
70$(PROJECT):
71        $(MAKE) -C $(PROJECT_PATH) $(PROJECT)
72
73test-grid: $(OBJECTS) $(MODULES) test-grid.o test-grid.mod util.mod util.o
74        mkdir -p $(BIN_PATH)
75        $(FC) $(FFLAGS) $(OBJECTS) $@.o -o $(BIN_PATH)/$@ $(INCLUDE) $(LIBRARY)
76        $(BIN_PATH)/$@
77
78# $(TESTS) expands to files of this pattern:
79test-%: $(OBJECTS) $(MODULES) test-%.o test-%.mod
80        mkdir -p $(BIN_PATH)
81        $(FC) $(FFLAGS) $(OBJECTS) $@.o -o $(BIN_PATH)/$@ $(INCLUDE) $(LIBRARY)
82        $(BIN_PATH)/$@
83
84%.o: %.mod
85
86util.o: util.f90
87        $(FC) $(FFLAGS) -c $< -o $@
88
89util.mod: util.f90
90        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o)
91
92test-%.o: test-%.f90
93        $(FC) $(FFLAGS) -c $< -o $@ $(INCLUDE)
94
95test-%.mod: test-%.f90
96        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) $(INCLUDE)
97
98clean:
99        rm -rf *.mod *.o
100        rm -rf $(BIN_PATH)/test-*
Note: See TracBrowser for help on using the repository browser.