[2696] | 1 | #------------------------------------------------------------------------------# |
---|
[2718] | 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 | # |
---|
[3785] | 16 | # Copyright 2017-2019 Leibniz Universitaet Hannover |
---|
| 17 | # Copyright 2017-2019 Deutscher Wetterdienst Offenbach |
---|
[2696] | 18 | #------------------------------------------------------------------------------# |
---|
| 19 | # |
---|
| 20 | # Current revisions: |
---|
| 21 | # ----------------- |
---|
| 22 | # |
---|
| 23 | # |
---|
| 24 | # Former revisions: |
---|
| 25 | # ----------------- |
---|
| 26 | # $Id: Makefile 3785 2019-03-06 10:41:14Z moh.hefny $ |
---|
[3785] | 27 | # Updated copyright note |
---|
| 28 | # |
---|
| 29 | # |
---|
| 30 | # 3716 2019-02-05 17:02:38Z eckhard |
---|
[3716] | 31 | # Added __netcdf preprocessor flag |
---|
| 32 | # |
---|
| 33 | # |
---|
| 34 | # 3447 2018-10-29 15:52:54Z eckhard |
---|
[3447] | 35 | # Renamed source files for compatibilty with PALM build system |
---|
| 36 | # |
---|
| 37 | # 3395 2018-10-22 17:32:49Z eckhard |
---|
[3395] | 38 | # Updated build order |
---|
| 39 | # |
---|
| 40 | # 3183 2018-07-27 14:25:55Z suehring |
---|
[3183] | 41 | # Added __netcdf4 preprocessor flag |
---|
| 42 | # |
---|
| 43 | # |
---|
| 44 | # 3182 2018-07-27 13:36:03Z suehring |
---|
[2696] | 45 | # Initial revision |
---|
| 46 | # |
---|
| 47 | # |
---|
| 48 | # |
---|
| 49 | # Authors: |
---|
| 50 | # -------- |
---|
| 51 | # @author Eckhard Kadasch |
---|
| 52 | # |
---|
| 53 | # Description: |
---|
| 54 | # ------------ |
---|
| 55 | # This makefile may be used to exclusively compile INIFOR. |
---|
| 56 | #------------------------------------------------------------------------------# |
---|
| 57 | PROJECT = inifor |
---|
| 58 | PROJECT_PATH = . |
---|
| 59 | BIN_PATH = $(PROJECT_PATH)/../../SCRIPTS |
---|
| 60 | SRC_PATH = $(PROJECT_PATH)/src |
---|
| 61 | TEST_PATH = $(PROJECT_PATH)/tests |
---|
| 62 | |
---|
[3447] | 63 | MODULES = $(SRC_PATH)/inifor_defs.mod $(SRC_PATH)/inifor_types.mod \ |
---|
| 64 | $(SRC_PATH)/inifor_util.mod $(SRC_PATH)/inifor_control.mod \ |
---|
| 65 | $(SRC_PATH)/inifor_transform.mod $(SRC_PATH)/inifor_io.mod \ |
---|
| 66 | $(SRC_PATH)/inifor_grid.mod |
---|
[2696] | 67 | SOURCES = $(MODULES:%.mod=%.f90) $(SRC_PATH)/$(PROJECT).f90 |
---|
| 68 | OBJECTS = $(SOURCES:%.f90=%.o) |
---|
| 69 | |
---|
| 70 | FC = gfortran |
---|
| 71 | WRNGS = -Wall -Wextra -Wsurprising -Waliasing -Wcharacter-truncation \ |
---|
| 72 | -Wline-truncation -fbacktrace -fcheck=all -pedantic \ |
---|
| 73 | -ffpe-trap=invalid,zero,underflow,overflow |
---|
[3716] | 74 | FFLAGS = -fdefault-real-8 -Og -g $(WRNGS) -cpp -D__netcdf4 -D__netcdf |
---|
[2696] | 75 | INCLUDE = -I/home/ekadasch/local/include |
---|
| 76 | LIBRARY = -L/home/ekadasch/local/lib64 -lnetcdff |
---|
| 77 | |
---|
| 78 | .PHONY: all clean doc run tags test test-verbose $(PROJECT) |
---|
| 79 | |
---|
| 80 | $(PROJECT): $(OBJECTS) $(MODULES) tags |
---|
| 81 | @echo "" |
---|
| 82 | mkdir -p $(BIN_PATH) |
---|
| 83 | $(FC) $(FFLAGS) $(OBJECTS) -o $(BIN_PATH)/$(PROJECT) -I$(SRC_PATH) $(LIBRARY) |
---|
| 84 | |
---|
| 85 | $(SRC_PATH)/%.o: $(SRC_PATH)/%.f90 |
---|
| 86 | @echo "" |
---|
| 87 | $(FC) $(FFLAGS) -c $< -o $@ -J$(SRC_PATH) $(INCLUDE) |
---|
| 88 | |
---|
| 89 | $(SRC_PATH)/%.mod: $(SRC_PATH)/%.f90 |
---|
| 90 | @echo "" |
---|
| 91 | $(FC) $(FFLAGS) -c $< -o $(@:%.mod=%.o) -J$(SRC_PATH) $(INCLUDE) |
---|
| 92 | |
---|
| 93 | all: clean $(PROJECT) test doc |
---|
| 94 | |
---|
| 95 | clean: |
---|
| 96 | @echo "" |
---|
| 97 | rm -rf $(OBJECTS) $(MODULES) $(BIN_PATH)/$(PROJECT) |
---|
| 98 | rm -rf *.mod *.o |
---|
| 99 | rm -rf ./doc/latex ./doc/html |
---|
| 100 | rm -f $(SRC_PATH)/tags |
---|
| 101 | rm -f *.files |
---|
| 102 | rm -f palm-hsurf.nc |
---|
| 103 | $(MAKE) -C $(TEST_PATH) clean |
---|
| 104 | $(MAKE) -C $(SRC_PATH) clean |
---|
| 105 | |
---|
| 106 | doc: |
---|
| 107 | @echo "" |
---|
| 108 | doxygen ./doc/doxygen.config |
---|
| 109 | |
---|
| 110 | run: $(PROJECT) |
---|
| 111 | @echo "" |
---|
| 112 | $(BIN_PATH)/$(PROJECT) |
---|
| 113 | |
---|
| 114 | tags: |
---|
| 115 | @echo "" |
---|
| 116 | $(MAKE) -C $(SRC_PATH) tags |
---|
| 117 | |
---|
| 118 | test: |
---|
| 119 | @echo "Running tests" |
---|
| 120 | $(MAKE) -C $(TEST_PATH) test | grep Test |
---|
| 121 | @echo "...done testing" |
---|
| 122 | |
---|
| 123 | test-verbose: |
---|
| 124 | @echo "Running tests" |
---|
| 125 | $(MAKE) -C $(TEST_PATH) test |
---|
| 126 | @echo "...done testing" |
---|