source: palm/trunk/UTIL/inifor/tests/Makefile.gnu @ 3570

Last change on this file since 3570 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.gnu 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# gfortran.
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      = gfortran
51FFLAGS  = -g -Wall -fdefault-real-8 \
52                  -ffpe-trap=invalid,zero,underflow,overflow
53INCLUDE = -I/home/ekadasch/local/include -I$(SRC_PATH)
54LIBRARY = -L/home/ekadasch/local/lib64 -lnetcdff -lutil
55                 
56.PHONY: clean test $(PROJECT)
57
58test: information $(PROJECT) $(TESTS)
59
60information:
61        @echo $(TESTS)
62
63$(PROJECT):
64        $(MAKE) -C $(PROJECT_PATH) $(PROJECT)
65
66test-grid: $(OBJECTS) $(MODULES) test-grid.o test-grid.mod util.mod util.o
67        mkdir -p $(BIN_PATH)
68        $(FC) $(FFLAGS) $(OBJECTS) $@.o -o $(BIN_PATH)/$@ -I$(SRC_PATH) $(LIBRARY)
69        $(BIN_PATH)/$@
70
71# $(TESTS) expands to files of this pattern:
72test-%: $(OBJECTS) $(MODULES) test-%.o test-%.mod
73        mkdir -p $(BIN_PATH)
74        $(FC) $(FFLAGS) $(OBJECTS) $@.o -o $(BIN_PATH)/$@ -I$(SRC_PATH) $(LIBRARY)
75        $(BIN_PATH)/$@
76
77%.o: %.mod
78
79util.o: util.f90
80        $(FC) $(FFLAGS) -c $< -o $@
81
82util.mod: util.f90
83        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o)
84
85test-%.o: test-%.f90
86        $(FC) $(FFLAGS) -c $< -o $@ $(INCLUDE)
87
88test-%.mod: test-%.f90
89        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) $(INCLUDE)
90
91clean:
92        rm -rf *.mod *.o
93        rm -rf $(BIN_PATH)/test-*
Note: See TracBrowser for help on using the repository browser.