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