Fixes for the creation of PAR files on Mac (Chiara, Gerri)
[u/mrichter/AliRoot.git] / STEER / Makefile
index eb7bdd4..18c4e40 100644 (file)
@@ -1,15 +1,42 @@
 PACKAGE = invalid-only-for-proof
 
 include $(ROOTSYS)/test/Makefile.arch
-include lib$(PACKAGE).pkg
+
+SRCS     = $(wildcard *.cxx)
+HDRS     = $(SRCS:.cxx=.h)
+DHDR     = $(PACKAGE)LinkDef.h
+
 
 ifndef PACKCXXFLAGS
-PACKCXXFLAGS = $(CXXFLAGS)
+   PACKCXXFLAGS = $(CXXFLAGS)
 endif
 
+ALICEINC = -I.
+
 ifneq ($(ESD_INCLUDE),)
-   PACKCXXFLAGS += -I../$(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)
 
@@ -17,9 +44,26 @@ lib$(PACKAGE).so: $(OBJS)
        @echo "Linking" $@ ...
        @/bin/rm -f $@
 ifeq ($(PLATFORM),macosx)
-       @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
+# 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) $(SOFLAGS) $(LDFLAGS) $^ -o $@
+               $(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"
@@ -31,6 +75,6 @@ clean:
        @rm -f $(OBJS) *.so G__$(PACKAGE).*
 
 G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
-       @echo "Generating dictionary ..."
+       @echo "Generating dictionaries ..." $(ALICEINC)
        rootcint -f $@ -c $(CINTFLAGS) $(ALICEINC) $^