-#
-# Makefile for ROOT version of HLT code.
-#
-# Author: Anders Vestbo
-#
+#$Id$
+################################
+# Makefile for HLT Comp code. #
+# #
+# Author: Anders Vestbo #
+# Constantin Loizides #
+################################
-CXX = g++
-LD = g++
-CXXFLAGS = -O2 -Wall -fPIC -Woverloaded-virtual
-LDFLAGS = -O2
-SOFLAGS = -shared
+MODNAME = AliL3Comp
-TOPDIR = $(HOME)/level3code
-OBJDIR = tgt_Linux
+ifndef ALIHLT_TOPDIR
+ALIHLT_TOPDIR = $(shell pwd)/..
+endif
-SRCS = AliL3Modeller.cxx AliL3ModelTrack.cxx
+include $(ALIHLT_TOPDIR)/Makefile.conf
-DICT = AliL3CompCint.cxx
-DICTH = AliL3CompCint.h
-DICTO = $(OBJDIR)/AliL3CompCint.o
+SRCS = AliL3Modeller.cxx AliL3ModelTrack.cxx AliL3ClusterFitter.cxx \
+ AliL3Compress.cxx AliL3DataCompressor.cxx
-HDRS = $(SRCS:.cxx=.h) AliL3CompLinkDef.h
+ADD_C_OBJS = $(OBJDIR)/bitio.o $(OBJDIR)/errhand.o $(OBJDIR)/AliL3FitUtilities.o
-OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS)) $(DICTO)
+ifeq ($(ALIHLT_USEPACKAGE),ROOT)
+HDRS = $(SRCS:.cxx=.h) $(MODNAME)LinkDef.h
+OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS)) $(ADD_C_OBJS) $(DICTO)
+endif
-LEVELSO = $(LEVEL3)/lib_$(USERNAME)/libAliL3Comp.so
+ifeq ($(ALIHLT_USEPACKAGE),ALIROOT)
+SRCS += AliL3OfflineDataCompressor.cxx
+HDRS = $(SRCS:.cxx=.h) $(MODNAME)LinkDef.h
+OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS)) $(ADD_C_OBJS) $(DICTO)
+endif
-all : $(OBJDIR) $(LEVELSO)
+ifeq ($(ALIHLT_USEPACKAGE),STANDALONE)
+OBJS = $(patsubst %.cxx,$(OBJDIR)/%.o,$(SRCS)) $(ADD_C_OBJS)
+endif
+include $(ALIHLT_TOPDIR)/Makefile.rules
-$(LEVELSO) : $(OBJS)
- $(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
-$(DICT) : $(HDRS)
- @echo "Generating dictionary..."
- @rootcint -f $(DICT) -c -I$(ROOTSYS) -I$(TOPDIR)/src/ $(HDRS)
+$(OBJDIR)/bitio.o: bitio.c
+ $(CXX) -c -o $(OBJDIR)/bitio.o bitio.c
+$(OBJDIR)/errhand.o: errhand.c
+ $(CXX) -c -o $(OBJDIR)/errhand.o errhand.c
-$(OBJDIR)/%.o : %.cxx
- $(CXX) $(CXXFLAGS) -c -I$(ROOTSYS)/include -I$(TOPDIR)/src -I$(TOPDIR)/hough -o $@ $<
-
-$(OBJDIR) :
- test ! -e $(OBJDIR) && mkdir -p $(OBJDIR)
-
-clean :
- rm -f $(OBJDIR)/*.o
- rm -f $(LEVEL3)/lib_$(USERNAME)/libAliL3Comp.so
- rm $(DICT) $(DICTH)
-so :
- rm -f $(LEVEL3)/lib_$(USERNAME)/libAliL3Comp.so
\ No newline at end of file
+$(OBJDIR)/AliL3FitUtilities.o: AliL3FitUtilities.c
+ $(CXX) -c -o $(OBJDIR)/AliL3FitUtilities.o AliL3FitUtilities.c