/[lmdze]/trunk/GNUmakefile
ViewVC logotype

Annotation of /trunk/GNUmakefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 81 - (hide annotations)
Wed Mar 5 14:38:41 2014 UTC (10 years, 2 months ago) by guez
File size: 1788 byte(s)
 Converted to free source form files which were still in fixed source
form. The conversion was done using the polish mode of the NAG Fortran
Compiler.

In addition to converting to free source form, the processing of the
files also:

-- indented the code (including comments);

-- set Fortran keywords to uppercase, and set all other identifiers
to lower case;

-- added qualifiers to end statements (for example "end subroutine
conflx", instead of "end");

-- changed the terminating statements of all DO loops so that each
loop ends with an ENDDO statement (instead of a labeled continue).

1 guez 69 # This is a makefile for GNU make.
2 guez 3
3 guez 61 # This makefile builds LMDZE.
4    
5 guez 3 # Suffixes are:
6     # "f90" for free format, no preprocessing
7     # "f" for fixed format, no preprocessing
8    
9 guez 62 # 1. Source files
10    
11 guez 61 src_root = .
12 guez 3
13 guez 78 VPATH := ${src_root} $(addprefix ${src_root}/, $(shell cat ${src_root}/directories))
14 guez 3
15 guez 70 common_sources := $(shell cat ${src_root}/common_sources)
16 guez 79 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 guez 3
20 guez 79 # 2. Objects and executable files
21 guez 71
22 guez 79 obj_ce0l := $(addsuffix .o, $(sort $(basename ${common_sources} ${src_ce0l_only})))
23 guez 71
24 guez 79 obj_gcm := $(addsuffix .o, $(sort $(basename ${common_sources} ${src_gcm_only})))
25 guez 3
26 guez 79 objects := $(addsuffix .o, $(basename ${sources}))
27     execut = ce0l gcm
28 guez 62
29 guez 69 # 3. Compiler-dependent part
30 guez 70
31 guez 69 mode = debug
32 guez 81 include Compiler_options/${FC}_${mode}.mk
33 guez 3
34 guez 62 # 4. Rules
35    
36 guez 69 SHELL = bash
37 guez 61 COMPILE.f90 = $(FC) $(F90FLAGS) $(TARGET_ARCH) -c
38 guez 73
39 guez 61 %.o: %.f90
40     $(COMPILE.f90) $(OUTPUT_OPTION) $<
41    
42 guez 78 .DELETE_ON_ERROR:
43 guez 69 .PHONY: all clean clobber depend
44 guez 79 all: ${execut} log
45    
46     ${execut}:
47     $(FC) $(LDFLAGS) $^ $(LDLIBS) -o $@
48    
49 guez 70 ce0l: ${obj_ce0l}
50 guez 3 gcm: ${obj_gcm}
51    
52 guez 61 depend ${src_root}/depend.mk:
53 guez 79 makedepf90 -Wmissing -Wconfused $(addprefix -I, ${VPATH}) -nosrc $(addprefix -u , netcdf numer_rec_95 netcdf95 nr_util jumble) ${sources} >${src_root}/depend.mk
54 guez 61
55 guez 79 ${src_root}/TAGS: ${sources}
56 guez 78 ctags -e --language-force=fortran -f $@ $^
57 guez 3
58     clean:
59 guez 79 rm -f ${execut} ${objects} log
60 guez 3
61     clobber: clean
62 guez 62 rm -f *.mod ${src_root}/depend.mk ${src_root}/TAGS
63 guez 3
64 guez 79 log:
65     hostname >$@
66     ${FC} ${version_flag} >>$@ 2>&1
67 guez 69 echo -e "\nFC = ${FC}\n\nFFLAGS = ${FFLAGS}\n\nLDLIBS = ${LDLIBS}\n\nLDFLAGS = ${LDFLAGS}" >>$@
68 guez 62
69 guez 78 ifneq ($(MAKECMDGOALS), clobber)
70 guez 61 include ${src_root}/depend.mk
71 guez 78 endif
72 guez 3
73     -include grep.mk
74 guez 7 -include nag_rules.mk

  ViewVC Help
Powered by ViewVC 1.1.21