| 1 | #  -*- makefile -*-
 | 
|---|
| 2 | # #########################  Sophya ############################# 
 | 
|---|
| 3 | # ##### LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA #####
 | 
|---|
| 4 | # ############################################################### 
 | 
|---|
| 5 | # General setup GNU Makefile for Sopyha/Planck. To be included in all makefiles.  
 | 
|---|
| 6 | # Define  makefile variables according to CPU 
 | 
|---|
| 7 | # MACHEROSD = `uname | sed 's/-//'`   i.e. { AIX HPUX OSF1 Linux ... }
 | 
|---|
| 8 | # and compilers {g++, cxx, KCC, xlC, aCC, ...}
 | 
|---|
| 9 | # 
 | 
|---|
| 10 | # Makefile variables set are:
 | 
|---|
| 11 | # - Path to Exec, Include, Libs, Obj directories (from DPCDEVREP env. var.)
 | 
|---|
| 12 | #     i.e. variables LIB, OBJ, EXE, INC 
 | 
|---|
| 13 | #---------------------------------------------------------------------------
 | 
|---|
| 14 | 
 | 
|---|
| 15 | # define MACHEROS from uname
 | 
|---|
| 16 | MACHEROS := $(shell echo `uname`)
 | 
|---|
| 17 | # define the -D option
 | 
|---|
| 18 | MACHEROSD := $(shell echo `uname | sed 's/-//'`)
 | 
|---|
| 19 | # Le sous-repertoire des objets specifique machine-compilo
 | 
|---|
| 20 | #   OSF1 : Alpha avec gcc
 | 
|---|
| 21 | #   OSF1-cxx : Alpha avec cxx
 | 
|---|
| 22 | 
 | 
|---|
| 23 | #### C++
 | 
|---|
| 24 | ifdef EROSCXX
 | 
|---|
| 25 |   CXX := $(EROSCXX)
 | 
|---|
| 26 | endif
 | 
|---|
| 27 | 
 | 
|---|
| 28 | ifeq ($(CXX),gcc)
 | 
|---|
| 29 |   override CXX := g++
 | 
|---|
| 30 | endif
 | 
|---|
| 31 | 
 | 
|---|
| 32 | ifeq ($(EROSCXX),egcs++)
 | 
|---|
| 33 |   # en fait de compilo de egcs++ s'appelle g++ !
 | 
|---|
| 34 |   # comme il faut bien differentier ln -s /usr/bin/g++ /usr/bin/egcs++
 | 
|---|
| 35 |   override CXX := egcs++
 | 
|---|
| 36 | endif
 | 
|---|
| 37 | 
 | 
|---|
| 38 | ifeq ($(CC),xlC)
 | 
|---|
| 39 |   override CXX := xlC
 | 
|---|
| 40 | endif
 | 
|---|
| 41 | 
 | 
|---|
| 42 | #### C
 | 
|---|
| 43 | ifeq ($(CXX), xlC)
 | 
|---|
| 44 |   override CC := xlC
 | 
|---|
| 45 | endif
 | 
|---|
| 46 | 
 | 
|---|
| 47 | ifeq ($(CXX), g++)
 | 
|---|
| 48 |   CC := gcc
 | 
|---|
| 49 | endif
 | 
|---|
| 50 | 
 | 
|---|
| 51 | ifeq ($(EROSCXX), egcs++)
 | 
|---|
| 52 |   CC := egcs
 | 
|---|
| 53 | endif
 | 
|---|
| 54 | 
 | 
|---|
| 55 | #### Fortran (tout ce qui est lie au Fortran est defini ici #############
 | 
|---|
| 56 | FC = f77
 | 
|---|
| 57 | ifeq (${MACHEROS},Linux)
 | 
|---|
| 58 | #  override FC := f77
 | 
|---|
| 59 |   override FC := g77
 | 
|---|
| 60 | endif
 | 
|---|
| 61 | 
 | 
|---|
| 62 | ifeq (${MACHEROS},OSF1)
 | 
|---|
| 63 |   LIBFORT = -lfor -lFutil -lots -lUfor
 | 
|---|
| 64 | endif
 | 
|---|
| 65 | ifeq (${MACHEROS},Linux)
 | 
