| 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 SOPHYADEVREP 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 SOPHYACXX | 
|---|
| 25 | CXX := $(SOPHYACXX) | 
|---|
| 26 | endif | 
|---|
| 27 |  | 
|---|
| 28 | ifeq ($(CXX),gcc) | 
|---|
| 29 | override CXX := g++ | 
|---|
| 30 | endif | 
|---|
| 31 |  | 
|---|
| 32 | ifeq ($(SOPHYACXX),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 ($(SOPHYACXX), 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  := ${SOPHYABASEREP}/${MACHDIR}/ | 
|---|
| 80 | PPH := ${HOME}/${MACHDIR}/ | 
|---|
| 81 | LIB := ${PP}/Libs/ | 
|---|
| 82 | SLB := ${PP}/ShLibs/ | 
|---|
| 83 | OBJ := ${PPH}/Objs/ | 
|---|
| 84 | EXE := ${PPH}/Exec/ | 
|---|
| 85 | INC := ${SOPHYABASEREP}/Include/ | 
|---|
| 86 | GLB := /usr/local/lib/ | 
|---|
| 87 | #-- | 
|---|
| 88 |  | 
|---|
| 89 | #  Si Makefile.h utilise pour la construction d'autres librairies | 
|---|
| 90 | ifdef MYBUILDDEVREP | 
|---|
| 91 | MYPP := ${MYBUILDDEVREP}/${MACHDIR}/ | 
|---|
| 92 | MYLIB := ${MYPP}/Libs/ | 
|---|
| 93 | MYSLB := ${MYPP}/ShLibs/ | 
|---|
| 94 | OBJ := ${MYPP}/Objs/ | 
|---|
| 95 | EXE := ${MYPP}/Exec/ | 
|---|
| 96 | endif | 
|---|
| 97 |  | 
|---|
| 98 | #-   Flag for optimisation/ debug | 
|---|
| 99 | # Pour forcer sans debug, DBGFLAG = -g0 | 
|---|
| 100 | ifndef OPTFLAG | 
|---|
| 101 | OPTFLAG  := -O | 
|---|
| 102 | ifeq (${MACHEROS},OSF1) | 
|---|
| 103 | ifeq ($(CXX), cxx) | 
|---|
| 104 | override OPTFLAG := -O -pthread | 
|---|
| 105 | endif | 
|---|
| 106 | endif | 
|---|
| 107 | endif | 
|---|
| 108 |  | 
|---|
| 109 | ifndef DBGFLAG | 
|---|
| 110 | DBGFLAG  := -g | 
|---|
| 111 | #  Probleme sur DEC/OSF1 -g avec g++/egcs pose probleme a l'assembleur | 
|---|
| 112 | #                    Reza 09/99 - On met -gcoff | 
|---|
| 113 | ifeq (${MACHEROS},OSF1) | 
|---|
| 114 | ifeq ($(CXX), g++) | 
|---|
| 115 | override DBGFLAG := -gcoff | 
|---|
| 116 | endif | 
|---|
| 117 | endif | 
|---|
| 118 | endif | 
|---|
| 119 |  | 
|---|
| 120 | # DBGFLAG a -g0 veut dire pas de debug. Tout le monde a ca par defaut... | 
|---|
| 121 | ifeq ($(DBGFLAG), -g0) | 
|---|
| 122 | override DBGFLAG := | 
|---|
| 123 | endif | 
|---|
| 124 |  | 
|---|
| 125 | # xlC ne connait pas -O0, par defaut il n'optimise pas. | 
|---|
| 126 | ifeq ($(OPTFLAG), -O0) | 
|---|
| 127 | ifeq ($(CC), xlC) | 
|---|
| 128 | override OPTFLAG := | 
|---|
| 129 | endif | 
|---|
| 130 | endif | 
|---|
| 131 |  | 
|---|
| 132 | AR       := ar | 
|---|
| 133 | ARFLAGS  := -rcs | 
|---|
| 134 | ARARGS   := ? | 
|---|
| 135 |  | 
|---|
| 136 | # le gnu ar ne fonctionne pas bien sur OSF... | 
|---|
| 137 | ifeq (${MACHEROS},OSF1) | 
|---|
| 138 | AR       := /usr/bin/ar | 
|---|
| 139 | endif | 
|---|
| 140 | # et sur AIX il nous sort des tas de warnings inutiles | 
|---|
| 141 | ifeq ($(MACHEROS),AIX) | 
|---|
| 142 | AR := /usr/bin/ar | 
|---|
| 143 | endif | 
|---|
| 144 |  | 
|---|
| 145 | ifeq ($(MACHEROS),Darwin) | 
|---|
| 146 | AR := libtool | 
|---|
| 147 | ARFLAGS := -static -o | 
|---|
| 148 | ARARGS := ^ | 
|---|
| 149 | SOPHYACXX := c++ | 
|---|
| 150 | CXX := c++ | 
|---|
| 151 | CC := cc | 
|---|
| 152 | # Pour enlever les erreurs au link des slb en -O. Pas d'avenir! | 
|---|
| 153 | # Reza:Mai 2005 : On tente les flags -fast -mcpu=7450 ET -fPIC | 
|---|
| 154 | # OPTFLAG := -g -fast -mcpu=7450 -fPIC | 
|---|
| 155 | # Apple dit qu'il faut mettre -fastf pour le c++ : Ca marche avec GCC 3.3 ! | 
|---|
| 156 | # OPTFLAG := -g | 
|---|
| 157 | OPTFLAG := -g -fastf -mtune=G4 -fPIC | 
|---|
| 158 | endif | 
|---|
| 159 |  | 
|---|
| 160 | #   Avec certains compilateurs C++ (KCC, aCC) , il faut fabriquer les librairies et | 
|---|
| 161 | # les shared libs avec la meme commande | 
|---|
| 162 | override ARCXX := $(AR) | 
|---|
| 163 | override ARCXXFLAGS := $(ARFLAGS) | 
|---|
| 164 | #RZ0999 ifeq ($(CXX),KCC) | 
|---|
| 165 | #RZ0999 override  ARCXX  := KCC | 
|---|
| 166 | #RZ0999 override ARCXXFLAGS  := -o | 
|---|
| 167 | #RZ0999 endif | 
|---|
| 168 | ifeq ($(CXX),aCC) | 
|---|
| 169 | override ARCXX  := aCC | 
|---|
| 170 | override ARCXXFLAGS  := -o | 
|---|
| 171 | endif | 
|---|
| 172 |  | 
|---|
| 173 | # Les chemins speciaux pour includes systemes et bibliotheques | 
|---|
| 174 | ifeq (${MACHEROS},HP-UX) | 
|---|
| 175 | XLDLIBS := -L. | 
|---|
| 176 | XCFLAGS := | 
|---|
| 177 | XCPPFLAGS := | 
|---|
| 178 | endif | 
|---|
| 179 |  | 
|---|
| 180 |  | 
|---|
| 181 | #  Pour compiler PI, sous Linux, les includes et libs se trouve souvent ds /usr/X11/include /usr/X11/lib/ | 
|---|
| 182 | ifeq (${MACHEROS},Linux) | 
|---|
| 183 | XLDLIBS := -L/usr/X11/lib -L/usr/X11R6/lib | 
|---|
| 184 | XCPPFLAGS := -I/usr/X11/include -I/usr/X11R6/include | 
|---|
| 185 | LDLIBS := -ldl | 
|---|
| 186 | endif | 
|---|
| 187 |  | 
|---|
| 188 | ifeq (${MACHEROS},Darwin) | 
|---|
| 189 | XLDLIBS := -L/usr/X11R6/lib | 
|---|
| 190 | XCPPFLAGS := -I/usr/X11R6/include -I/sw/include | 
|---|
| 191 | #  XCPPFLAGS := -I/usr/X11R6/include | 
|---|
| 192 | #  XCFLAGS := -fkeep-inline-functions -fno-common -fcoalesce | 
|---|
| 193 | XCFLAGS := -fno-common | 
|---|
| 194 | endif | 
|---|
| 195 |  | 
|---|
| 196 | # Chemin pour les include et fichiers d'autres librairies | 
|---|
| 197 | EXTINCPI := | 
|---|
| 198 | EXTLIBPL := | 
|---|
| 199 | EXTSLBPL := | 
|---|
| 200 | EXTINCPATH := | 
|---|
| 201 | EXTLIBPATH := | 
|---|
| 202 | EXTSLBPATH := | 
|---|
| 203 |  | 
|---|
| 204 | ifdef EXTLIBDIR | 
|---|
| 205 | EXTINCPI := -I$(EXTLIBDIR)/Include/ | 
|---|
| 206 | EXTLIBPL := -L$(EXTLIBDIR)/$(MACHDIR)/Libs/ | 
|---|
| 207 | EXTSLBPL := -L$(EXTLIBDIR)/$(MACHDIR)/ShLibs/ | 
|---|
| 208 | EXTINCPATH := $(EXTLIBDIR)/Include/ | 
|---|
| 209 | EXTLIBPATH := $(EXTLIBDIR)/$(MACHDIR)/Libs/ | 
|---|
| 210 | EXTSLBPATH := $(EXTLIBDIR)/$(MACHDIR)/ShLibs/ | 
|---|
| 211 | endif | 
|---|
| 212 |  | 
|---|
| 213 | #  S'il y a des flags particulier pour un module de compilation | 
|---|
| 214 | #ifndef MODULECPPFLAGS | 
|---|
| 215 | override MODULECPPFLAGS := | 
|---|
| 216 | #endif | 
|---|
| 217 |  | 
|---|
| 218 | CPPFLAGS     :=  -I${INC} $(EXTINCPI) $(XCPPFLAGS) -D${MACHEROSD} $(MODULECPPFLAGS) | 
|---|
| 219 |  | 
|---|
| 220 | #  Si la variable d'environnement SOPHYA_DEBUG est definie : Activation des | 
|---|
| 221 | #  compilations conditionnelles pour le debug/bound-checking/... ds le code | 
|---|
| 222 | ifdef SOPHYA_DEBUG | 
|---|
| 223 | CPPFLAGS   := $(CPPFLAGS) -DSOPHYA_DEBUG | 
|---|
| 224 | endif | 
|---|
| 225 |  | 
|---|
| 226 | # Les options selon les divers compilateurs | 
|---|
| 227 | # GNU | 
|---|
| 228 | ifeq ($(CC), gcc) | 
|---|
| 229 | CFLAGS       := -Wall -Wpointer-arith \ | 
|---|
| 230 | -Wmissing-prototypes -I$(INC) $(XCFLAGS) \ | 
|---|
| 231 | $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 232 | LDLIBS       := $(LDLIBS) $(XLDLIBS) | 
|---|
| 233 | endif | 
|---|
| 234 | ifeq ($(CC), egcs) | 
|---|
| 235 | CFLAGS       := -Wall -Wpointer-arith \ | 
|---|
| 236 | -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \ | 
|---|
| 237 | $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 238 | LDLIBS       := $(LDLIBS) $(XLDLIBS) | 
|---|
| 239 | endif | 
|---|
| 240 |  | 
|---|
| 241 | ifeq ($(CXX), g++) | 
|---|
| 242 | CXXFLAGS       := -Wall -Wpointer-arith \ | 
|---|
| 243 | -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \ | 
|---|
| 244 | $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 245 | LDLIBS      := $(LDLIBS) $(XLDLIBS) | 
|---|
| 246 | #  ifdef NOSHLIB | 
|---|
| 247 | #    LDFLAGS := -static | 
|---|
| 248 | #  endif | 
|---|
| 249 | endif | 
|---|
| 250 | ifeq ($(CXX), egcs++) | 
|---|
| 251 | CXXFLAGS       := -Wall -Wpointer-arith \ | 
|---|
| 252 | -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \ | 
|---|
| 253 | $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 254 | LDLIBS      := $(LDLIBS) $(XLDLIBS) | 
|---|
| 255 | ifdef NOSHLIB | 
|---|
| 256 | LDFLAGS := -static | 
|---|
| 257 | endif | 
|---|
| 258 | endif | 
|---|
| 259 |  | 
|---|
| 260 | # Compilateur natif (GNU-gcc) sous MacOSX (Darwin) | 
|---|
| 261 | ifeq (${MACHEROS},Darwin) | 
|---|
| 262 | CFLAGS       := -Wall -Wpointer-arith \ | 
|---|
| 263 | -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \ | 
|---|
| 264 | $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 265 | CXXFLAGS       := -Wall -Wpointer-arith \ | 
|---|
| 266 | -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \ | 
|---|
| 267 | $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 268 | LDLIBS       := -Xlinker -bind_at_load $(LDLIBS) $(XLDLIBS) | 
|---|
| 269 | endif | 
|---|
| 270 |  | 
|---|
| 271 | # Compilateur C natif HP-UX | 
|---|
| 272 | ifeq (${MACHEROS},HP-UX) | 
|---|
| 273 | ifeq ($(CC),cc) | 
|---|
| 274 | CFLAGS       :=  +Z -Aa -Ae $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 275 | FFLAGS       :=  -Aa -I${INC}   -D${MACHEROSD} | 
|---|
| 276 | CPPFLAGS     :=  -I${INC}  -I$(INC)/tnt -D${MACHEROSD} \ | 
|---|
| 277 | -D_HPUX_SOURCE $(MODULECPPFLAGS) | 
|---|
| 278 | LDLIBS      := $(XLDLIBS) | 
|---|
| 279 | override NOSHLIB := Y | 
|---|
| 280 |  | 
|---|
| 281 | endif | 
|---|
| 282 | ifeq ($(CXX),aCC) | 
|---|
| 283 | CXXFLAGS := $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) +Z -D__aCC__ | 
|---|
| 284 | #  -DCOMPILER_EXCEPTIONS -D__ANSI_TEMPLATES__  definis ds defs.h | 
|---|
| 285 | endif | 
|---|
| 286 | endif | 
|---|
| 287 |  | 
|---|
| 288 | # AIX, xlC comme compilateur C et C++ | 
|---|
| 289 | ifeq ($(CXX), xlC) | 
|---|
| 290 | CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) $(XCFLAGS) | 
|---|
| 291 | CPPFLAGS := -I$(INC)/Syst -I${INC}  -I$(INC)/tnt -D${MACHEROSD} $(MODULECPPFLAGS) | 
|---|
| 292 | CXXFLAGS     := $(CFLAGS) -D__xlC | 
|---|
| 293 | # -DCOMPILER_EXCEPTIONS defini ds defs.h | 
|---|
| 294 | LDLIBS      := $(XLDLIBS) | 
|---|
| 295 |  | 
|---|
| 296 | # Pour faire des bibliotheques partagees, il faut faire un truc du | 
|---|
| 297 | # style | 
|---|
| 298 | #ld -o shrsub.o subs1.o subs2.o -bE:shrsub.exp -bM:SRE -lc | 
|---|
| 299 |  | 
|---|
| 300 | # Pour le moment on ne se fatigue pas, tant pis | 
|---|
| 301 | override NOSHLIB := Y | 
|---|
| 302 |  | 
|---|
| 303 | # Et puis 1540-293: (W) est un FAUX warning, on supprime les warnings | 
|---|
| 304 | CXXFLAGS := -qflag=e $(CXXFLAGS) | 
|---|
| 305 | endif | 
|---|
| 306 |  | 
|---|
| 307 |  | 
|---|
| 308 | ifeq ($(CXX), cxx) | 
|---|
| 309 | ifeq ($(DBGFLAG), -g) | 
|---|
| 310 | ifdef OPTFLAG | 
|---|
| 311 | override DBGFLAG := -g1 | 
|---|
| 312 | endif | 
|---|
| 313 | #    ifdef XOPT | 
|---|
| 314 | #      override DBGFLAG := -g1 | 
|---|
| 315 | #    endif | 
|---|
| 316 | endif | 
|---|
| 317 |  | 
|---|
| 318 | # chemin pour repository CXX | 
|---|
| 319 | REP := $(OBJ)/cxxrep/ | 
|---|
| 320 | REPPI := $(OBJ)/cxxrep_PI/ | 
|---|
| 321 | REPCXX := -ptr $(OBJ)/cxxrep/ | 
|---|
| 322 | ifdef MODULECXXREPNAME | 
|---|
| 323 | REPCXX := -ptr $(OBJ)/cxxrep_$(MODULECXXREPNAME)/  -ptr $(OBJ)/cxxrep/ | 
|---|
| 324 | REPM := $(OBJ)/cxxrep_$(MODULECXXREPNAME)/ | 
|---|
| 325 | endif | 
|---|
| 326 |  | 
|---|
| 327 | LDLIBS      := $(XLDLIBS) -lrt | 
|---|
| 328 |  | 
|---|
| 329 | CXXFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)   \ | 
|---|
| 330 | $(REPCXX) -no_implicit_include | 
|---|
| 331 | # $(REPCXX) -no_implicit_include -D__USE_STD_IOSTREAM  passe pas avec cxx 6.0 Reza 23/12/99 | 
|---|
| 332 | CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 333 | #  CXXFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)  \ | 
|---|
| 334 | #             -nopt -define_templates | 
|---|
| 335 | ifeq ($(XOPT), 1) | 
|---|
| 336 | override DBGFLAG := | 
|---|
| 337 | CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \ | 
|---|
| 338 | $(REPCXX) -fp_reorder \ | 
|---|
| 339 | -O5 -inline speed -tune host | 
|---|
| 340 | endif | 
|---|
| 341 | ifeq ($(XOPT), 2) | 
|---|
| 342 | override DBGFLAG := | 
|---|
| 343 | CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \ | 
|---|
| 344 | $(REPCXX) -fp_reorder \ | 
|---|
| 345 | -O5 -inline speed -tune host \ | 
|---|
| 346 | -assume trusted_short_alignment | 
|---|
| 347 | endif | 
|---|
| 348 | ifeq ($(XOPT), 3) | 
|---|
| 349 | override DBGFLAG := | 
|---|
| 350 | CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \ | 
|---|
| 351 | $(REPCXX) -fp_reorder \ | 
|---|
| 352 | -O5 -inline speed -tune host \ | 
|---|
| 353 | -assume trusted_short_alignment \ | 
|---|
| 354 | -non_shared -om | 
|---|
| 355 | override NOSHLIB := Y | 
|---|
| 356 | endif | 
|---|
| 357 |  | 
|---|
| 358 | # le fichier X11/Xlib.h contient des declarations de fonctions sans type | 
|---|
| 359 | # Cela genere un grand nombre de warning avec cxx V6 | 
|---|
| 360 | # La variable MODULEDECCXXFLAGS permet de specifier des options de compilation | 
|---|
| 361 | # pour un module donne | 
|---|
| 362 | ifdef MODULEDECCXXFLAGS | 
|---|
| 363 | CXXFLAGS := $(CXXFLAGS) $(MODULEDECCXXFLAGS) | 
|---|
| 364 | endif | 
|---|
| 365 | endif | 
|---|
| 366 | ifeq ($(CC),cc) | 
|---|
| 367 | ifeq ($(MACHEROS),OSF1) | 
|---|
| 368 | ifeq ($(XOPT), 1) | 
|---|
| 369 | CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \ | 
|---|
| 370 | -O4 -inline speed -tune host | 
|---|
| 371 | endif | 
|---|
| 372 | ifeq ($(XOPT), 2) | 
|---|
| 373 | CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \ | 
|---|
| 374 | -O4 -inline speed -tune host \ | 
|---|
| 375 | -assume trusted_short_alignment -fast | 
|---|
| 376 | endif | 
|---|
| 377 | ifeq ($(XOPT), 3) | 
|---|
| 378 | CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \ | 
|---|
| 379 | -O4 -inline speed -tune host \ | 
|---|
| 380 | -assume trusted_short_alignment -fast \ | 
|---|
| 381 | -non_shared -om | 
|---|
| 382 | endif | 
|---|
| 383 | endif | 
|---|
| 384 | endif | 
|---|
| 385 |  | 
|---|
| 386 | # --- Compilateur KAI  (OK pour v 3.3) | 
|---|
| 387 | ifeq ($(CXX), KCC) | 
|---|
| 388 | CXXFLAGS     :=  --exceptions --rtti  --auto_instantiation --one_instantiation_per_object -D__KCC__ | 
|---|
| 389 | CXXFLAGS  := $(CXXFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 390 | CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 391 | # Flag --one_instantiation_per_object mis - Reza 02/03/99 | 
|---|
| 392 | endif | 
|---|
| 393 |  | 
|---|
| 394 | # --- Systeme IRIX64 de Silixon Graphics (SGI) | 
|---|
| 395 | ifeq ($(MACHEROS), IRIX64) | 
|---|
| 396 | # --- Compilateur natif CC de SGI | 
|---|
| 397 | ifeq ($(CXX), CC) | 
|---|
| 398 | CFLAGS  := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 399 | CXXFLAGS := -prelink -D__SGICC__ -LANG:std $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 400 | LINK.cc := CC $(CPPFLAGS) -D__SGICC__ -LANG:std $(DBGFLAG) $(OPTFLAG) | 
|---|
| 401 | #  sur SGI, les libs/executables ont deux formats 32 et 64 bits (trois avec o32) | 
|---|
| 402 | #  -n32 Generates a (new) 32-bit object default to -mips3 if -mips4 has not been specified | 
|---|
| 403 | #  -64 Generates a 64-bit object - defaults to -mips4 if -mips3 has not been specified | 
|---|
| 404 | #  La variable d'environnement SOPHYA_SGI64 controle cette option | 
|---|
| 405 | ifdef SOPHYA_SGI64 | 
|---|
| 406 | CFLAGS  := -64 -DSGI_ARCH64 $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 407 | CXXFLAGS := -64 -prelink -DSGI_ARCH64 -D__SGICC__ -LANG:std $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 408 | LINK.cc := CC -64 $(CPPFLAGS) -D__SGICC__ -LANG:std $(DBGFLAG) $(OPTFLAG) | 
|---|
| 409 | endif | 
|---|
| 410 | endif | 
|---|
| 411 | ifeq ($(CXX), g++) | 
|---|
| 412 | ifdef SOPHYA_SGI64 | 
|---|
| 413 | CFLAGS  := $(CFLAGS) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64 | 
|---|
| 414 | CXXFLAGS := $(CXXFLAGS) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64 | 
|---|
| 415 | LINK.cc := $(LINK.cc) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64 | 
|---|
| 416 | endif | 
|---|
| 417 | endif | 
|---|
| 418 | endif | 
|---|
| 419 |  | 
|---|
| 420 | # Autres compilateurs natifs. | 
|---|
| 421 |  | 
|---|
| 422 | #  CFLAGS       :=  -I$(INC) $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) | 
|---|
| 423 | #  CXXFLAGS     := $(CFLAGS) | 
|---|
| 424 | #  LDLIBS      := $(XLDLIBS) | 
|---|
| 425 |  | 
|---|
| 426 | #- redefine implicit rule. Les .o sont dans $(OBJ). | 
|---|
| 427 | $(OBJ)%.o:%.c | 
|---|
| 428 | $(COMPILE.c) -o $@ $< | 
|---|
| 429 |  | 
|---|
| 430 | $(OBJ)%.o:%.cc | 
|---|
| 431 | $(COMPILE.cc) -o $@ $< | 
|---|
| 432 |  | 
|---|
| 433 | $(OBJ)%.o:%.f | 
|---|
| 434 | $(COMPILE.f) -o $@ $< | 
|---|
| 435 |  | 
|---|
| 436 | #OSF1 | 
|---|
| 437 | #LDFC est f77 | 
|---|
| 438 | #LDFCFLAGS est rien | 
|---|
| 439 |  | 
|---|
| 440 | #parfois | 
|---|
| 441 | #LDFC est cc | 
|---|
| 442 | #LDFCFLAGS est -ltruc | 
|---|
| 443 |  | 
|---|
| 444 | #------------------------------------------------- End of Makefile.h ------- | 
|---|
| 445 | # fin gene auto MakefileUser.h | 
|---|
| 446 |  | 
|---|
| 447 |  | 
|---|
| 448 | ############################################################################## | 
|---|
| 449 | ############################################################################## | 
|---|
| 450 | #################### include des librairies pour le link ##################### | 
|---|
| 451 | ############################################################################## | 
|---|
| 452 | ############################################################################## | 
|---|
| 453 |  | 
|---|
| 454 | ############################################################################### | 
|---|
| 455 | # Link :                                                                      # | 
|---|
| 456 | # - without Shared Libraries > make NOSHLIB=y                                 # | 
|---|
| 457 | # - without Extern Libraries > make NOEXTLIB=y                                # | 
|---|
| 458 | # - without Fortan Libraries > make NOLFORT=y                                 # | 
|---|
| 459 | # - with PI Libraries        > make USELIBPI=y                                # | 
|---|
| 460 | # - with Personal Libraries  > make MYLIBS='-L/home/mylibs -lmylib1 -lmylib2' # | 
|---|
| 461 | ############################################################################### | 
|---|
| 462 |  | 
|---|
| 463 | LIBF = | 
|---|
| 464 | LIBS = | 
|---|
| 465 | ELIBF = | 
|---|
| 466 | ELIBS = | 
|---|
| 467 | SLIBF = | 
|---|
| 468 | MLIBS = | 
|---|
| 469 |  | 
|---|
| 470 | #------------------------------------------------------# | 
|---|
| 471 | #------------------ Archive Libraries -----------------# | 
|---|
| 472 | #------------------------------------------------------# | 
|---|
| 473 | ifdef NOSHLIB | 
|---|
| 474 |  | 
|---|
| 475 | #--------- lib sophya --------- | 
|---|
| 476 | LIBF := $(LIBF) $(LIB)libBaseTools.a $(LIB)libSysTools.a $(LIB)libSUtils.a $(LIB)libNTools.a $(LIB)libTArray.a $(LIB)libHiStats.a | 
|---|
| 477 | LIBF := $(LIBF) $(LIB)libSamba.a $(LIB)libSkyMap.a $(LIB)libSkyT.a | 
|---|
| 478 | LIBS := $(LIBS) -L$(LIB) -lBaseTools -lSysTools -lSUtils -lNTools -lTArray -lHiStats -lSamba -lSkyMap -lSkyT | 
|---|
| 479 |  | 
|---|
| 480 | #--------- lib sophya interface externes --------- | 
|---|
| 481 | ifndef NOEXTLIB | 
|---|
| 482 | LIBF := $(LIBF) $(LIB)libFitsIOServer.a $(LIB)libIFFTW.a $(LIB)libLinAlg.a $(LIB)libXAstroPack.a | 
|---|
| 483 | LIBS := $(LIBS) -lFitsIOServer -lIFFTW -lLinAlg -lXAstroPack | 
|---|
| 484 | #LIBF := $(LIBF)libBlitz.a | 
|---|
| 485 | #LIBS := $(LIBS) -lBlitz | 
|---|
| 486 | endif | 
|---|
| 487 |  | 
|---|
| 488 | #--------- lib piapp --------- | 
|---|
| 489 | ifdef USELIBPI | 
|---|
| 490 | LIBF := $(LIBF) $(LIB)libPI.a $(LIB)libPIext.a | 
|---|
| 491 | LIBS := $(LIBS) -lPI -lPIext | 
|---|
| 492 | endif | 
|---|
| 493 |  | 
|---|
| 494 | #--------- Other Extern Libraries --------- | 
|---|
| 495 | ifndef NOEXTLIB | 
|---|
| 496 | ELIBF := $(ELIBF) $(EXTLIBPATH)libcfitsio.a $(EXTLIBPATH)libfftw.a $(EXTLIBPATH)librfftw.a $(EXTLIBPATH)libxastro.a | 
|---|
| 497 | ELIBS := $(ELIBS) -L$(EXTLIBPATH) -lcfitsio -lfftw -lrfftw -lxastro | 
|---|
| 498 | ifeq ($(MACHEROS),OSF1) | 
|---|
| 499 | ###ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a $(EXTLIBPATH)libblas.a | 
|---|
| 500 | ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a | 
|---|
| 501 | ###ELIBS := $(ELIBS) -llapack -lblas | 
|---|
| 502 | ELIBS := $(ELIBS) -llapack -ldxml | 
|---|
| 503 | endif | 
|---|
| 504 | ifeq ($(MACHEROS),Linux) | 
|---|
| 505 | ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a $(EXTLIBPATH)libblas.a | 
|---|
| 506 | ELIBS := $(ELIBS) -llapack -lblas | 
|---|
| 507 | endif | 
|---|
| 508 | ifeq ($(MACHEROS),IRIX64) | 
|---|
| 509 | ELIBS := $(ELIBS) -lcomplib.sgimath | 
|---|
| 510 | endif | 
|---|
| 511 | endif | 
|---|
| 512 |  | 
|---|
| 513 | #--------- lib system --------- | 
|---|
| 514 | # librairie des instances de templates cxx Sophya | 
|---|
| 515 | ifeq ($(CXX),cxx) | 
|---|
| 516 | SLIBS := $(SLIBS) -lertcxx | 
|---|
| 517 | endif | 
|---|
| 518 | SLIBS := $(SLIBS) -lm | 
|---|
| 519 | # Librairies pour le fortran | 
|---|
| 520 | ifndef NOLFORT | 
|---|
| 521 | ifeq ($(MACHEROS),OSF1) | 
|---|
| 522 | SLIBS := $(SLIBS) -lfor | 
|---|
| 523 | endif | 
|---|
| 524 | ifeq ($(MACHEROS),Linux) | 
|---|
| 525 | #SLIBS := $(SLIBS) -lf2c | 
|---|
| 526 | SLIBS := $(SLIBS) -lg2c | 
|---|
| 527 | endif | 
|---|
| 528 | endif | 
|---|
| 529 |  | 
|---|
| 530 | #-----------------------------------------------------# | 
|---|
| 531 | #------------------ Shared Libraries -----------------# | 
|---|
| 532 | #-----------------------------------------------------# | 
|---|
| 533 | else | 
|---|
| 534 |  | 
|---|
| 535 | #--------- lib sophya --------- | 
|---|
| 536 | LIBF := $(LIBF) $(SLB)libsophya.so | 
|---|
| 537 | LIBS := $(LIBS) -L$(SLB) -lsophya | 
|---|
| 538 |  | 
|---|
| 539 | #--------- lib sophya interface externes --------- | 
|---|
| 540 | ifndef NOEXTLIB | 
|---|
| 541 | LIBF := $(LIBF) $(SLB)libextsophya.so | 
|---|
| 542 | LIBS := $(LIBS) -lextsophya | 
|---|
| 543 | endif | 
|---|
| 544 |  | 
|---|
| 545 | #--------- lib piapp --------- | 
|---|
| 546 | ifdef USELIBPI | 
|---|
| 547 | LIBF := $(LIBF) $(SLB)libPI.so | 
|---|
| 548 | LIBS := $(LIBS) -lPI | 
|---|
| 549 | endif | 
|---|
| 550 |  | 
|---|
| 551 | #--------- Other Extern Libraries --------- | 
|---|
| 552 | # ATTENTION actuellement les blabla.a sont appelees, | 
|---|
| 553 | # on pourrait appeller les blabla.so (EXTSLBPATH) si on les avait crees | 
|---|
| 554 | ifndef NOEXTLIB | 
|---|
| 555 | ELIBF := $(ELIBF) $(EXTLIBPATH)libcfitsio.a $(EXTLIBPATH)libfftw.a $(EXTLIBPATH)librfftw.a $(EXTLIBPATH)libxastro.a | 
|---|
| 556 | ELIBS := $(ELIBS) -L$(EXTLIBPATH) -lcfitsio -lfftw -lrfftw  -lxastro | 
|---|
| 557 | ifeq ($(MACHEROS),OSF1) | 
|---|
| 558 | ###ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a $(EXTLIBPATH)libblas.a | 
|---|
| 559 | ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a | 
|---|
| 560 | ###ELIBS := $(ELIBS) -llapack -lblas | 
|---|
| 561 | ELIBS := $(ELIBS) -llapack -ldxml | 
|---|
| 562 | endif | 
|---|
| 563 | ifeq ($(MACHEROS),Linux) | 
|---|
| 564 | ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a $(EXTLIBPATH)libblas.a | 
|---|
| 565 | ELIBS := $(ELIBS) -llapack -lblas | 
|---|
| 566 | endif | 
|---|
| 567 | ifeq ($(MACHEROS),IRIX64) | 
|---|
| 568 | ELIBS := $(ELIBS) -lcomplib.sgimath | 
|---|
| 569 | endif | 
|---|
| 570 | endif | 
|---|
| 571 |  | 
|---|
| 572 | #--------- lib systeme --------- | 
|---|
| 573 | SLIBS := $(SLIBS) -lm | 
|---|
| 574 | # Librairies pour le fortran | 
|---|
| 575 | ifndef NOLFORT | 
|---|
| 576 | ifeq ($(MACHEROS),OSF1) | 
|---|
| 577 | SLIBS := $(SLIBS) -lfor | 
|---|
| 578 | endif | 
|---|
| 579 | ifeq ($(MACHEROS),Linux) | 
|---|
| 580 | #SLIBS := $(SLIBS) -lf2c | 
|---|
| 581 | SLIBS := $(SLIBS) -lg2c | 
|---|
| 582 | endif | 
|---|
| 583 | endif | 
|---|
| 584 |  | 
|---|
| 585 | endif | 
|---|
| 586 |  | 
|---|
| 587 | #--------- PERSONAL Libraries --------- | 
|---|
| 588 | ifdef MYLIBS | 
|---|
| 589 | MLIBS := $(MLIBS) $(MYLIBS) | 
|---|
| 590 | endif | 
|---|
| 591 |  | 
|---|
| 592 | #--------- LIBF et LIBS --------- | 
|---|
| 593 | LIBF := $(LIBF) $(ELIBF) | 
|---|
| 594 | LIBS := $(LIBS) $(ELIBS) $(MLIBS) $(SLIBS) | 
|---|
| 595 |  | 
|---|
| 596 | ############################################################################## | 
|---|