/[lmdze]/trunk/GNUmakefile
ViewVC logotype

Diff of /trunk/GNUmakefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 322 by guez, Thu Jan 24 16:17:39 2019 UTC revision 326 by guez, Mon Jun 10 00:29:10 2019 UTC
# Line 16  src_test_orbite = test_orbite.f orbite.f Line 16  src_test_orbite = test_orbite.f orbite.f
16    
17  sources := $(sort ${src_ce0l} ${src_gcm} ${src_test_ozonecm} ${src_test_inter_barxy} ${src_test_fxhyp} ${src_test_inifilr} ${src_test_orbite})  sources := $(sort ${src_ce0l} ${src_gcm} ${src_test_ozonecm} ${src_test_inter_barxy} ${src_test_fxhyp} ${src_test_inifilr} ${src_test_orbite})
18    
19  netcdf95_dir = ${HOME}/Compil_prod/NetCDF95_gfortran_debug  netcdf95_dir = ${HOME}/build/Libraries_debug/NetCDF95
20  nr_util_dir = ${HOME}/Compil_prod/NR_util_gfortran_debug  nr_util_dir = ${HOME}/build/Libraries_debug/NR_util
21  numer_rec_95_dir = ${HOME}/Compil_prod/Numer_Rec_95_gfortran_debug  numer_rec_95_dir = ${HOME}/build/Libraries_debug/Numer_Rec_95
22  jumble_dir = ${HOME}/Compil_prod/Jumble_gfortran_debug  jumble_dir = ${HOME}/build/Libraries_debug/Jumble
23    
24  include ${general_compiler_options_dir}/settings.mk  VPATH := ${makefile_dir}
25    
26    # 2. Compiler-dependent part
27    
28    mode = debug
29    
30    comma:= ,
31    empty:=
32    space:= $(empty) $(empty)
33    CPPFLAGS = $(addprefix -D, $(subst ${comma},${space},${cpp_macros}))
34    
35    inc_dir_list = ${HOME}/build/Libraries_debug/modules /usr/include
36    
37    lib_dir_list = ${contour_531_dir} ${fortrangis_dir} ${geometry_dir} ${gpc_f_dir} ${jumble_dir} ${netcdf95_dir} ${nr_util_dir} ${numer_rec_95_dir} ${shapelib_03_dir} ${water_dir} ${HOME}/.local/lib
38    
39    # Include flags:
40    FFLAGS := $(addprefix -I, ${inc_dir_list})
41    
42    # Fortran language options:
43    FFLAGS += -ffree-form -std=f2003
44    
45    # Error and warning options:
46    FFLAGS += -fmax-errors=1 -pedantic -Wall -Wcharacter-truncation -Wunused-parameter -Wno-conversion -Wno-integer-division
47    
48    # Debugging options:
49    FFLAGS += -fbacktrace -g -ffpe-trap=invalid,zero,overflow
50    
51    # Code generation options:
52    FFLAGS += -fcheck=bounds,do,mem,pointer,recursion -fpic -finit-real=nan
53    
54    # Optimization options:
55    FFLAGS += -O0
56    
57    LDLIBS = $(addprefix -L, ${lib_dir_list}) $(addprefix -l, ${lib_list})
58    version_flag = --version
59    
60    # 3. General rules
61    
62    SHELL = bash
63    
64    %: %.o
65            @echo "Linking $@..."
66            $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
67    
68    %.o: %.f
69            @echo "Building $@..."
70            $(COMPILE.f) $(OUTPUT_OPTION) $<
71    
72    %: %.f
73            @echo "Compiling and linking $@..."
74            $(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@
75    
76    LINK.o = $(FC) $(LDFLAGS) $(TARGET_ARCH)
77    .DELETE_ON_ERROR:
78    .PHONY: all clean clobber depend
79    all: log
80    
81    TAGS: ${sources}
82            ctags -e --language-force=fortran $^
83    
84    log:
85            hostname >$@
86            ${FC} ${version_flag} >>$@ 2>&1
87            @echo -e "\nFC = ${FC}\n\nCPPFLAGS = ${CPPFLAGS}\n\nFFLAGS = ${FFLAGS}\n\nLDLIBS = ${LDLIBS}\n\nLDFLAGS = ${LDFLAGS}\n\nldflags_lib_dyn = ${ldflags_lib_dyn}" >>$@
88    
89    clobber: clean
90            rm -f *.mod ${makefile_dir}/depend.mk TAGS
91    
92  VPATH += $(addprefix ${makefile_dir}/, $(shell cat ${makefile_dir}/directories))  VPATH += $(addprefix ${makefile_dir}/, $(shell cat ${makefile_dir}/directories))
93  cpp_macros = CPP_IIM=16,CPP_JJM=12,CPP_LLM=11  cpp_macros = CPP_IIM=16,CPP_JJM=12,CPP_LLM=11
94  lib_list = numer_rec_95 jumble nr_util netcdf95 netcdff  lib_list = numer_rec_95 jumble nr_util netcdf95 netcdff
95    
96  # 2. Objects and executable files  # 4. Objects and executable files
97    
98  obj_ce0l := $(addsuffix .o, $(basename ${src_ce0l}))  obj_ce0l := $(addsuffix .o, $(basename ${src_ce0l}))
99  obj_gcm := $(addsuffix .o, $(basename ${src_gcm}))  obj_gcm := $(addsuffix .o, $(basename ${src_gcm}))
# Line 39  obj_test_orbite := $(addsuffix .o, $(bas Line 105  obj_test_orbite := $(addsuffix .o, $(bas
105  objects := $(addsuffix .o, $(basename ${sources}))  objects := $(addsuffix .o, $(basename ${sources}))
106  execut = ce0l gcm test_ozonecm test_inter_barxy test_fxhyp test_inifilr test_orbite  execut = ce0l gcm test_ozonecm test_inter_barxy test_fxhyp test_inifilr test_orbite
107    
108  # 3. Rules  # 5. Specific rules
109    
110  all: ${execut} log  all: ${execut} log
111  ce0l: ${obj_ce0l}  ce0l: ${obj_ce0l}

Legend:
Removed from v.322  
changed lines
  Added in v.326

  ViewVC Help
Powered by ViewVC 1.1.21