Merged HLT tag v1-2 with ALIROOT tag v3-09-Release.
[u/mrichter/AliRoot.git] / HLT / Makefile.rules
CommitLineData
3e87ef69 1#$Id$
2################################
3# Makefile.rules for HLT code. #
4# #
5# Author: Anders Vestbo, #
6# Constantin Loizide #
7################################
8
9#----------------------------------------------------
10# !!! Dont change anything here !!!
11#----------------------------------------------------
12
13DEFSTR = -Dno_root
14OBJDIR = lib_alone
15INCLUDES = -I$(ALIHLT_TOPDIR)/hough -I$(ALIHLT_TOPDIR)/src -I$(ALIHLT_TOPDIR)/comp -I$(ALIHLT_TOPDIR)/misc -I$(ALIHLT_TOPDIR)/trigger
16
17ifeq ($(ALIHLT_USEPACKAGE),ROOT)
18INCLUDES += -I$(ROOTSYS)/include
19DEFSTR = -Duse_root
20OBJDIR = lib_ROOT
21ROOTSTR := $(shell $(ROOTSYS)/bin/root -n -b -q | grep Version | cut -b 17-25 | cut -d" " -f1)
22DEFSTR += -DROOTVERSION=\"$(ROOTSTR)\"
23endif
24
25ifeq ($(ALIHLT_USEPACKAGE),ALIROOT)
26INCLUDES += -I$(ROOTSYS)/include -I$(ALICE_ROOT)/include/ -I$(ALICE_ROOT)/TPC -I$(ALICE_ROOT)/CONTAINERS -I$(ALICE_ROOT)/STEER
27DEFSTR = -Duse_aliroot -Duse_root
28OBJDIR = lib
29ROOTSTR := $(shell $(ROOTSYS)/bin/root -n -b -q | grep Version | cut -b 17-25 | cut -d" " -f1)
30DEFSTR += -DROOTVERSION=\"$(ROOTSTR)\"
31ifeq ($(USECVS),1)
32ALIROOTSTR := $(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)
33DEFSTR += -Duse_cvs
34else
35ALIROOTSTR = "Unknown"
36endif
37DEFSTR += -DALIROOTVERSION=\"$(ALIROOTSTR)\"
38endif
39
40ifeq ($(DOMC),1)
41DEFSTR += -Ddo_mc
42endif
43
44ifneq ($(NOLOGGING),1)
45DEFSTR += -Duse_logging
46ifdef ALIHLT_MLUCDIR
47INCLUDES += -I$(ALIHLT_MLUCDIR)/include
48else
49INCLUDES += -I/prog/alice/level3/kip/MLUC/include
50endif
51endif
52
53ifeq ($(ASVVERSION),1)
54DEFSTR += -DASVVERSION
55endif
56
57DEFSTR += $(EXTRADEF)
58
59DICT = $(MODNAME)Cint-$(ALIHLT_USEPACKAGE).cxx
60DICTH = $(MODNAME)Cint-$(ALIHLT_USEPACKAGE).h
61DICTO = $(OBJDIR)/$(MODNAME)Cint-$(ALIHLT_USEPACKAGE).o
62
63
64ifndef OBJS
65ifeq ($(OBJDIR),lib_alone)
66HDRS = $(SRCS:.cxx=.h)
67OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS))
68else
69HDRS = $(SRCS:.cxx=.h) $(MODNAME)LinkDef.h
70OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS)) $(DICTO)
71endif
72endif
73
74ALIHLT_LIBSO = $(ALIHLT_LIBDIR)/lib$(MODNAME).so
75
76#Default Targets
77#
78
79all: $(OBJDIR) $(ALIHLT_LIBDIR) $(ALIHLT_LIBSO)
80
81$(ALIHLT_LIBSO): $(OBJS)
82 $(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
83
84$(DICT): $(HDRS)
85 @echo "Generating dictionary..."
86 rootcint -f $(DICT) -c $(INCLUDES) -DGCCVERSION=$(GCCVERSION) $(DEFSTR) -include AliL3StandardIncludes.h $(HDRS)
87
88$(OBJDIR)/%.o: %.cxx
89 $(CXX) $(CXXFLAGS) $(DEFSTR) -c $(INCLUDES) -o $@ $<
90
91$(OBJDIR):
92 test ! -e $(OBJDIR) && mkdir -p $(OBJDIR)
93
94$(ALIHLT_LIBDIR):
95 test ! -e $(ALIHLT_LIBDIR) && mkdir -p $(ALIHLT_LIBDIR)
96
97help:
98 cat $(ALIHLT_TOPDIR)/doc/README
99
100print:
101 @echo "MODNAME = $(MODNAME)"
102 @echo "ALIHLT_BASEDIR = $(ALIHLT_BASEDIR)"
103 @echo "ALIHLT_TOPDIR = $(ALIHLT_TOPDIR)"
104 @echo "ALIHLT_MLUCDIR = $(ALIHLT_MLUCDIR)"
105 @echo "ALIHLT_USEPACKAGE = $(ALIHLT_USEPACKAGE)"
106 @echo "ALIHLT_NOLOGGING = $(ALIHLT_NOLOGGING)"
107 @echo "ALIHLT_DOMC = $(ALIHLT_DOMC)"
108 @echo "ALIHLT_HAVEASV = $(ALIHLT_HAVEASV)"
109 @echo "ALIHLT_ALIDETECT = $(ALIHLT_ALIDETECT)"
110 @echo "ROOTSTR = $(ROOTSTR)"
111 @echo "ALIROOTSTR = $(ALIROOTSTR)"
112
113printall: print
114 @echo "ALIHLT_LIBSO = $(ALIHLT_LIBSO)"
115 @echo "DEFSTR = $(DEFSTR)"
116 @echo "OBJDIR = $(OBJDIR)"
117 @echo "INCLUDES = $(INCLUDES)"
118 @echo "SRCS = $(SRCS)"
119 @echo "HRDS = $(HDRS)"
120 @echo "OBJS = $(OBJS)"
121
122clean:
123 rm -f $(OBJDIR)/*.o
124 rm -f $(ALIHLT_LIBSO)
125 rm -f $(DICT) $(DICTH)
126 rm -rf $(OBJDIR)
127
128so:
129 rm -f $(ALIHLT_LIBSO)
130
131
132.phony: print clean so