/[lmdze]/trunk/GNUmakefile
ViewVC logotype

Diff of /trunk/GNUmakefile

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

revision 76 by guez, Fri Nov 15 18:45:49 2013 UTC revision 79 by guez, Fri Feb 28 17:52:47 2014 UTC
# Line 10  Line 10 
10    
11  src_root = .  src_root = .
12    
13  VPATH = ${src_root}:${src_root}/dyn3d:${src_root}/dyn3d/Vlsplt:${src_root}/filtrez:${src_root}/phylmd:${src_root}/bibio:${src_root}/phylmd/Mobidic:${src_root}/phylmd/Orography:${src_root}/phylmd/Radlwsw:${src_root}/IOIPSL:${src_root}/IOIPSL/Stringop:${src_root}/dyn3d/Read_reanalyse:${src_root}/phylmd/Thermcell:${src_root}/phylmd/CV3_routines:${src_root}/phylmd/Conflx:${src_root}/phylmd/CV_routines:${src_root}/phylmd/Interface_surf:${src_root}/dyn3d/Dissipation:${src_root}/IOIPSL/Histcom  VPATH := ${src_root} $(addprefix ${src_root}/, $(shell cat ${src_root}/directories))
14    
15  common_sources := $(shell cat ${src_root}/common_sources)  common_sources := $(shell cat ${src_root}/common_sources)
16    src_ce0l_only := $(shell cat ${src_root}/src_ce0l_only)
17    src_gcm_only := $(shell cat ${src_root}/src_gcm_only)
18    sources = ${src_ce0l_only} ${src_gcm_only} ${common_sources}
19    
20  sources_ce0l := $(sort ${common_sources} $(shell cat ${src_root}/sources_ce0l_only))  # 2. Objects and executable files
   
 sources_gcm := $(sort ${common_sources} $(shell cat ${src_root}/sources_gcm_only))  
21    
22  sources := $(sort ${sources_ce0l} ${sources_gcm})  obj_ce0l := $(addsuffix .o, $(sort $(basename ${common_sources} ${src_ce0l_only})))
23    
24  # 2. Objects and executable files  obj_gcm := $(addsuffix .o, $(sort $(basename ${common_sources} ${src_gcm_only})))
25    
 # Object files:  
 obj_ce0l := $(addsuffix .o, $(basename ${sources_ce0l}))  
 obj_gcm := $(addsuffix .o, $(basename ${sources_gcm}))  
26  objects := $(addsuffix .o, $(basename ${sources}))  objects := $(addsuffix .o, $(basename ${sources}))
   
 # Executable files:  
27  execut = ce0l gcm  execut = ce0l gcm
28    
29  # 3. Compiler-dependent part  # 3. Compiler-dependent part
30    
31  mode = debug  mode = debug
32  include ../Compilers/${FC}_${mode}.mk  include Compilers/${FC}_${mode}.mk
33    
34  # 4. Rules  # 4. Rules
35    
36  SHELL = bash  SHELL = bash
   
 # Extend known suffixes:  
   
37  COMPILE.f90 = $(FC) $(F90FLAGS) $(TARGET_ARCH) -c  COMPILE.f90 = $(FC) $(F90FLAGS) $(TARGET_ARCH) -c
38    
39  %.o: %.f90  %.o: %.f90
40          $(COMPILE.f90) $(OUTPUT_OPTION) $<          $(COMPILE.f90) $(OUTPUT_OPTION) $<
41    
42    .DELETE_ON_ERROR:
43  .PHONY: all clean clobber depend  .PHONY: all clean clobber depend
44    all: ${execut} log
 all: ${execut} trace  
45    
46  ${execut}:  ${execut}:
47          $(FC) $(LDFLAGS) $^ $(LDLIBS) -o $@          $(FC) $(LDFLAGS) $^ $(LDLIBS) -o $@
# Line 57  ce0l: ${obj_ce0l} Line 50  ce0l: ${obj_ce0l}
50  gcm: ${obj_gcm}  gcm: ${obj_gcm}
51    
52  depend ${src_root}/depend.mk:  depend ${src_root}/depend.mk:
53          makedepf90 -Wmissing -Wconfused -I${VPATH} -nosrc $(addprefix -u, netcdf numer_rec_95 netcdf95 nr_util jumble) ${sources} >${src_root}/depend.mk          makedepf90 -Wmissing -Wconfused $(addprefix -I, ${VPATH}) -nosrc $(addprefix -u , netcdf numer_rec_95 netcdf95 nr_util jumble) ${sources} >${src_root}/depend.mk
54    
55  TAGS: ${sources}  ${src_root}/TAGS: ${sources}
56          ctags -e --language-force=fortran $^          ctags -e --language-force=fortran -f $@ $^
57    
58  clean:  clean:
59          rm -f ${objects}          rm -f ${execut} ${objects} log
         rm -f ${execut} trace  
60    
61  clobber: clean  clobber: clean
62          rm -f *.mod ${src_root}/depend.mk ${src_root}/TAGS          rm -f *.mod ${src_root}/depend.mk ${src_root}/TAGS
63    
64  trace:  log:
65          ${FC} ${version_flag} >$@ 2>&1          hostname >$@
66            ${FC} ${version_flag} >>$@ 2>&1
67          echo -e "\nFC = ${FC}\n\nFFLAGS = ${FFLAGS}\n\nLDLIBS = ${LDLIBS}\n\nLDFLAGS = ${LDFLAGS}" >>$@          echo -e "\nFC = ${FC}\n\nFFLAGS = ${FFLAGS}\n\nLDLIBS = ${LDLIBS}\n\nLDFLAGS = ${LDFLAGS}" >>$@
68    
69  # Dependencies among object files:  ifneq ($(MAKECMDGOALS), clobber)
70  include ${src_root}/depend.mk  include ${src_root}/depend.mk
71    endif
72    
 # Other rules, optionally:  
73  -include grep.mk  -include grep.mk
74  -include nag_rules.mk  -include nag_rules.mk

Legend:
Removed from v.76  
changed lines
  Added in v.79

  ViewVC Help
Powered by ViewVC 1.1.21