|---|
| 66 |   #LIBFORT = -lf2c
 | 
|---|
| 67 |   LIBFORT = -lg2c
 | 
|---|
| 68 | endif
 | 
|---|
| 69 | #########################################################################
 | 
|---|
| 70 | 
 | 
|---|
| 71 | 
 | 
|---|
| 72 | MACHDIR := $(MACHEROS)-$(CXX)
 | 
|---|
| 73 | 
 | 
|---|
| 74 | 
 | 
|---|
| 75 | #-
 | 
|---|
| 76 | #-   Define Makefile paths
 | 
|---|
| 77 | #-  (NE PAS TOUCHER CES LIGNES: generation automatique de MakefileUser.h)
 | 
|---|
| 78 | #-  
 | 
|---|
| 79 | PP  := ${DPCDEVREP}/${MACHDIR}/
 | 
|---|
| 80 | LIB := ${PP}/Libs/
 | 
|---|
| 81 | SLB := ${PP}/ShLibs/
 | 
|---|
| 82 | OBJ := ${PP}/Objs/
 | 
|---|
| 83 | EXE := ${PP}/Exec/
 | 
|---|
| 84 | INC := ${DPCDEVREP}/Include/
 | 
|---|
| 85 | GLB := /usr/local/lib/
 | 
|---|
| 86 | #--
 | 
|---|
| 87 | 
 | 
|---|
| 88 | #  Si Makefile.h utilise pour la construction d'autres librairies
 | 
|---|
| 89 | ifdef MYBUILDDEVREP
 | 
|---|
| 90 |   MYPP := ${MYBUILDDEVREP}/${MACHDIR}/
 | 
|---|
| 91 |   MYLIB := ${MYPP}/Libs/
 | 
|---|
| 92 |   MYSLB := ${MYPP}/ShLibs/
 | 
|---|
| 93 |   OBJ := ${MYPP}/Objs/
 | 
|---|
| 94 |   EXE := ${MYPP}/Exec/  
 | 
|---|
| 95 | endif
 | 
|---|
| 96 | 
 | 
|---|
| 97 | #-   Flag for optimisation/ debug
 | 
|---|
| 98 | # Pour forcer sans debug, DBGFLAG = -g0
 | 
|---|
| 99 | ifndef OPTFLAG
 | 
|---|
| 100 |   OPTFLAG  := -O
 | 
|---|
| 101 | endif
 | 
|---|
| 102 | 
 | 
|---|
| 103 | ifndef DBGFLAG
 | 
|---|
| 104 |   DBGFLAG  := -g
 | 
|---|
| 105 | #  Probleme sur DEC/OSF1 -g avec g++/egcs pose probleme a l'assembleur
 | 
|---|
| 106 | #                    Reza 09/99 - On met -gcoff
 | 
|---|
| 107 |   ifeq (${MACHEROS},OSF1)
 | 
|---|
| 108 |     ifeq ($(CXX), g++)
 | 
|---|
| 109 |       override DBGFLAG := -gcoff
 | 
|---|
| 110 |     endif
 | 
|---|
| 111 |   endif
 | 
|---|
| 112 | endif
 | 
|---|
| 113 | 
 | 
|---|
| 114 | # DBGFLAG a -g0 veut dire pas de debug. Tout le monde a ca par defaut...
 | 
|---|
| 115 | ifeq ($(DBGFLAG), -g0)
 | 
|---|
| 116 |   override DBGFLAG :=
 | 
|---|
| 117 | endif
 | 
|---|
| 118 | 
 | 
|---|
| 119 | # xlC ne connait pas -O0, par defaut il n'optimise pas.
 | 
|---|
| 120 | ifeq ($(OPTFLAG), -O0)
 | 
|---|
| 121 |   ifeq ($(CC), xlC)
 | 
|---|
| 122 |     override OPTFLAG :=
 | 
|---|
| 123 |   endif
 | 
|---|
| 124 | endif
 | 
|---|
| 125 | 
 | 
|---|
| 126 | AR       := ar
 | 
|---|
| 127 | ARFLAGS  := -rcs
 | 
|---|
| 128 | ARARGS   := ?
 | 
|---|
| 129 | 
 | 
|---|
| 130 | # le gnu ar ne fonctionne pas bien sur OSF...
 | 
