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

Last change on this file since 3737 was 3618, checked in by eckhard, 6 years ago

inifor: Prefixed all INIFOR modules with inifor_ and removed unused variables

  • 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-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 3618 2018-12-10 13:25:22Z suehring $
27# Prefixed INIFOR modules with inifor_
28#
29#
30# 2718 2018-01-02 08:49:38Z maronga
31# Initial revision
32#
33#
34#
35# Authors:
36# --------
37# @author Eckhard Kadasch
38#
39# Description:
40# ------------
41# This file serves as a templete makefile for compiling INIFOR tests with
42# gfortran.
43#------------------------------------------------------------------------------!
44PROJECT = inifor
45PROJECT_PATH = ..
46BIN_PATH = $(PROJECT_PATH)/bin
47SRC_PATH = $(PROJECT_PATH)/src
48TESTS    = $(patsubst %.f90,%,$(wildcard test-*.f90))
49
50MODULES = 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
51SOURCES = $(MODULES:%.mod=%.f90)
52OBJECTS = $(SOURCES:%.f90=%.o)
53
54FC      = gfortran
55FFLAGS  = -g -Wall -fdefault-real-8 \
56                  -ffpe-trap=invalid,zero,underflow,overflow
57INCLUDE = -I/home/ekadasch/local/include -I$(SRC_PATH)
58LIBRARY = -L/home/ekadasch/local/lib64 -lnetcdff -lutil
59                 
60.PHONY: clean test $(PROJECT)
61
62test: information $(PROJECT) $(TESTS)
63
64information:
65        @echo $(TESTS)
66
67$(PROJECT):
68        $(MAKE) -C $(PROJECT_PATH) $(PROJECT)
69
70test-grid: $(OBJECTS) $(MODULES) test-grid.o test-grid.mod util.mod util.o
71        mkdir -p $(BIN_PATH)
72        $(FC) $(FFLAGS) $(OBJECTS) $@.o -o $(BIN_PATH)/$@ -I$(SRC_PATH) $(LIBRARY)
73        $(BIN_PATH)/$@
74
75# $(TESTS) expands to files of this pattern:
76test-%: $(OBJECTS) $(MODULES) test-%.o test-%.mod
77        mkdir -p $(BIN_PATH)
78        $(FC) $(FFLAGS) $(OBJECTS) $@.o -o $(BIN_PATH)/$@ -I$(SRC_PATH) $(LIBRARY)
79        $(BIN_PATH)/$@
80
81%.o: %.mod
82
83util.o: util.f90
84        $(FC) $(FFLAGS) -c $< -o $@
85
86util.mod: util.f90
87        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o)
88
89test-%.o: test-%.f90
90        $(FC) $(FFLAGS) -c $< -o $@ $(INCLUDE)
91
92test-%.mod: test-%.f90
93        $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) $(INCLUDE)
94
95clean:
96        rm -rf *.mod *.o
97        rm -rf $(BIN_PATH)/test-*
Note: See TracBrowser for help on using the repository browser.