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