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