source: palm/trunk/UTIL/inifor/tests/Makefile @ 3615

Last change on this file since 3615 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.7 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 2718 2018-01-02 08:49:38Z raasch $
27# Initial revision
28#
29#
30#
31# Authors:
32# --------
33# @author Eckhard Kadasch
34#
35# Description:
36# ------------
37# This makefile is called from INIFOR's main makefile to compile and run tests.
38#------------------------------------------------------------------------------!
39PROJECT = inifor
40PROJECT_PATH = ..
41BIN_PATH = $(PROJECT_PATH)/bin
42SRC_PATH = $(PROJECT_PATH)/src
43TESTS    = $(patsubst %.f90,%,$(wildcard test-*.f90))
44
45MODULES = 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
46SOURCES = $(MODULES:%.mod=%.f90)
47OBJECTS = $(SOURCES:%.f90=%.o)
48
49FC      = gfortran
50FFLAGS  = -g -Wall -fdefault-real-8 \
51                  -ffpe-trap=invalid,zero,underflow,overflow
52INCLUDE = -I$(SRC_PATH)
53LIBRARY = -L/home/ekadasch/local/lib64 -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.