|---|
| 131 | ifeq (${MACHEROS},OSF1)
 | 
|---|
| 132 | AR       := /usr/bin/ar
 | 
|---|
| 133 | endif
 | 
|---|
| 134 | # et sur AIX il nous sort des tas de warnings inutiles
 | 
|---|
| 135 | ifeq ($(MACHEROS),AIX)
 | 
|---|
| 136 | AR := /usr/bin/ar
 | 
|---|
| 137 | endif
 | 
|---|
| 138 | 
 | 
|---|
| 139 | ifeq ($(MACHEROS),Darwin)
 | 
|---|
| 140 | AR := libtool
 | 
|---|
| 141 | ARFLAGS := -static -o
 | 
|---|
| 142 | ARARGS := ^
 | 
|---|
| 143 | EROSCXX := g++
 | 
|---|
| 144 | CXX := g++
 | 
|---|
| 145 | CC := cc
 | 
|---|
| 146 | endif
 | 
|---|
| 147 | 
 | 
|---|
| 148 | #   Avec certains compilateurs C++ (KCC, aCC) , il faut fabriquer les librairies et 
 | 
|---|
| 149 | # les shared libs avec la meme commande 
 | 
|---|
| 150 | override ARCXX := $(AR) 
 | 
|---|
| 151 | override ARCXXFLAGS := $(ARFLAGS) 
 | 
|---|
| 152 | #RZ0999 ifeq ($(CXX),KCC)
 | 
|---|
| 153 | #RZ0999 override  ARCXX  := KCC
 | 
|---|
| 154 | #RZ0999 override ARCXXFLAGS  := -o
 | 
|---|
| 155 | #RZ0999 endif
 | 
|---|
| 156 | ifeq ($(CXX),aCC)
 | 
|---|
| 157 | override ARCXX  := aCC 
 | 
|---|
| 158 | override ARCXXFLAGS  := -o
 | 
|---|
| 159 | endif
 | 
|---|
| 160 | 
 | 
|---|
| 161 | # Les chemins speciaux pour includes systemes et bibliotheques
 | 
|---|
| 162 | ifeq (${MACHEROS},HP-UX)
 | 
|---|
| 163 |   XLDLIBS := -L.
 | 
|---|
| 164 |   XCFLAGS := -I.
 | 
|---|
| 165 | endif
 | 
|---|
| 166 | 
 | 
|---|
| 167 | 
 | 
|---|
| 168 | #  Pour compiler PI, sous Linux, les includes et libs se trouve souvent ds /usr/X11/include /usr/X11/lib/
 | 
|---|
| 169 | ifeq (${MACHEROS},Linux)
 | 
|---|
| 170 |   XLDLIBS := -L/usr/X11/lib -L/usr/X11R6/lib
 | 
|---|
| 171 |   XCFLAGS := -I/usr/X11/include -I/usr/X11R6/include
 | 
|---|
| 172 |   LDLIBS := -ldl
 | 
|---|
| 173 | endif
 | 
|---|
| 174 | 
 | 
|---|
| 175 | ifeq (${MACHEROS},Darwin)
 | 
|---|
| 176 |   XLDLIBS := -L/usr/X11R6/lib -L/sw/lib -ldl
 | 
|---|
| 177 |   XCFLAGS := -I/usr/X11R6/include -I/sw/include -fno-coalesce -fkeep-inline-functions -fno-common
 | 
|---|
| 178 | endif
 | 
|---|
| 179 | 
 | 
|---|
| 180 | # Chemin pour les include et fichiers d'autres librairies
 | 
|---|
| 181 | EXTINCPI := 
 | 
|---|
| 182 | EXTLIBPL := 
 | 
|---|
| 183 | EXTSLBPL := 
 | 
|---|
| 184 | EXTINCPATH := 
 | 
|---|
| 185 | EXTLIBPATH := 
 | 
|---|
| 186 | EXTSLBPATH := 
 | 
|---|
| 187 | 
 | 
|---|
| 188 | ifdef EXTLIBDIR
 | 
|---|
| 189 |  EXTINCPI := -I$(EXTLIBDIR)/Include/
 | 
|---|
| 190 |  EXTLIBPL := -L$(EXTLIBDIR)/$(MACHDIR)/Libs/
 | 
