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