Compilation on Windows/Cygwin
[u/mrichter/AliRoot.git] / PWG0 / Makefile
CommitLineData
dc740de4 1# $Id$
2
f7a4a0ca 3include Makefile.arch
99326024 4
f2f977f4 5default-target: libPWG0base.so libPWG0dep.so libPWG0selectors.so
6
7ALICEINC = -I.
99326024 8
d4fe2555 9### define include dir for local case and par case
f7a4a0ca 10ifneq ($(ESD_INCLUDE),)
11 ALICEINC += -I../$(ESD_INCLUDE)
12 ifneq ($(STEERBase_INCLUDE),)
13 ALICEINC += -I../$(STEERBase_INCLUDE)
14 endif
15 ifneq ($(AOD_INCLUDE),)
16 ALICEINC += -I../$(AOD_INCLUDE)
17 endif
18 ifneq ($(ANALYSIS_INCLUDE),)
19 ALICEINC += -I../$(ANALYSIS_INCLUDE)
20 endif
21else
22 ifneq ($(ALICE_ROOT),)
23 ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN -I$(ALICE_ROOT)/RAW -I$(ALICE_ROOT)/TPC
d4fe2555 24else
d4fe2555 25 endif
26endif
99326024 27
7229e085 28# for building of PWG0dep.par
29ifneq ($(PWG0base_INCLUDE),)
30 ALICEINC += -I../$(PWG0base_INCLUDE)
31endif
32
16e24ca3 33CXXFLAGS += $(ALICEINC) -g
f2f977f4 34
35PACKAGE = PWG0base
36include lib$(PACKAGE).pkg
37
38DHDR_PWG0base := $(DHDR)
39HDRS_PWG0base := $(HDRS)
40SRCS_PWG0base := $(SRCS) G__$(PACKAGE).cxx
41OBJS_PWG0base := $(SRCS_PWG0base:.cxx=.o)
42
d4fe2555 43PARFILE = $(PACKAGE).par
44
f2f977f4 45lib$(PACKAGE).so: $(OBJS_PWG0base)
d4fe2555 46 @echo "Linking" $@ ...
47 @/bin/rm -f $@
10dc066e 48ifeq ($(ARCH),macosx)
d4fe2555 49 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
99326024 50else
f2f977f4 51 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
99326024 52endif
d4fe2555 53 @chmod a+x $@
99326024 54 @echo "done"
55
56%.o: %.cxx %.h
57 $(CXX) $(CXXFLAGS) -c $< -o $@
58
f2f977f4 59G__PWG0base.cxx G__PWG0base.h: $(HDRS_PWG0base) $(DHDR_PWG0base)
99326024 60 @echo "Generating dictionary ..."
99326024 61 rootcint -f $@ -c $(ALICEINC) $^
d4fe2555 62
f2f977f4 63clean:
64 @rm -f $(OBJS_PWG0base) $(OBJS_PWG0dep) $(OBJS_PWG0selectors) *.so G__PWG0base.* G__PWG0dep.* G__PWG0selectors.* $(PARFILE)
65
d4fe2555 66### CREATE PAR FILE
67
f2f977f4 68$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_PWG0base) $(SRCS_PWG0base) $(DHDR_PWG0base) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
d4fe2555 69 @echo "Creating archive" $@ ...
70 @tar cfzh $@ $(PACKAGE)
71 @rm -rf $(PACKAGE)
72 @echo "done"
73
74$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
75 @echo Copying $< to $@ with transformations
76 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
77 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
78
79$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
80 @echo Copying $< to $@
81 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 82 @cp -a $^ $@
d4fe2555 83
84$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
85 @echo Copying $< to $@
86 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 87 @cp -a -r $^ $@
d4fe2555 88
89$(PACKAGE)/%: %
90 @echo Copying $< to $@
91 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
0ab29cfa 92 @cp -a $< $@
d4fe2555 93
94test-%.par: %.par
95 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
96 @mkdir -p par-tmp
97 @cd par-tmp; tar xfz ../$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
98 @rm -rf par-tmp
99 @echo "INFO: Testing succeeded (already cleaned up)"
f2f977f4 100
101## libPWG0dep part
102include libPWG0dep.pkg
103
104DHDR_PWG0dep := $(DHDR)
105HDRS_PWG0dep := $(HDRS)
106SRCS_PWG0dep := $(SRCS) G__PWG0dep.cxx
107OBJS_PWG0dep := $(SRCS_PWG0dep:.cxx=.o)
108
109libPWG0dep.so: $(OBJS_PWG0dep)
110 @echo "Linking" $@ ...
111 @/bin/rm -f $@
10dc066e 112ifeq ($(ARCH),macosx)
f2f977f4 113 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
114else
115 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
116endif
117 @chmod a+x $@
118 @echo "done"
119
120G__PWG0dep.cxx G__PWG0dep.h: $(HDRS_PWG0dep) $(DHDR_PWG0dep)
121 @echo "Generating dictionary ..."
122 rootcint -f $@ -c $(ALICEINC) $^
123
124## libPWG0selectors part
125include libPWG0selectors.pkg
126
127DHDR_PWG0selectors := $(DHDR)
128HDRS_PWG0selectors := $(HDRS)
129SRCS_PWG0selectors := $(SRCS) G__PWG0selectors.cxx
130OBJS_PWG0selectors := $(SRCS_PWG0selectors:.cxx=.o)
131
132libPWG0selectors.so: $(OBJS_PWG0selectors)
133 @echo "Linking" $@ ...
134 @/bin/rm -f $@
10dc066e 135ifeq ($(ARCH),macosx)
f2f977f4 136 @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
137else
138 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ -o $@
139endif
140 @chmod a+x $@
141 @echo "done"
142
143G__PWG0selectors.cxx G__PWG0selectors.h: $(HDRS_PWG0selectors) $(DHDR_PWG0selectors)
144 @echo "Generating dictionary ..."
145 rootcint -f $@ -c $(ALICEINC) $^
146