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