Fixes for the creation of PAR files on Mac (Chiara, Gerri)
[u/mrichter/AliRoot.git] / TTherminator / Makefile
CommitLineData
2e967919 1# $Id$
2
3include $(ROOTSYS)/test/Makefile.arch
4
5default-target: libTTherminator.so
6
7ALICEINC = -I. -I$(ALICE_ROOT)/include -ITherminator
8
9### define include dir for local case and par case
10ifneq ($(ALICE_ROOT),)
11 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN -I$(ALICE_ROOT)/RAW -I$(ALICE_ROOT)/TPC
12else
13 ifneq ($(STEERBase_INCLUDE),)
14 ALICEINC += -I../$(STEERBase_INCLUDE)
15 endif
16 ifneq ($(ESD_INCLUDE),)
17 ALICEINC += -I../$(ESD_INCLUDE)
18 endif
19endif
20
21PACKAGE = TTherminator
2e967919 22
958d9d26 23DHDR =
24HDRS =
25SRCS =
26FSRCS =
2e967919 27DHDR_TTherminator := $(DHDR)
28HDRS_TTherminator := $(HDRS)
29SRCS_TTherminator := $(SRCS) G__$(PACKAGE).cxx
30OBJS_TTherminator := $(SRCS_TTherminator:.cxx=.o)
31
32PARFILE = $(PACKAGE).par
33
34lib$(PACKAGE).so: $(OBJS_TTherminator)
35 @echo "Linking" $@ ...
36 @/bin/rm -f $@
d86acb69 37ifeq ($(PLATFORM),macosx)
38# We need to make both the .dylib and the .so
39 $(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@
40ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
41ifeq ($(MACOSX_MINOR),4)
42 ln -sf $@ $(subst .$(DllSuf),.so,$@)
2e967919 43else
d86acb69 44 $(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
45 $(OutPutOpt) $(subst .$(DllSuf),.so,$@)
46endif
47endif
48else
49ifeq ($(PLATFORM),win32)
50 bindexplib $* $^ > $*.def
51 lib -nologo -MACHINE:IX86 $^ -def:$*.def \
52 $(OutPutOpt)$(EVENTLIB)
53 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
54 $(OutPutOpt)$@
55else
56 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
57endif
2e967919 58endif
59 @chmod a+x $@
60 @echo "done"
61
62%.o: %.cxx %.h
63 $(CXX) $(CXXFLAGS) -c $< -o $@ $(ALICEINC)
64
65G__TTherminator.cxx G__TTherminator.h: $(HDRS_TTherminator) $(DHDR_TTherminator)
66 @echo "Generating dictionary ..."
67 rootcint -f $@ -c $(ALICEINC) $^
68
69clean:
70 @rm -f $(OBJS_TTherminator) *.so G__TTherminator.* $(PARFILE)
71
72### CREATE PAR FILE
73
74$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_TTherminator) $(SRCS_TTherminator) $(DHDR_TTherminator) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
75 @echo "Creating archive" $@ ...
76 @tar cfzh $@ $(PACKAGE)
77 @rm -rf $(PACKAGE)
78 @echo "done"
79
80$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
81 @echo Copying $< to $@ with transformations
82 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
83 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
84
85$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
86 @echo Copying $< to $@
87 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
88 @cp -a $^ $@
89
90$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
91 @echo Copying $< to $@
92 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
93 @cp -a -r $^ $@
94
95$(PACKAGE)/%: %
96 @echo Copying $< to $@
97 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
98 @cp -a $< $@
99
100test-%.par: %.par
101 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
102 @mkdir -p par-tmp
103 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
104 @rm -rf par-tmp
105 @echo "INFO: Testing succeeded (already cleaned up)"
106