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