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

Last change on this file since 3225 was 2718, checked in by maronga, 7 years ago

deleting of deprecated files; headers updated where needed

  • Property svn:keywords set to Id
File size: 2.6 KB
RevLine 
[2718]1#------------------------------------------------------------------------------#
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
18#------------------------------------------------------------------------------#
[2696]19#
20# Current revisions:
21# -----------------
22#
23#
24# Former revisions:
25# -----------------
26# $Id: Makefile.ifort 2718 2018-01-02 08:49:38Z kanani $
27# Initial revision
28#
29#
30#
31# Authors:
32# --------
33# @author Eckhard Kadasch
34#
35# Description:
36# ------------
37# This file serves as a templete makefile for compiling INIFOR tests with
38# ifort.
39#------------------------------------------------------------------------------!
40PROJECT = inifor
41PROJECT_PATH = ..
42BIN_PATH = $(PROJECT_PATH)/bin
43SRC_PATH = $(PROJECT_PATH)/src
44TESTS    = $(patsubst %.f90,%,$(wildcard test-*.f90))
45
46MODULES = util.mod $(SRC_PATH)/defs.mod $(SRC_PATH)/control.mod $(SRC_PATH)/util.mod $(SRC_PATH)/types.mod $(SRC_PATH)/transform.mod $(SRC_PATH)/io.mod $(SRC_PATH)/grid.mod
47SOURCES = $(MODULES:%.mod=%.f90)
48OBJECTS = $(SOURCES:%.f90=%.o)
49
50FC      = ifort
51FFLAGS  = -g -real-size 64 -no-wrap-margin
52INCLUDE = -I$(SRC_PATH)
53LIBRARY = -L/usr/local/pkg/netcdf/4.3.2/lib -lnetcdff -lutil
54
55.PHONY: clean test $(PROJECT)
56
57test: information $(PROJECT) $(TESTS)
58
59information:
60        @echo $(TESTS)
61
62$(PROJECT):
63        $(MAKE) -C $(PROJECT_PATH) $(PROJECT)
64
65test-grid: $(OBJECTS) $(MODULES) test-grid.o test-grid.mod util.mod util.o
66        mkdir -p $(BIN_PATH)
67        $(FC) $(FFLAGS) $(OBJECTS) $@.o -o $(BIN_PATH)/$@ $(INCLUDE) $(LIBRARY)
68        $(BIN_PATH)/$@
69
70# $(TESTS) expands to files of this pattern:
71test-%: $(OBJECTS) $(MODULES) test-%.o test-%.mod
72        mkdir -p $(BIN_PATH)
73        $(FC) $(FFLAGS) $(OBJECTS) $@.o -o $(BIN_PATH)/$@ $(INCLUDE) $(LIBRARY)
74        $(BIN_PATH)/$@
75
76%.o: %.mod
77
78util.o: util.f90
79        $(FC) $(FFLAGS) -c $< -o $@
80
81util.mod: util.f90
82        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o)
83
84test-%.o: test-%.f90
85        $(FC) $(FFLAGS) -c $< -o $@ $(INCLUDE)
86
87test-%.mod: test-%.f90
88        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) $(INCLUDE)
89
90clean:
91        rm -rf *.mod *.o
92        rm -rf $(BIN_PATH)/test-*
Note: See TracBrowser for help on using the repository browser.