/[lmdze]/trunk/GNUmakefile
ViewVC logotype

Annotation of /trunk/GNUmakefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (hide annotations)
Wed Mar 5 14:57:53 2014 UTC (10 years, 2 months ago) by guez
File size: 1595 byte(s)
Changed all ".f90" suffixes to ".f".
1 guez 69 # This is a makefile for GNU make.
2 guez 3
3 guez 61 # This makefile builds LMDZE.
4    
5 guez 62 # 1. Source files
6    
7 guez 61 src_root = .
8 guez 3
9 guez 78 VPATH := ${src_root} $(addprefix ${src_root}/, $(shell cat ${src_root}/directories))
10 guez 3
11 guez 70 common_sources := $(shell cat ${src_root}/common_sources)
12 guez 79 src_ce0l_only := $(shell cat ${src_root}/src_ce0l_only)
13     src_gcm_only := $(shell cat ${src_root}/src_gcm_only)
14     sources = ${src_ce0l_only} ${src_gcm_only} ${common_sources}
15 guez 3
16 guez 79 # 2. Objects and executable files
17 guez 71
18 guez 79 obj_ce0l := $(addsuffix .o, $(sort $(basename ${common_sources} ${src_ce0l_only})))
19 guez 71
20 guez 79 obj_gcm := $(addsuffix .o, $(sort $(basename ${common_sources} ${src_gcm_only})))
21 guez 3
22 guez 79 objects := $(addsuffix .o, $(basename ${sources}))
23     execut = ce0l gcm
24 guez 62
25 guez 69 # 3. Compiler-dependent part
26 guez 70
27 guez 69 mode = debug
28 guez 81 include Compiler_options/${FC}_${mode}.mk
29 guez 3
30 guez 62 # 4. Rules
31    
32 guez 69 SHELL = bash
33 guez 78 .DELETE_ON_ERROR:
34 guez 69 .PHONY: all clean clobber depend
35 guez 79 all: ${execut} log
36    
37     ${execut}:
38     $(FC) $(LDFLAGS) $^ $(LDLIBS) -o $@
39    
40 guez 70 ce0l: ${obj_ce0l}
41 guez 3 gcm: ${obj_gcm}
42    
43 guez 61 depend ${src_root}/depend.mk:
44 guez 82 makedepf90 -free -Wmissing -Wconfused $(addprefix -I, ${VPATH}) -nosrc $(addprefix -u , netcdf numer_rec_95 netcdf95 nr_util jumble) ${sources} >${src_root}/depend.mk
45 guez 61
46 guez 79 ${src_root}/TAGS: ${sources}
47 guez 78 ctags -e --language-force=fortran -f $@ $^
48 guez 3
49     clean:
50 guez 79 rm -f ${execut} ${objects} log
51 guez 3
52     clobber: clean
53 guez 62 rm -f *.mod ${src_root}/depend.mk ${src_root}/TAGS
54 guez 3
55 guez 79 log:
56     hostname >$@
57     ${FC} ${version_flag} >>$@ 2>&1
58 guez 69 echo -e "\nFC = ${FC}\n\nFFLAGS = ${FFLAGS}\n\nLDLIBS = ${LDLIBS}\n\nLDFLAGS = ${LDFLAGS}" >>$@
59 guez 62
60 guez 78 ifneq ($(MAKECMDGOALS), clobber)
61 guez 61 include ${src_root}/depend.mk
62 guez 78 endif
63 guez 3
64     -include grep.mk
65 guez 7 -include nag_rules.mk

  ViewVC Help
Powered by ViewVC 1.1.21