Splitting of the ITS libraries (M.Masera & E.Crescio)
[u/mrichter/AliRoot.git] / HLT / Makefile.rules
CommitLineData
ead9cc3e 1# -*- Mode: Makefile -*-
3e87ef69 2#$Id$
3################################
4# Makefile.rules for HLT code. #
5# #
6# Author: Anders Vestbo, #
02f030e3 7# Constantin Loizides #
3e87ef69 8################################
9
10#----------------------------------------------------
02f030e3 11# !!! Dont change anything here !!!
12# !!! and if you have to send a mail to authors !!!
3e87ef69 13#----------------------------------------------------
14
15DEFSTR = -Dno_root
16OBJDIR = lib_alone
1f1942b8 17INCLUDES = -I$(ALIHLT_TOPDIR)/src -I$(ALIHLT_TOPDIR)/hough -I$(ALIHLT_TOPDIR)/comp -I$(ALIHLT_TOPDIR)/misc -I$(ALIHLT_TOPDIR)/trigger -I$(ALIHLT_TOPDIR)/kalman
3e87ef69 18
19ifeq ($(ALIHLT_USEPACKAGE),ROOT)
20INCLUDES += -I$(ROOTSYS)/include
21DEFSTR = -Duse_root
22OBJDIR = lib_ROOT
23ROOTSTR := $(shell $(ROOTSYS)/bin/root -n -b -q | grep Version | cut -b 17-25 | cut -d" " -f1)
24DEFSTR += -DROOTVERSION=\"$(ROOTSTR)\"
25endif
26
27ifeq ($(ALIHLT_USEPACKAGE),ALIROOT)
28INCLUDES += -I$(ROOTSYS)/include -I$(ALICE_ROOT)/include/ -I$(ALICE_ROOT)/TPC -I$(ALICE_ROOT)/CONTAINERS -I$(ALICE_ROOT)/STEER
29DEFSTR = -Duse_aliroot -Duse_root
b2a02bce 30ifeq ($(USENEWIO),1)
31DEFSTR += -Duse_newio
32endif
3e87ef69 33OBJDIR = lib
34ROOTSTR := $(shell $(ROOTSYS)/bin/root -n -b -q | grep Version | cut -b 17-25 | cut -d" " -f1)
35DEFSTR += -DROOTVERSION=\"$(ROOTSTR)\"
36ifeq ($(USECVS),1)
37ALIROOTSTR := $(shell if test -n "`cd $(ALICE_ROOT)/STEER/ && cvs stat AliRun.cxx | grep "Sticky Tag" | grep none`"; then echo HEAD; else cd $(ALICE_ROOT)/STEER/ && cvs stat AliRun.cxx | grep "Sticky Tag" | cut -b 18- | cut -d" " -f1; fi)
38DEFSTR += -Duse_cvs
39else
40ALIROOTSTR = "Unknown"
41endif
42DEFSTR += -DALIROOTVERSION=\"$(ALIROOTSTR)\"
de3c3890 43ifeq ($(ALIROOTST),HEAD)
44DEFSTR += -Duse_reconstruction
45endif
3e87ef69 46endif
47
48ifeq ($(DOMC),1)
49DEFSTR += -Ddo_mc
50endif
51
0bd0c1ef 52ifeq ($(USEROWHOUGH),1)
de3c3890 53DEFSTR += -DROWHOUGHPARAMS
0bd0c1ef 54endif
55
3e87ef69 56ifneq ($(NOLOGGING),1)
57DEFSTR += -Duse_logging
58ifdef ALIHLT_MLUCDIR
59INCLUDES += -I$(ALIHLT_MLUCDIR)/include
60else
61INCLUDES += -I/prog/alice/level3/kip/MLUC/include
62endif
63endif
64
1f1942b8 65DEFSTR += -D$(ARCH) $(EXTRADEF)
3e87ef69 66
67DICT = $(MODNAME)Cint-$(ALIHLT_USEPACKAGE).cxx
68DICTH = $(MODNAME)Cint-$(ALIHLT_USEPACKAGE).h
69DICTO = $(OBJDIR)/$(MODNAME)Cint-$(ALIHLT_USEPACKAGE).o
70
3e87ef69 71ifndef OBJS
72ifeq ($(OBJDIR),lib_alone)
73HDRS = $(SRCS:.cxx=.h)
74OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS))
75else
76HDRS = $(SRCS:.cxx=.h) $(MODNAME)LinkDef.h
77OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS)) $(DICTO)
78endif
79endif
80
5a31e9df 81STATICOBJS = $(patsubst %.o,%.sto,$(OBJS))
3e87ef69 82
5a31e9df 83ALIHLT_LIBSO = $(ALIHLT_LIBDIR)/lib$(MODNAME).so
84ALIHLT_DYLIB = $(ALIHLT_LIBDIR)/lib$(MODNAME).dylib
85ALIHLT_STATIC = $(ALIHLT_LIBDIR)/lib$(MODNAME).a
3e87ef69 86
5a31e9df 87#Default Target
88default: so
89
90libs: so static
91
92so: $(OBJDIR) $(ALIHLT_LIBDIR) $(ALIHLT_LIBSO)
93
94static: $(OBJDIR) $(ALIHLT_LIBDIR) $(ALIHLT_STATIC)
3e87ef69 95
96$(ALIHLT_LIBSO): $(OBJS)
86b74d5e 97ifeq ($(ARCH),macosx)
1f1942b8 98 $(LD) $(DYFLAGS) $^ $(LDFLAGS) -o $(ALIHLT_DYLIB)
99endif
100 $(LD) $(SOFLAGS) $^ $(LDFLAGS) -o $@
101
5a31e9df 102$(ALIHLT_STATIC): $(STATICOBJS)
103 $(LDSTATIC) $(STATICFLAGS) $@ $^
3e87ef69 104
105$(DICT): $(HDRS)
106 @echo "Generating dictionary..."
0bd0c1ef 107 rootcint -f $(DICT) -c $(CINTCXXFLAGS) $(INCLUDES) \
1f1942b8 108 $(DEFSTR) -include AliL3StandardIncludes.h $(HDRS)
3e87ef69 109
110$(OBJDIR)/%.o: %.cxx
111 $(CXX) $(CXXFLAGS) $(DEFSTR) -c $(INCLUDES) -o $@ $<
112
5a31e9df 113$(OBJDIR)/%.sto: %.cxx
114 $(CXX) $(PROFILEFLAGS) $(CXXFLAGS) $(DEFSTR) -c $(INCLUDES) -o $@ $<
115
3e87ef69 116$(OBJDIR):
117 test ! -e $(OBJDIR) && mkdir -p $(OBJDIR)
118
119$(ALIHLT_LIBDIR):
120 test ! -e $(ALIHLT_LIBDIR) && mkdir -p $(ALIHLT_LIBDIR)
121
122help:
123 cat $(ALIHLT_TOPDIR)/doc/README
124
125print:
126 @echo "MODNAME = $(MODNAME)"
127 @echo "ALIHLT_BASEDIR = $(ALIHLT_BASEDIR)"
128 @echo "ALIHLT_TOPDIR = $(ALIHLT_TOPDIR)"
129 @echo "ALIHLT_MLUCDIR = $(ALIHLT_MLUCDIR)"
130 @echo "ALIHLT_USEPACKAGE = $(ALIHLT_USEPACKAGE)"
b2a02bce 131 @echo "ALIHLT_USENEWIO = $(ALIHLT_USENEWIO)"
3e87ef69 132 @echo "ALIHLT_NOLOGGING = $(ALIHLT_NOLOGGING)"
133 @echo "ALIHLT_DOMC = $(ALIHLT_DOMC)"
3e87ef69 134 @echo "ALIHLT_ALIDETECT = $(ALIHLT_ALIDETECT)"
0bd0c1ef 135 @echo "ALIHLT_ROWHOUGH = $(ALIHLT_ROWHOUGH)"
3e87ef69 136 @echo "ROOTSTR = $(ROOTSTR)"
137 @echo "ALIROOTSTR = $(ALIROOTSTR)"
138
139printall: print
140 @echo "ALIHLT_LIBSO = $(ALIHLT_LIBSO)"
141 @echo "DEFSTR = $(DEFSTR)"
142 @echo "OBJDIR = $(OBJDIR)"
143 @echo "INCLUDES = $(INCLUDES)"
144 @echo "SRCS = $(SRCS)"
145 @echo "HRDS = $(HDRS)"
146 @echo "OBJS = $(OBJS)"
147
148clean:
5a31e9df 149 rm -f $(OBJDIR)/*.o $(OBJDIR)/*.sto
3e87ef69 150 rm -f $(DICT) $(DICTH)
151 rm -rf $(OBJDIR)
152
5a31e9df 153cleanlib:
154 rm -f $(ALIHLT_LIBSO) $(ALIHLT_DYLIB) $(ALIHLT_STATIC)
3e87ef69 155
5a31e9df 156realclean: clean cleanlib
02f030e3 157
158
159.phony: help print printall clean so realclean
3e87ef69 160