2e967919 |
1 | # $Id$ |
2 | |
3 | include $(ROOTSYS)/test/Makefile.arch |
4 | |
5 | default-target: libTTherminator.so |
6 | |
7 | ALICEINC = -I. -I$(ALICE_ROOT)/include -ITherminator |
8 | |
9 | ### define include dir for local case and par case |
10 | ifneq ($(ALICE_ROOT),) |
11 | ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN -I$(ALICE_ROOT)/RAW -I$(ALICE_ROOT)/TPC |
12 | else |
13 | ifneq ($(STEERBase_INCLUDE),) |
14 | ALICEINC += -I../$(STEERBase_INCLUDE) |
15 | endif |
16 | ifneq ($(ESD_INCLUDE),) |
17 | ALICEINC += -I../$(ESD_INCLUDE) |
18 | endif |
19 | endif |
20 | |
21 | PACKAGE = TTherminator |
22 | include lib$(PACKAGE).pkg |
23 | |
24 | DHDR_TTherminator := $(DHDR) |
25 | HDRS_TTherminator := $(HDRS) |
26 | SRCS_TTherminator := $(SRCS) G__$(PACKAGE).cxx |
27 | OBJS_TTherminator := $(SRCS_TTherminator:.cxx=.o) |
28 | |
29 | PARFILE = $(PACKAGE).par |
30 | |
31 | lib$(PACKAGE).so: $(OBJS_TTherminator) |
32 | @echo "Linking" $@ ... |
33 | @/bin/rm -f $@ |
34 | ifeq ($(PLATFORM),macosx) |
35 | @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@ |
36 | else |
37 | @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ |
38 | endif |
39 | @chmod a+x $@ |
40 | @echo "done" |
41 | |
42 | %.o: %.cxx %.h |
43 | $(CXX) $(CXXFLAGS) -c $< -o $@ $(ALICEINC) |
44 | |
45 | G__TTherminator.cxx G__TTherminator.h: $(HDRS_TTherminator) $(DHDR_TTherminator) |
46 | @echo "Generating dictionary ..." |
47 | rootcint -f $@ -c $(ALICEINC) $^ |
48 | |
49 | clean: |
50 | @rm -f $(OBJS_TTherminator) *.so G__TTherminator.* $(PARFILE) |
51 | |
52 | ### CREATE PAR FILE |
53 | |
54 | $(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_TTherminator) $(SRCS_TTherminator) $(DHDR_TTherminator) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF)) |
55 | @echo "Creating archive" $@ ... |
56 | @tar cfzh $@ $(PACKAGE) |
57 | @rm -rf $(PACKAGE) |
58 | @echo "done" |
59 | |
60 | $(PACKAGE)/Makefile: Makefile #.$(PACKAGE) |
61 | @echo Copying $< to $@ with transformations |
62 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) |
63 | @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@ |
64 | |
65 | $(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch |
66 | @echo Copying $< to $@ |
67 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) |
68 | @cp -a $^ $@ |
69 | |
70 | $(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE) |
71 | @echo Copying $< to $@ |
72 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) |
73 | @cp -a -r $^ $@ |
74 | |
75 | $(PACKAGE)/%: % |
76 | @echo Copying $< to $@ |
77 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) |
78 | @cp -a $< $@ |
79 | |
80 | test-%.par: %.par |
81 | @echo "INFO: The file $< is now tested, in case of an error check in par-tmp." |
82 | @mkdir -p par-tmp |
83 | @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh |
84 | @rm -rf par-tmp |
85 | @echo "INFO: Testing succeeded (already cleaned up)" |
86 | |