New topdir Makefile for compiling all libraries in the HLT tree.
[u/mrichter/AliRoot.git] / HLT / comp / Makefile
CommitLineData
e998e586 1#$Id$
2###########################
3# Makefile for HLT code. #
4# #
5# Author: Anders Vestbo #
6###########################
735e167e 7
71e6af6c 8ifndef USEPACKAGE
e2e0cb81 9#USEPACKAGE = ROOT
10USEPACKAGE = ALIROOT
71e6af6c 11endif
e2e0cb81 12
71e6af6c 13#used if USEPACKAGE=anything else
e2e0cb81 14DEFSTR = -Dno_root
dfc8670c 15
735e167e 16CXX = g++
17LD = g++
18CXXFLAGS = -O2 -Wall -fPIC -Woverloaded-virtual
19LDFLAGS = -O2
20SOFLAGS = -shared
21
71e6af6c 22ifndef TOPDIR
735e167e 23TOPDIR = $(HOME)/level3code
71e6af6c 24endif
25ifndef LIBDIR
6820fe90 26LIBDIR = $(LEVEL3)/lib_$(USERNAME)
71e6af6c 27endif
28OBJDIR = lib
dfc8670c 29
30ifeq ($(USEPACKAGE),ROOT)
31INCLUDES = -I$(ROOTSYS)/include -I$(TOPDIR)/hough -I$(TOPDIR)/src -I$(TOPDIR)/comp
e2e0cb81 32DEFSTR = -Duse_root
74eabe5f 33OBJDIR = lib_ROOT
dfc8670c 34endif
35
36ifeq ($(USEPACKAGE),ALIROOT)
37INCLUDES = -I$(ROOTSYS)/include -I$(TOPDIR)/hough -I$(TOPDIR)/src -I$(TOPDIR)/comp -I$(ALICE_ROOT)/include/ -I$(ALICE_ROOT)/TPC -I$(ALICE_ROOT)/CONTAINERS -I$(ALICE_ROOT)/STEER
e2e0cb81 38DEFSTR = -Duse_aliroot -Duse_root
dfc8670c 39endif
40
e2e0cb81 41#Save the particle id's
42#DEFSTR += -Ddo_mc
43
71e6af6c 44#Use logging classes
b419a833 45ifndef NOLOGGING
71e6af6c 46DEFSTR += -Duse_logging
b419a833 47endif
71e6af6c 48
49ifdef MLUCDIR
50INCLUDES += -I$(MLUCDIR)/include
51else
52INCLUDES += -I/prog/alice/level3/kip/MLUC/include
53endif
54
6820fe90 55SRCS = AliL3Modeller.cxx AliL3ModelTrack.cxx AliL3Compress.cxx
735e167e 56
57DICT = AliL3CompCint.cxx
58DICTH = AliL3CompCint.h
59DICTO = $(OBJDIR)/AliL3CompCint.o
60
6820fe90 61HDRS = $(SRCS:.cxx=.h) bitio.h errhand.h AliL3CompLinkDef.h
735e167e 62
6820fe90 63OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS)) $(OBJDIR)/bitio.o $(OBJDIR)/errhand.o $(DICTO)
735e167e 64
6820fe90 65LEVELSO = $(LIBDIR)/libAliL3Comp.so
735e167e 66
cc4d912a 67all : $(OBJDIR) $(LIBDIR) $(LEVELSO)
735e167e 68
69
70$(LEVELSO) : $(OBJS)
71 $(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
72
73$(DICT) : $(HDRS)
74 @echo "Generating dictionary..."
dfc8670c 75 @rootcint -f $(DICT) -c $(INCLUDES) $(HDRS)
735e167e 76
77
78$(OBJDIR)/%.o : %.cxx
e2e0cb81 79 $(CXX) $(CXXFLAGS) $(DEFSTR) -c $(INCLUDES) -o $@ $<
735e167e 80
81$(OBJDIR) :
82 test ! -e $(OBJDIR) && mkdir -p $(OBJDIR)
6820fe90 83
cc4d912a 84$(LIBDIR) :
85 test ! -e $(LIBDIR) && mkdir -p $(LIBDIR)
86
6820fe90 87$(OBJDIR)/bitio.o : bitio.c
88 $(CXX) -c -o $(OBJDIR)/bitio.o bitio.c
89$(OBJDIR)/errhand.o : errhand.c
90 $(CXX) -c -o $(OBJDIR)/errhand.o errhand.c
735e167e 91
92clean :
93 rm -f $(OBJDIR)/*.o
6820fe90 94 rm -f $(LIBDIR)/libAliL3Comp.so
74eabe5f 95 rm -f $(DICT) $(DICTH)
735e167e 96so :
6820fe90 97 rm -f $(LIBDIR)/libAliL3Comp.so