make target for creating PROOF par archive: PWG0base.par and for testing test-PWG0bas...
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 May 2006 17:08:19 +0000 (17:08 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 May 2006 17:08:19 +0000 (17:08 +0000)
PROOF-INF directory

PWG0/Makefile
PWG0/PROOF-INF.PWG0base/BUILD.sh [new file with mode: 0755]
PWG0/PROOF-INF.PWG0base/SETUP.C [new file with mode: 0644]

index abe2ddf31a86dc31d89fa39d99161bc2562df4a0..6fcfbf249326c2212069daff4695602dda8e9b22 100644 (file)
@@ -1,32 +1,80 @@
+PACKAGE = PWG0base
+
 include $(ROOTSYS)/test/Makefile.arch
-include libPWG0base.pkg
+include lib$(PACKAGE).pkg
 
-ALICEINC = -I$(ALICE_ROOT)/include
-CXXFLAGS += $(ALICEINC)
-SRCS += dict.cxx
-OBJS          = $(SRCS:.cxx=.o)
-PROGRAM       = libPWG0.so
+ALICEINC      = -I. 
 
-all:          $(PROGRAM)
+### define include dir for local case and par case
+ifneq ($(ALICE_ROOT),)
+  ALICEINC += -I$(ALICE_ROOT)/include
+else
+  ifneq ($(STEER_INCLUDE),)
+    ALICEINC += -I../$(STEER_INCLUDE)
+  endif
+  ifneq ($(ESD_INCLUDE),)
+    ALICEINC += -I../$(ESD_INCLUDE)
+  endif
+endif
 
-$(PROGRAM):     $(OBJS)
-       @echo "Linking" $(PROGRAM) ...
-       @/bin/rm -f $(PROGRAM)
+CXXFLAGS     += $(ALICEINC)
+SRCS         += dict.cxx
+OBJS          = $(SRCS:.cxx=.o)
+PARFILE       = $(PACKAGE).par
+
+lib$(PACKAGE).so: $(OBJS)
+       @echo "Linking" $@ ...
+       @/bin/rm -f $@
 ifeq ($(PLATFORM),macosx)
-       @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $(PROGRAM)
+       @$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ -o $@
 else
-       @$(LD) $(SOFLAGS) $(LDFLAGS) $(OBJS) -o $(PROGRAM)
+       @$(LD) $(SOFLAGS) $(LDFLAGS) $(OBJS) -o $@
 endif
-       @chmod a+x $(PROGRAM)
+       @chmod a+x $@
        @echo "done"
 
 %.o:    %.cxx %.h
        $(CXX) $(CXXFLAGS) -c $< -o $@
 
 clean:
-       @rm -f $(OBJS) core *~ *.so dict.*
+       @rm -f $(OBJS) core *~ *.so dict.* $(PARFILE)
 
 dict.cxx dict.h: $(HDRS) $(DHDR)
        @echo "Generating dictionary ..."
        @[ -f dict ] || rm -f $@
        rootcint -f $@ -c $(ALICEINC) $^
+
+### CREATE PAR FILE
+
+$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out dict.%, $(HDRS) $(SRCS) $(DHDR) $(PKGFILE) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
+       @echo "Creating archive" $@ ...
+       @tar cfzh $@ $(PACKAGE)
+       @rm -rf $(PACKAGE)
+       @echo "done"
+
+$(PACKAGE)/Makefile: Makefile #.$(PACKAGE)
+       @echo Copying $< to $@ with transformations
+       @[ -d $(dir $@) ] || mkdir -p $(dir $@)
+       @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/' < $^ > $@
+
+$(PACKAGE)/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
+       @echo Copying $< to $@
+       @[ -d $(dir $@) ] || mkdir -p $(dir $@)
+       @cp $^ $@
+
+$(PACKAGE)/PROOF-INF: PROOF-INF.$(PACKAGE)
+       @echo Copying $< to $@
+       @[ -d $(dir $@) ] || mkdir -p $(dir $@)
+       @cp -r $^ $@
+
+$(PACKAGE)/%: %
+       @echo Copying $< to $@
+       @[ -d $(dir $@) ] || mkdir -p $(dir $@)
+       @cp $< $@
+
+test-%.par: %.par
+       @echo "INFO: The file $< is now tested, in case of an error check in par-tmp."
+       @mkdir -p par-tmp
+       @cd par-tmp; tar xfz ../$<;     cd $(subst .par,,$<); PROOF-INF/BUILD.sh
+       @rm -rf par-tmp
+       @echo "INFO: Testing succeeded (already cleaned up)"
diff --git a/PWG0/PROOF-INF.PWG0base/BUILD.sh b/PWG0/PROOF-INF.PWG0base/BUILD.sh
new file mode 100755 (executable)
index 0000000..fc9490a
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+make 
diff --git a/PWG0/PROOF-INF.PWG0base/SETUP.C b/PWG0/PROOF-INF.PWG0base/SETUP.C
new file mode 100644 (file)
index 0000000..00817ca
--- /dev/null
@@ -0,0 +1,6 @@
+void SETUP()
+{
+   // Set the Inlucde paths
+   gSystem->SetIncludePath("-I$ROOTSYS/include -IPWG0base");
+   gROOT->ProcessLine(".include PWG0base");
+}