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 |
2e967919 |
22 | |
958d9d26 |
23 | DHDR = |
24 | HDRS = |
25 | SRCS = |
26 | FSRCS = |
2e967919 |
27 | DHDR_TTherminator := $(DHDR) |
28 | HDRS_TTherminator := $(HDRS) |
29 | SRCS_TTherminator := $(SRCS) G__$(PACKAGE).cxx |
30 | OBJS_TTherminator := $(SRCS_TTherminator:.cxx=.o) |
31 | |
32 | PARFILE = $(PACKAGE).par |
33 | |
34 | lib$(PACKAGE).so: $(OBJS_TTherminator) |
35 | @echo "Linking" $@ ... |
36 | @/bin/rm -f $@ |
10dc066e |
37 | ifeq ($(ARCH),macosx) |
2e967919 |
38 | @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@ |
39 | else |
40 | @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@ |
41 | endif |
42 | @chmod a+x $@ |
43 | @echo "done" |
44 | |
45 | %.o: %.cxx %.h |
46 | $(CXX) $(CXXFLAGS) -c $< -o $@ $(ALICEINC) |
47 | |
48 | G__TTherminator.cxx G__TTherminator.h: $(HDRS_TTherminator) $(DHDR_TTherminator) |
49 | @echo "Generating dictionary ..." |
50 | rootcint -f $@ -c $(ALICEINC) $^ |
51 | |
52 | clean: |
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 | |
83 | test-%.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 | |