-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
131 lines (126 loc) · 4.12 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#
# Top-level Makefile for emissions addition program
#
# Macros, these should be generic for all machines
#
#
# Created by Agustin on 08/11/12.
#
.IGNORE:
AR = ar ru
CD = cd
LN = ln -s
MAKE = make -i -f Makefile
RM = /bin/rm -f
RM_LIST = *.mod *.o *.f core .tmpfile suma_chem.exe ../suma_chem.exe
INTEL_LIB = /opt/intel/lib
# Targets for supported architectures
default:
uname -a > .tmpfile
grep CRAY .tmpfile ; \
if [ $$? = 0 ]; then echo "Compiling for CRAY" ; \
( $(CD) src ; $(MAKE) all \
"RM = $(RM)" "RM_LIST = $(RM_LIST)" \
"LN = $(LN)" "MACH = linux" \
"MAKE = $(MAKE)" "CPP = /opt/ctl/bin/cpp" \
"CPPFLAGS = -I. -C -P -DRECLENBYTE" \
"FC = f90" "FCFLAGS = -I. -f free" \
"LDOPTIONS = " "CFLAGS = " \
"LOCAL_LIBRARIES= " ) ; \
else \
grep OSF .tmpfile ; \
if [ $$? = 0 ]; then echo "Compiling for Compaq" ; \
( $(CD) src ; $(MAKE) all \
"RM = $(RM)" "RM_LIST = $(RM_LIST)" \
"LN = $(LN)" "MACH = DEC" \
"MAKE = $(MAKE)" "CPP = /usr/bin/cpp" \
"CPPFLAGS = -I. -C -P " \
"FC = f90" "FCFLAGS = -I. -free -convert big_endian -fpe" \
"LDOPTIONS = " "CFLAGS = " \
"LOCAL_LIBRARIES= " ) ; \
else \
grep IRIX .tmpfile ; \
if [ $$? = 0 ]; then echo "Compiling for SGI" ; \
( $(CD) src ; $(MAKE) all \
"RM = $(RM)" "RM_LIST = $(RM_LIST)" \
"LN = $(LN)" "MACH = linux" \
"MAKE = $(MAKE)" "CPP = /lib/cpp" \
"CPPFLAGS = -I. -C -P " \
"FC = f90" "FCFLAGS = -I. -n32 -freeform" \
"LDOPTIONS = -n32" "CFLAGS = -I. -n32" \
"LOCAL_LIBRARIES= " ) ; \
else \
grep HP .tmpfile ; \
if [ $$? = 0 ]; then echo "Compiling for HP" ; \
( $(CD) src ; $(MAKE) all \
"RM = $(RM)" "RM_LIST = $(RM_LIST)" \
"LN = $(LN)" "MACH = linux" \
"MAKE = $(MAKE)" "CPP = /opt/langtools/lbin/cpp" \
"CPPFLAGS= -I. -C -P -DRECLENBYTE" \
"FC = f90" "FCFLAGS = -I. -O +langlvl=90 +source=free" \
"LDOPTIONS = " "CFLAGS = -Aa" \
"LOCAL_LIBRARIES= " ) ; \
else \
grep SUN .tmpfile ; \
if [ $$? = 0 ]; then echo "Compiling for SUN" ; \
( $(CD) src ; $(MAKE) all \
"RM = $(RM)" "RM_LIST = $(RM_LIST)" \
"LN = $(LN)" "MACH = linux" \
"MAKE = $(MAKE)" "CPP = /usr/ccs/lib/cpp" \
"CPPFLAGS=-I. -C -P -DRECLENBYTE" \
"FC = f90" "FCFLAGS = -I. -free" \
"LDOPTIONS = " "CFLAGS = -I." \
"LOCAL_LIBRARIES= " ) ; \
else \
grep AIX .tmpfile ; \
if [ $$? = 0 ]; then echo "Compiling for IBM" ; \
( $(CD) src ; $(MAKE) all \
"RM = $(RM)" "RM_LIST = $(RM_LIST)" \
"LN = $(LN)" "MACH = linux" \
"MAKE = $(MAKE)" "CPP = /usr/lib/cpp" \
"CPPFLAGS = -I. -C -P -DRECLENBYTE" \
"FC = xlf" "FCFLAGS = -I. -O -qmaxmem=-1 -qfree=f90"\
"LDOPTIONS = " "CFLAGS = -I." \
"LOCAL_LIBRARIES= " ) ; \
else \
grep Linux .tmpfile ; \
if [ $$? = 0 ]; then echo "Compiling for Linux" ; \
( $(CD) src ; $(MAKE) all \
"RM = $(RM)" "RM_LIST = $(RM_LIST)" \
"LN = $(LN)" "MACH = DEC" \
"MAKE = $(MAKE)" "CPP = /lib/cpp" \
"CPPFLAGS = -I. -C -traditional" \
"FC = ifort -FR" "FCFLAGS = -I$(NETCDF)/include -I. -convert big_endian "\
"LDOPTIONS = -convert big_endian -L$(NETCDF)/lib -lnetcdff" "CFLAGS = -I." \
"LOCAL_LIBRARIES= -lnetcdff" ) ; \
else \
grep Darwin .tmpfile ; \
if [ $$? = 0 ]; then echo "Compiling for Darwin" ; \
( $(CD) src ; $(MAKE) all \
"RM = $(RM)" "RM_LIST = $(RM_LIST)" \
"LN = $(LN)" "MACH = DEC" \
"MAKE = $(MAKE)" "CPP = fpp" \
"CPPFLAGS = -I. -C " \
"FC = ifort" "FCFLAGS = -I. -I$(NETCDF)/include -convert big_endian -FR -align commons"\
"LDOPTIONS = -L$(NETCDF)/lib -convert big_endian -align commons "\
"CFLAGS = -I." \
"LOCAL_LIBRARIES= -lnetcdff " ) ; \
else echo "Do not know how to compile for the `cat .tmpfile` machine." \
fi ; \
fi ; \
fi ; \
fi ; \
fi ; \
fi ; \
fi ; \
fi ; \
fi ; \
( $(RM) suma_chem.exe ; $(LN) src/suma_chem.exe . ) ;
code:
( $(CD) src ; $(MAKE) code \
"MAKE = $(MAKE)" \
"CPP = /usr/bin/cpp" \
"CPPFLAGS = -I. -C -P -DDEC" )
clean:
( $(CD) src ; $(MAKE) clean "CD = $(CD)" "RM = $(RM)" "RM_LIST = $(RM_LIST)" )
$(RM) $(RM_LIST)