|---|
| 191 |  EXTSLBPL := -L$(EXTLIBDIR)/$(MACHDIR)/ShLibs/
 | 
|---|
| 192 |  EXTINCPATH := $(EXTLIBDIR)/Include/
 | 
|---|
| 193 |  EXTLIBPATH := $(EXTLIBDIR)/$(MACHDIR)/Libs/
 | 
|---|
| 194 |  EXTSLBPATH := $(EXTLIBDIR)/$(MACHDIR)/ShLibs/
 | 
|---|
| 195 | endif
 | 
|---|
| 196 | 
 | 
|---|
| 197 | #  S'il y a des flags particulier pour un module de compilation
 | 
|---|
| 198 | #ifndef MODULECPPFLAGS
 | 
|---|
| 199 |   override MODULECPPFLAGS :=
 | 
|---|
| 200 | #endif
 | 
|---|
| 201 | 
 | 
|---|
| 202 | CPPFLAGS     :=  -I${INC} $(EXTINCPI) -D${MACHEROSD} $(MODULECPPFLAGS)
 | 
|---|
| 203 | 
 | 
|---|
| 204 | #  Si la variable d'environnement SOPHYA_DEBUG est definie : Activation des 
 | 
|---|
| 205 | #  compilations conditionnelles pour le debug/bound-checking/... ds le code
 | 
|---|
| 206 | ifdef SOPHYA_DEBUG 
 | 
|---|
| 207 |   CPPFLAGS   := $(CPPFLAGS) -DSOPHYA_DEBUG
 | 
|---|
| 208 | endif
 | 
|---|
| 209 | 
 | 
|---|
| 210 | # Les options selon les divers compilateurs
 | 
|---|
| 211 | # GNU
 | 
|---|
| 212 | ifeq ($(CC), gcc)
 | 
|---|
| 213 |   CFLAGS       := -Wall -Wpointer-arith \
 | 
|---|
| 214 |                   -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
 | 
|---|
| 215 |                   $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 216 |   LDLIBS       := $(LDLIBS) $(XLDLIBS)
 | 
|---|
| 217 | endif
 | 
|---|
| 218 | ifeq ($(CC), egcs)
 | 
|---|
| 219 |   CFLAGS       := -Wall -Wpointer-arith \
 | 
|---|
| 220 |                   -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
 | 
|---|
| 221 |                   $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 222 |   LDLIBS       := $(LDLIBS) $(XLDLIBS)
 | 
|---|
| 223 | endif
 | 
|---|
| 224 | 
 | 
|---|
| 225 | ifeq ($(CXX), g++)
 | 
|---|
| 226 |   CXXFLAGS       := -Wall -Wpointer-arith \
 | 
|---|
| 227 |                     -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
 | 
|---|
| 228 |                     $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
 | 
|---|
| 229 |   LDLIBS      := $(LDLIBS) $(XLDLIBS)
 | 
|---|
| 230 | #  ifdef NOSHLIB 
 | 
|---|
| 231 | #    LDFLAGS := -static
 | 
|---|
| 232 | #  endif
 | 
|---|
| 233 | endif
 | 
|---|
| 234 | ifeq ($(CXX), egcs++)
 | 
|---|
| 235 |   CXXFLAGS       := -Wall -Wpointer-arith \
 | 
|---|
| 236 |                     -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
 | 
|---|
| 237 |                     $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
 | 
|---|
| 238 |   LDLIBS      := $(LDLIBS) $(XLDLIBS)
 | 
|---|
| 239 |   ifdef NOSHLIB 
 | 
|---|
| 240 |     LDFLAGS := -static
 | 
|---|
| 241 |   endif
 | 
|---|
| 242 | endif
 | 
|---|
| 243 | 
 | 
|---|
| 244 | # Compilateur natif (GNU-gcc) sous MacOSX (Darwin)
 | 
|---|
| 245 | ifeq (${MACHEROS},Darwin)
 | 
|---|
| 246 |   CFLAGS       := -Wall -Wpointer-arith \
 | 
|---|
| 247 |                   -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
 | 
|---|
| 248 |                   $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 249 |   LDLIBS       := $(LDLIBS) $(XLDLIBS)
 | 
