Update
[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 $@
10dc066e 37ifeq ($(ARCH),macosx)
2e967919 38 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
39else
40 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
41endif
42 @chmod a+x $@
43 @echo "done"
44
45%.o: %.cxx %.h
46 $(CXX) $(CXXFLAGS) -c $< -o $@ $(ALICEINC)
47
48G__TTherminator.cxx G__TTherminator.h: $(HDRS_TTherminator) $(DHDR_TTherminator)
49 @echo "Generating dictionary ..."
50 rootcint -f $@ -c $(ALICEINC) $^
51
52clean:
53 @rm -f $(OBJS_TTherminator) *.so G__TTherminator.* $(PARFILE)
54
55### CREATE PAR FILE
56
57$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_TTherminator) $(SRCS_TTherminator) $(DHDR_TTherminator) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
58 @echo "Creating archive" $@ ...
59 @tar cfzh $@ $(PACKAGE)
60 @rm -rf $(PACKAGE)
61 @echo "done"
62
63$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
64 @echo Copying $< to $@ with transformations
65 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
66 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
67
68$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
69 @echo Copying $< to $@
70 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
71 @cp -a $^ $@
72
73$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
74 @echo Copying $< to $@
75 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
76 @cp -a -r $^ $@
77
78$(PACKAGE)/%: %
79 @echo Copying $< to $@
80 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
81 @cp -a $< $@
82
83test-%.par: %.par
84 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
85 @mkdir -p par-tmp
86 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
87 @rm -rf par-tmp
88 @echo "INFO: Testing succeeded (already cleaned up)"
89