Debian Codegraph @

exodus/Makefile.standalone

raw
1 # Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
2 # DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
3 # retains certain rights in this software.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are
7 # met:
8 #
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 #
12 # * Redistributions in binary form must reproduce the above
13 # copyright notice, this list of conditions and the following
14 # disclaimer in the documentation and/or other materials provided
15 # with the distribution.
16 #
17 # * Neither the name of Sandia Corporation nor the names of its
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #
33
34 #========================================================================
35 # A platform must define:
36 #
37 # CC == the C compiler
38 # FC == the Fortran compiler
39 # CCOPTIONS == non-optimization related flags for C compiling on this platform
40 # F77OPTIONS == non-optimization related flags for Fortran compiling on this platform
41 # RANLIB == ranlib or 'true' if no ranlib
42 # AR == command to build an archive library.
43 #
44 #========================================================================
45
46 SYSTEM := $(shell uname)
47
48 # Set this to yes if your netcdf is compiled with the netcdf4 extensions
49 # which require linking with hdf5. It is assumed that the netcdf and hdf5
50 # library and include paths are the same.
51
52 #========================================================================
53 # Netcdf
54 #========================================================================
55 USING_NETCDF4 = "YES"
56
57 NETCDF = /Users/gdsjaar/src/SEACAS
58 NETCDF_INC = -I$(NETCDF)/include
59 NETCDF_LIB = -L$(NETCDF)/lib -lnetcdf
60 NCDUMP = ${NETCDF}/bin/ncdump
61
62 ifeq ($(USING_NETCDF4), "YES")
63 LDFLAGS = -L$(NETCDF)/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz
64 else
65 NETCDF_YES_NO = -DNOT_NETCDF4
66 LDFLAGS = -L$(NETCDF)/lib -lnetcdf
67 endif
68
69 #========================================================================
70 # Darwin (Apple OSX)
71 #========================================================================
72 ifeq ($(SYSTEM),Darwin)
73 RANLIB = ranlib
74
75 AR = ar -crsv
76 CC = /opt/local/bin/gcc-mp-4.8
77 FC = /opt/local/bin/gfortran-mp-4.8
78 CCOPTIONS = -DADDC_
79 F77OPTIONS =
80 F77PREC = -fdefault-real-8 -fdefault-integer-8
81 endif
82 #========================================================================
83
84 #========================================================================
85 # Linux
86 #========================================================================
87 ifeq ($(SYSTEM),Linux)
88
89 # Default Compiler:
90 COMPILER = GNU
91
92 RANLIB = ranlib
93
94 AR = ar -rcv
95
96 ifeq ($(COMPILER),Portland)
97 CC = pgcc
98 FC = pgf77
99 CCOPTIONS = -Mframe -DADDC_
100 F77OPTIONS = -fast
101 F77PREC = -r8 -i8
102 endif
103
104 ifeq ($(COMPILER),Intel)
105 CC = icc
106 FC = ifort
107 CCOPTIONS = -Xc -DADDC_
108 F77PREC = -r8 -i8
109 endif
110
111 ifeq ($(COMPILER),GNU)
112 CC = gcc
113 FC = gfortran
114 CCOPTIONS = -O2 -Wall -DADDC_
115 F77OPTIONS = -O2
116 F77PREC = -fdefault-real-8 -fdefault-integer-8
117 endif
118
119 endif
120
121
122 OPTIMIZE_FLAG = -O2
123 STD_DEFINES = -DVERBOSE
124
125
126 CFLAGS = $(OPTIMIZE_FLAG) $(CCOPTIONS) $(STD_DEFINES) $(LOC_EXOII_INC) $(NETCDF_INC) $(NETCDF_YES_NO)
127 FFLAGS = $(OPTIMIZE_FLAG) $(F77OPTIONS) $(LOC_EXOII_INC)
128
129 # Use include files locates in exodusii/cbind/include
130 LOC_EXOII_INC = -I../../cbind/include -I../../forbind/include
131
132
133
134 SUBDIRS = cbind/src forbind/src cbind/test forbind/test
135
136 all:: libexodus.a libexoIIv2for.a libexoIIv2for32.a
137
138 libexodus.a::
139 echo "making exodus in cbind/src"
140 (cd cbind/src && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "RANLIB=$(RANLIB)" libexodus.a)
141 cp cbind/src/libexodus.a .
142 $(RANLIB) libexodus.a
143
144 libexoIIv2for.a::
145 echo "making exoIIv2for in forbind/src"
146 (cd forbind/src && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "FC=$(FC)" "FFLAGS=$(FFLAGS)" "RANLIB=$(RANLIB)" "SYSTEM=$(SYSTEM)" libexoIIv2for.a)
147 cp forbind/src/libexoIIv2for.a .
148 $(RANLIB) libexoIIv2for.a
149
150 libexoIIv2for32.a::
151 echo "making exoIIv2for32 in forbind/src"
152 (cd forbind/src && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "FC=$(FC)" "FFLAGS=$(FFLAGS)" "RANLIB=$(RANLIB)" "SYSTEM=$(SYSTEM)" libexoIIv2for32.a)
153 cp forbind/src/libexoIIv2for32.a .
154 $(RANLIB) libexoIIv2for32.a
155
156 check: test
157 test:: libexodus.a libexoIIv2for.a
158
159 test::
160 echo "making test in cbind/test"
161 (cd cbind/test && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" "RANLIB=$(RANLIB)" "NCDUMP=$(NCDUMP)" all)
162
163 test::
164 echo "making test in forbind/test"
165 (cd forbind/test && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "FC=$(FC)" "FFLAGS=$(FFLAGS)" "LDFLAGS=$(LDFLAGS)" "RANLIB=$(RANLIB)" "NCDUMP=$(NCDUMP)" all)
166
167 clean::
168 @for flag in $(MAKEFLAGS) ''; do \
169 case "$$flag" in *=*) ;; *[ik]*) set +e;; esac; done; \
170 for i in $(SUBDIRS) ;\
171 do \
172 if test -d $$i; then \
173 echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
174 (cd $$i && $(MAKE) -f Makefile.standalone $(MFLAGS) clean); \
175 fi; \
176 done
177