|---|
| 250 | endif
 | 
|---|
| 251 | 
 | 
|---|
| 252 | # Compilateur C natif HP-UX
 | 
|---|
| 253 | ifeq (${MACHEROS},HP-UX)
 | 
|---|
| 254 | ifeq ($(CC),cc)                                    
 | 
|---|
| 255 |   CFLAGS       :=  +Z -Aa -Ae $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
 | 
|---|
| 256 |   FFLAGS       :=  -Aa -I${INC}   -D${MACHEROSD}  
 | 
|---|
| 257 |   CPPFLAGS     :=  -I${INC}  -I$(INC)/tnt -D${MACHEROSD} \
 | 
|---|
| 258 |                -D_HPUX_SOURCE $(MODULECPPFLAGS)
 | 
|---|
| 259 |   LDLIBS      := $(XLDLIBS)
 | 
|---|
| 260 |   override NOSHLIB := Y
 | 
|---|
| 261 | 
 | 
|---|
| 262 | endif
 | 
|---|
| 263 | ifeq ($(CXX),aCC)
 | 
|---|
| 264 |   CXXFLAGS := $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) +Z -D__aCC__
 | 
|---|
| 265 | #  -DCOMPILER_EXCEPTIONS -D__ANSI_TEMPLATES__  definis ds defs.h
 | 
|---|
| 266 | endif
 | 
|---|
| 267 | endif
 | 
|---|
| 268 | 
 | 
|---|
| 269 | # AIX, xlC comme compilateur C et C++
 | 
|---|
| 270 | ifeq ($(CXX), xlC)
 | 
|---|
| 271 |   CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) $(XCFLAGS)
 | 
|---|
| 272 |   CPPFLAGS := -I$(INC)/Syst -I${INC}  -I$(INC)/tnt -D${MACHEROSD} $(MODULECPPFLAGS)
 | 
|---|
| 273 |   CXXFLAGS     := $(CFLAGS) -D__xlC 
 | 
|---|
| 274 | # -DCOMPILER_EXCEPTIONS defini ds defs.h
 | 
|---|
| 275 |   LDLIBS      := $(XLDLIBS)
 | 
|---|
| 276 | 
 | 
|---|
| 277 | # Pour faire des bibliotheques partagees, il faut faire un truc du
 | 
|---|
| 278 | # style 
 | 
|---|
| 279 | #ld -o shrsub.o subs1.o subs2.o -bE:shrsub.exp -bM:SRE -lc
 | 
|---|
| 280 | 
 | 
|---|
| 281 | # Pour le moment on ne se fatigue pas, tant pis
 | 
|---|
| 282 |   override NOSHLIB := Y
 | 
|---|
| 283 | 
 | 
|---|
| 284 | # Et puis 1540-293: (W) est un FAUX warning, on supprime les warnings
 | 
|---|
| 285 |   CXXFLAGS := -qflag=e $(CXXFLAGS)
 | 
|---|
| 286 | endif
 | 
|---|
| 287 | 
 | 
|---|
| 288 | 
 | 
|---|
| 289 | ifeq ($(CXX), cxx)
 | 
|---|
| 290 |   ifeq ($(DBGFLAG), -g)
 | 
|---|
| 291 |     ifdef OPTFLAG
 | 
|---|
| 292 |       override DBGFLAG := -g1
 | 
|---|
| 293 |     endif
 | 
|---|
| 294 | #    ifdef XOPT
 | 
|---|
| 295 | #      override DBGFLAG := -g1
 | 
|---|
| 296 | #    endif
 | 
|---|
| 297 |   endif
 | 
|---|
| 298 | 
 | 
|---|
| 299 | # chemin pour repository CXX
 | 
|---|
| 300 |  REP := $(OBJ)/cxxrep/
 | 
|---|
| 301 |  REPPI := $(OBJ)/cxxrep_PI/
 | 
|---|
| 302 |  REPCXX := -ptr $(OBJ)/cxxrep/
 | 
|---|
| 303 |  ifdef MODULECXXREPNAME
 | 
|---|
| 304 |    REPCXX := -ptr $(OBJ)/cxxrep_$(MODULECXXREPNAME)/  -ptr $(OBJ)/cxxrep/
 | 
