source: Sophya/trunk/SophyaLib/Mgr/Makefile.h@ 1036

Last change on this file since 1036 was 1014, checked in by ansari, 25 years ago

Suppression de DCOMPILER_EXCEPTION ds Makefile.h - Reza 19/5/2000

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