/[lmdze]/trunk/GNUmakefile
ViewVC logotype

Diff of /trunk/GNUmakefile

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

trunk/GNUmakefile revision 81 by guez, Wed Mar 5 14:38:41 2014 UTC trunk/Compilation/GNUmakefile revision 94 by guez, Tue Apr 1 17:27:47 2014 UTC
# Line 2  Line 2 
2    
3  # This makefile builds LMDZE.  # This makefile builds LMDZE.
4    
 # Suffixes are:  
 # "f90" for free format, no preprocessing  
 # "f" for fixed format, no preprocessing  
   
5  # 1. Source files  # 1. Source files
6    
7  src_root = .  compil_dir = .
8    
9  VPATH := ${src_root} $(addprefix ${src_root}/, $(shell cat ${src_root}/directories))  VPATH := ${compil_dir}/.. $(addprefix ${compil_dir}/../, $(shell cat ${compil_dir}/directories))
10    
11  common_sources := $(shell cat ${src_root}/common_sources)  common_sources := $(shell cat ${compil_dir}/common_sources)
12  src_ce0l_only := $(shell cat ${src_root}/src_ce0l_only)  src_ce0l_only := $(shell cat ${compil_dir}/src_ce0l_only)
13  src_gcm_only := $(shell cat ${src_root}/src_gcm_only)  src_gcm_only := $(shell cat ${compil_dir}/src_gcm_only)
14  sources = ${src_ce0l_only} ${src_gcm_only} ${common_sources}  sources = ${src_ce0l_only} ${src_gcm_only} ${common_sources}
15    
16  # 2. Objects and executable files  # 2. Objects and executable files
17    
18  obj_ce0l := $(addsuffix .o, $(sort $(basename ${common_sources} ${src_ce0l_only})))  obj_ce0l := $(sort ${common_sources:.f=.o} ${src_ce0l_only:.f=.o})
19    obj_gcm := $(sort ${common_sources:.f=.o} ${src_gcm_only:.f=.o})
20  obj_gcm := $(addsuffix .o, $(sort $(basename ${common_sources} ${src_gcm_only})))  objects := $(sources:.f=.o)
   
 objects := $(addsuffix .o, $(basename ${sources}))  
21  execut = ce0l gcm  execut = ce0l gcm
22    
23  # 3. Compiler-dependent part  # 3. Compiler-dependent part
# Line 34  include Compiler_options/${FC}_${mode}.m Line 28  include Compiler_options/${FC}_${mode}.m
28  # 4. Rules  # 4. Rules
29    
30  SHELL = bash  SHELL = bash
 COMPILE.f90 = $(FC) $(F90FLAGS) $(TARGET_ARCH) -c  
   
 %.o: %.f90  
         $(COMPILE.f90) $(OUTPUT_OPTION) $<  
   
31  .DELETE_ON_ERROR:  .DELETE_ON_ERROR:
32  .PHONY: all clean clobber depend  .PHONY: all clean clobber depend
33  all: ${execut} log  all: ${execut} log
# Line 49  ${execut}: Line 38  ${execut}:
38  ce0l: ${obj_ce0l}  ce0l: ${obj_ce0l}
39  gcm: ${obj_gcm}  gcm: ${obj_gcm}
40    
41  depend ${src_root}/depend.mk:  depend ${compil_dir}/depend.mk:
42          makedepf90 -Wmissing -Wconfused $(addprefix -I, ${VPATH}) -nosrc $(addprefix -u , netcdf numer_rec_95 netcdf95 nr_util jumble) ${sources} >${src_root}/depend.mk          makedepf90 -free -Wmissing -Wconfused $(addprefix -I, ${VPATH}) -nosrc $(addprefix -u , netcdf numer_rec_95 netcdf95 nr_util jumble) ${sources} >${compil_dir}/depend.mk
43    
44  ${src_root}/TAGS: ${sources}  TAGS: ${sources}
45          ctags -e --language-force=fortran -f $@ $^          ctags -e --language-force=fortran $^
46    
47  clean:  clean:
48          rm -f ${execut} ${objects} log          rm -f ${execut} ${objects} log
49    
50  clobber: clean  clobber: clean
51          rm -f *.mod ${src_root}/depend.mk ${src_root}/TAGS          rm -f *.mod ${compil_dir}/depend.mk TAGS ${compil_dir}/TAGS
52    
53  log:  log:
54          hostname >$@          hostname >$@
55          ${FC} ${version_flag} >>$@ 2>&1          ${FC} ${version_flag} >>$@ 2>&1
56          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}" >>$@
57    
58  ifneq ($(MAKECMDGOALS), clobber)  ifeq ($(findstring $(MAKECMDGOALS), clobber depend),)
59  include ${src_root}/depend.mk  include ${compil_dir}/depend.mk
60  endif  endif
61    
62  -include grep.mk  -include grep.mk

Legend:
Removed from v.81  
changed lines
  Added in v.94

  ViewVC Help
Powered by ViewVC 1.1.21