|---|
| 305 |    REPM := $(OBJ)/cxxrep_$(MODULECXXREPNAME)/
 | 
|---|
| 306 |  endif
 | 
|---|
| 307 | 
 | 
|---|
| 308 |   LDLIBS      := $(XLDLIBS) -lrt
 | 
|---|
| 309 | 
 | 
|---|
| 310 |   CXXFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)   \
 | 
|---|
| 311 |               $(REPCXX) -no_implicit_include 
 | 
|---|
| 312 | # $(REPCXX) -no_implicit_include -D__USE_STD_IOSTREAM  passe pas avec cxx 6.0 Reza 23/12/99
 | 
|---|
| 313 |   CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 314 | #  CXXFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)  \
 | 
|---|
| 315 | #             -nopt -define_templates
 | 
|---|
| 316 |   ifeq ($(XOPT), 1)
 | 
|---|
| 317 |     override DBGFLAG :=
 | 
|---|
| 318 |     CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \
 | 
|---|
| 319 |                 $(REPCXX) -fp_reorder \
 | 
|---|
| 320 |                 -O5 -inline speed -tune host
 | 
|---|
| 321 |   endif
 | 
|---|
| 322 |   ifeq ($(XOPT), 2)
 | 
|---|
| 323 |     override DBGFLAG :=
 | 
|---|
| 324 |     CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \
 | 
|---|
| 325 |               $(REPCXX) -fp_reorder \
 | 
|---|
| 326 |               -O5 -inline speed -tune host \
 | 
|---|
| 327 |               -assume trusted_short_alignment
 | 
|---|
| 328 |   endif
 | 
|---|
| 329 |   ifeq ($(XOPT), 3)
 | 
|---|
| 330 |     override DBGFLAG :=
 | 
|---|
| 331 |     CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \
 | 
|---|
| 332 |               $(REPCXX) -fp_reorder \
 | 
|---|
| 333 |               -O5 -inline speed -tune host \
 | 
|---|
| 334 |               -assume trusted_short_alignment \
 | 
|---|
| 335 |               -non_shared -om
 | 
|---|
| 336 |     override NOSHLIB := Y
 | 
|---|
| 337 |   endif
 | 
|---|
| 338 | 
 | 
|---|
| 339 | # le fichier X11/Xlib.h contient des declarations de fonctions sans type
 | 
|---|
| 340 | # Cela genere un grand nombre de warning avec cxx V6
 | 
|---|
| 341 | # La variable MODULEDECCXXFLAGS permet de specifier des options de compilation 
 | 
|---|
| 342 | # pour un module donne  
 | 
|---|
| 343 |   ifdef MODULEDECCXXFLAGS
 | 
|---|
| 344 |     CXXFLAGS := $(CXXFLAGS) $(MODULEDECCXXFLAGS)
 | 
|---|
| 345 |   endif
 | 
|---|
| 346 | endif
 | 
|---|
| 347 | ifeq ($(CC),cc)
 | 
|---|
| 348 |   ifeq ($(MACHEROS),OSF1)
 | 
|---|
| 349 |   ifeq ($(XOPT), 1)
 | 
|---|
| 350 |     CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \
 | 
|---|
| 351 |               -O4 -inline speed -tune host
 | 
|---|
| 352 |   endif
 | 
|---|
| 353 |   ifeq ($(XOPT), 2)
 | 
|---|
| 354 |     CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \
 | 
|---|
| 355 |               -O4 -inline speed -tune host \
 | 
|---|
| 356 |               -assume trusted_short_alignment -fast
 | 
|---|
| 357 |   endif
 | 
|---|
| 358 |   ifeq ($(XOPT), 3)
 | 
|---|
| 359 |     CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \
 | 
|---|
| 360 |               -O4 -inline speed -tune host \
 | 
|---|
| 361 |               -assume trusted_short_alignment -fast \
 | 
|---|
| 362 |               -non_shared -om
 | 
|---|
| 363 |   endif
 | 
|---|
| 364 |   endif
 | 
|---|
| 365 | endif
 | 
|---|
| 366 | 
 | 
|---|
| 367 | # --- Compilateur KAI  (OK pour v 3.3)
 | 
|---|
| 368 | ifeq ($(CXX), KCC)
 | 
