]>
Commit | Line | Data |
---|---|---|
b934f194 | 1 | # Makefile to build AliRoot for Linux |
2 | ||
6a772515 | 3 | # System dependent commands |
4 | ||
5 | XARGS = xargs -r | |
6 | ||
02a1d5c1 | 7 | # The compilers |
8 | CXX = g++ | |
02a1d5c1 | 9 | CC = gcc |
10 | CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1) | |
19ca05d1 | 11 | CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2) |
02a1d5c1 | 12 | |
874112da | 13 | ifneq (,$(findstring g95,$(ROOTBUILD))) |
14 | F77 = g95 | |
15 | else | |
16 | ifneq (,$(findstring gfortran,$(ROOTBUILD))) | |
17 | F77 = gfortran | |
18 | else | |
19 | F77 = g77 | |
20 | endif | |
21 | endif | |
22 | ||
02a1d5c1 | 23 | # Global optimisation |
24 | OPT = -O -g | |
19ca05d1 | 25 | NOOPT = -g |
02a1d5c1 | 26 | |
19ca05d1 | 27 | CXXOPT = $(OPT) |
28 | CXXNOOPT = $(NOOPT) | |
02a1d5c1 | 29 | COPT = $(OPT) |
19ca05d1 | 30 | FOPT = $(OPT) |
02a1d5c1 | 31 | |
32 | # CERNLIB defines | |
02a1d5c1 | 33 | CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ |
34 | CLIBCXXOPTS = | |
35 | CLIBCOPT = | |
19ca05d1 | 36 | CLIBFOPT = $(CLIBDEFS) |
37 | ||
38 | # Compiler flags | |
39 | ifeq ($(CCMAJORV),2) | |
40 | CXXFLAGS = $(OPT) -W -Wall -fPIC -pipe | |
41 | CXXFLAGSNO = $(NOOPT) -W -Wall -fPIC -pipe | |
42 | else | |
0038d136 | 43 | ifeq ($(CCMAJORV),3) |
ec22f7b0 | 44 | CXXFLAGS = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux |
45 | CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi | |
0038d136 | 46 | else |
47 | CXXFLAGS = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux | |
ec22f7b0 | 48 | CXXFLAGSNO = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi |
0038d136 | 49 | endif |
19ca05d1 | 50 | endif |
931c1b8a | 51 | CFLAGS = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi |
19ca05d1 | 52 | FFLAGS = $(CLIBFOPT) $(FOPT) -fno-second-underscore |
874112da | 53 | |
54 | ifneq (,$(findstring g95,$(ROOTBUILD))) | |
55 | FFLAGS +=-DFORTRAN_G95 | |
56 | else | |
57 | ifneq (,$(findstring gfortran,$(ROOTBUILD))) | |
58 | FFLAGS +=-DFORTRAN_GFORTRAN | |
59 | else | |
60 | FFLAGS += | |
61 | endif | |
62 | endif | |
63 | ||
19ca05d1 | 64 | # rmkdepend flags for building dependencies of FORTRAN files |
65 | DEPENDFFLAGS = $(FFLAGS) | |
66 | ||
67 | # rootcint flags | |
68 | CINTFLAGS = | |
02a1d5c1 | 69 | |
02a1d5c1 | 70 | LD = g++ |
71 | LDFLAGS = $(OPT) | |
72 | ||
73 | SHLD = $(LD) | |
74 | SOFLAGS = $(OPT) -shared -Wl | |
02a1d5c1 | 75 | SOEXT = so |
76 | ||
874112da | 77 | #System libraries |
78 | SYSLIBS := -ldl -lcrypt -L/usr/X11R6/lib -lX11 | |
79 | ||
80 | ifneq (,$(findstring g95,$(ROOTBUILD))) | |
81 | SHLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95 | |
82 | else | |
83 | ifneq (,$(findstring gfortran,$(ROOTBUILD))) | |
84 | SHLIB := $(shell gfortran -print-file-name=libgfortran.so) | |
85 | SHLIB += $(shell gfortran -print-file-name=libgfortranbegin.a) | |
86 | else | |
87 | SHLIB = -lg2c | |
88 | SYSLIBS += -lg2c | |
89 | endif | |
90 | endif | |
91 | ||
02a1d5c1 | 92 | ALLD = ar |
93 | ALFLAGS = cr | |
94 | ALLIB = | |
95 | AEXT = a | |
96 | ||
97 | # additional ROOT libraries | |
02a1d5c1 | 98 | |
02a1d5c1 | 99 | |
02a1d5c1 | 100 | |
101 | ||
102 | ||
103 |