Fixes for the creation of PAR files on Mac (Chiara, Gerri)
[u/mrichter/AliRoot.git] / STEER / Makefile
index e628d2d..18c4e40 100644 (file)
@@ -1,89 +1,80 @@
-############################### STEER Makefile ################################
-
-# Include machine specific definitions
-
-include $(ALICE_ROOT)/conf/GeneralDef
-include $(ALICE_ROOT)/conf/MachineDef.$(ALICE_TARGET)
-
-PACKAGE = STEER
-
-# C++ sources
-
-SRCS          = AliDetector.cxx        AliHeader.cxx   AliMagF.cxx \
-                AliDigit.cxx   AliHit.cxx      AliPoints.cxx \
-                AliDisplay.cxx AliMC.cxx       AliRun.cxx AliGenerator.cxx \
-               AliLego.cxx     AliModule.cxx   AliDigitNew.cxx \
-               AliGeometry.cxx AliRecPoint.cxx AliSegmentation.cxx \
-               AliHitMap.cxx   AliMagFC.cxx    AliMagFCM.cxx \
-               AliMagFDM.cxx   AliLegoGenerator.cxx AliLegoGeneratorXYZ.cxx\
-                AliLegoGeneratorPhiZ.cxx AliLegoGeneratorEta.cxx \
-                AliRndm.cxx \
-               AliKalmanTrack.cxx AliCluster.cxx AliTracker.cxx\
-               AliMCQA.cxx AliPDG.cxx AliDebugVolume.cxx
-
-# C++ Headers
-
-HDRS          = $(SRCS:.cxx=.h) AliPDG.h $(ROOTSYS)/include/TH2.h \
-                               $(ROOTSYS)/include/TRandom.h STEERLinkDef.h 
-
-# Library dictionary
-
-DICT          = STEERCint.cxx
-DICTH         = $(DICT:.cxx=.h)
-DICTO         = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(DICT))
-
-# FORTRAN Objectrs
-
-FOBJS         = $(patsubst %.F,tgt_$(ALICE_TARGET)/%.o,$(FSRCS))
-
-# C Objects
-
-COBJS         = $(patsubst %.c,tgt_$(ALICE_TARGET)/%.o,$(CSRCS))
-
-# C++ Objects
-
-OBJS          = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS)) $(DICTO)
-
-# C++ compilation flags
-
-CXXFLAGS      = $(CXXOPTS) -I$(ROOTSYS)/include -I. -I$(ALICE_ROOT)/include/
-# FORTRAN compilation flags
-
-FFLAGS      = $(FOPT)
-
-##### TARGETS #####
-# Target
-
-SLIBRARY       = $(LIBDIR)/libSTEER.$(SL)
-ALIBRARY       = $(LIBDIR)/lib/libSTEER.a
-
-default:       $(SLIBRARY)
-
-$(LIBDIR)/libSTEER.$(SL):              $(OBJS)
-
-$(DICT):                               $(HDRS)
-
-depend:                                        $(SRCS)
-
-HEADERS        = $(SRCS:.cxx=.h) AliPDG.h AliConst.h AliCallf77.h AliMCProcess.h
-
-TOCLEAN                = $(OBJS) *Cint.cxx *Cint.h
-
-CHECKS         = $(patsubst %.cxx,check/%.viol,$(SRCS))
-
-############################### General Macros ################################
-
-include $(ALICE_ROOT)/conf/GeneralMacros
-
-############################ Dependencies #####################################
-
--include tgt_$(ALICE_TARGET)/Make-depend 
-
-
-
-
-
-
+PACKAGE = invalid-only-for-proof
+
+include $(ROOTSYS)/test/Makefile.arch
+
+SRCS     = $(wildcard *.cxx)
+HDRS     = $(SRCS:.cxx=.h)
+DHDR     = $(PACKAGE)LinkDef.h
+
+
+ifndef PACKCXXFLAGS
+   PACKCXXFLAGS = $(CXXFLAGS)
+endif
+
+ALICEINC = -I.
+
+ifneq ($(ESD_INCLUDE),)
+   ALICEINC += -I../$(ESD_INCLUDE) 
+endif
+
+ifneq ($(AOD_INCLUDE),)
+   ALICEINC += -I../$(AOD_INCLUDE) 
+endif
+
+ifneq ($(STEERBase_INCLUDE),)
+   ALICEINC += -I../$(STEERBase_INCLUDE)
+endif
+
+# only if no par file was loaded before
+ifeq ($(ALICEINC),-I.)
+  ifneq ($(ALICE_ROOT),)
+    ALICEINC += -I$(ALICE_ROOT)/include
+  endif
+endif
+
+
+
+
+CXXFLAGS += $(ALICEINC) -g
+
+SRCS         += G__$(PACKAGE).cxx
+OBJS          = $(SRCS:.cxx=.o)
+
+lib$(PACKAGE).so: $(OBJS)
+       @echo "Linking" $@ ...
+       @/bin/rm -f $@
+ifeq ($(PLATFORM),macosx)
+# We need to make both the .dylib and the .so
+               $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
+ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
+ifeq ($(MACOSX_MINOR),4)
+               ln -sf $@ $(subst .$(DllSuf),.so,$@)
+else
+               $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
+                  $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
+endif
+endif
+else
+ifeq ($(PLATFORM),win32)
+               bindexplib $* $^ > $*.def
+               lib -nologo -MACHINE:IX86 $^ -def:$*.def \
+                  $(OutPutOpt)$(EVENTLIB)
+               $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
+                  $(OutPutOpt)$@
+else
+               $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
+endif
+endif
+       @chmod a+x $@
+       @echo "done"
+
+%.o:    %.cxx %.h
+       $(CXX) $(PACKCXXFLAGS) -c $< -o $@
+
+clean:
+       @rm -f $(OBJS) *.so G__$(PACKAGE).*
+
+G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
+       @echo "Generating dictionaries ..." $(ALICEINC)
+       rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^