|---|
| 369 |   CXXFLAGS     :=  --exceptions --rtti  --auto_instantiation --one_instantiation_per_object -D__KCC__
 | 
|---|
| 370 |   CXXFLAGS  := $(CXXFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 371 |   CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 372 | # Flag --one_instantiation_per_object mis - Reza 02/03/99
 | 
|---|
| 373 | endif
 | 
|---|
| 374 | 
 | 
|---|
| 375 | # --- Systeme IRIX64 de Silixon Graphics (SGI) 
 | 
|---|
| 376 | ifeq ($(MACHEROS), IRIX64)
 | 
|---|
| 377 | # --- Compilateur natif CC de SGI 
 | 
|---|
| 378 |   ifeq ($(CXX), CC)
 | 
|---|
| 379 |     CFLAGS  := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
 | 
|---|
| 380 |     CXXFLAGS := -prelink -D__SGICC__ $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 381 |     LINK.cc := CC $(CPPFLAGS) -D__SGICC__ $(DBGFLAG) $(OPTFLAG)
 | 
|---|
| 382 | #  sur SGI, les libs/executables ont deux formats 32 et 64 bits (trois avec o32)
 | 
|---|
| 383 | #  -n32 Generates a (new) 32-bit object default to -mips3 if -mips4 has not been specified
 | 
|---|
| 384 | #  -64 Generates a 64-bit object - defaults to -mips4 if -mips3 has not been specified
 | 
|---|
| 385 | #  La variable d'environnement SOPHYA_SGI64 controle cette option
 | 
|---|
| 386 |     ifdef SOPHYA_SGI64
 | 
|---|
| 387 |       CFLAGS  := -64 -DSGI_ARCH64 $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
 | 
|---|
| 388 |       CXXFLAGS := -64 -prelink -DSGI_ARCH64 -D__SGICC__ $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 389 |       LINK.cc := CC -64 $(CPPFLAGS) -D__SGICC__ $(DBGFLAG) $(OPTFLAG)
 | 
|---|
| 390 |     endif
 | 
|---|
| 391 |   endif
 | 
|---|
| 392 |   ifeq ($(CXX), g++)
 | 
|---|
| 393 |     ifdef SOPHYA_SGI64
 | 
|---|
| 394 |       CFLAGS  := $(CFLAGS) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64
 | 
|---|
| 395 |       CXXFLAGS := $(CXXFLAGS) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64
 | 
|---|
| 396 |       LINK.cc := $(LINK.cc) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64
 | 
|---|
| 397 |     endif
 | 
|---|
| 398 |   endif
 | 
|---|
| 399 | endif
 | 
|---|
| 400 | 
 | 
|---|
| 401 | # Autres compilateurs natifs.
 | 
|---|
| 402 | 
 | 
|---|
| 403 | #  CFLAGS       :=  -I$(INC) $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
 | 
|---|
| 404 | #  CXXFLAGS     := $(CFLAGS)
 | 
|---|
| 405 | #  LDLIBS      := $(XLDLIBS)
 | 
|---|
| 406 | 
 | 
|---|
| 407 | #- redefine implicit rule. Les .o sont dans $(OBJ).
 | 
|---|
| 408 | $(OBJ)%.o:%.c
 | 
|---|
| 409 |         $(COMPILE.c) -o $@ $<
 | 
|---|
| 410 | 
 | 
|---|
| 411 | $(OBJ)%.o:%.cc
 | 
|---|
| 412 |         $(COMPILE.cc) -o $@ $<
 | 
|---|
| 413 | 
 | 
|---|
| 414 | $(OBJ)%.o:%.f
 | 
|---|
| 415 |         $(COMPILE.f) -o $@ $< 
 | 
|---|
| 416 | 
 | 
|---|
| 417 | #OSF1
 | 
|---|
| 418 | #LDFC est f77
 | 
|---|
| 419 | #LDFCFLAGS est rien
 | 
|---|
| 420 | 
 | 
|---|
| 421 | #parfois
 | 
|---|
| 422 | #LDFC est cc
 | 
|---|
| 423 | #LDFCFLAGS est -ltruc
 | 
|---|
| 424 | 
 | 
|---|
| 425 | #------------------------------------------------- End of Makefile.h ------- 
 | 
|---|