slicPandora
diff -u -r1.15 -r1.16
--- Makefile 16 Aug 2010 17:51:57 -0000 1.15
+++ Makefile 6 Oct 2010 20:59:54 -0000 1.16
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.15 2010/08/16 17:51:57 jeremy Exp $
+# $Id: Makefile,v 1.16 2010/10/06 20:59:54 jeremy Exp $
#
# Makefile for the slicPandora project. It requires that
@@ -35,14 +35,19 @@
# objects
OBJS=$(addsuffix .o, $(basename $(SRCS)))
+# ROOT libs, includes, flags
+ROOTLIBS=$(shell root-config --glibs --ldflags) -lEve -lTMVA -lGeom -lGed -lGLEW
+ROOTINCLUDES=$(shell root-config --incdir)
+ROOTFLAGS=$(shell root-config --cflags --auxcflags)
+
# include files
-INCDIR=$(PWD)/include
-INCLUDES=-I$(INCDIR) -I$(PANDORAPFA)/include -I$(LCIO)/src/cpp/include/
+INCDIR=$(PWD)/include
+INCLUDES=-I$(INCDIR) -I$(PANDORAPFA)/include -I$(LCIO)/src/cpp/include -I$(ROOTINCLUDES)
-# program libraries necessary for the build
-LIBS=-L$(PANDORAPFA)/lib -lPandoraPFANew -L$(LCIO)/lib -llcio -lsio
+# program libraries
+LIBS=-L$(PANDORAPFA)/lib -lPandoraPFANew -L$(LCIO)/lib -llcio -lsio $(ROOTLIBS)
-# program libraries necessary for runtime (includes build libs)
+# runtime libs
RUNLIBS=$(LIBS) -L$(PWD)/lib -l$(BINNAME)
# tests
@@ -51,6 +56,13 @@
# compiler flags
#CXXFLAGS=-v -Wall -g $(INCLUDES)
+CXXFLAGS=-Wall -g $(INCLUDES) -fPIC $(ROOTFLAGS)
+
+# tests
+TESTBINS=$(subst tests,bin,$(basename $(TESTSRCS)))
+TESTS=$(basename $(notdir $(TESTSRCS)))
+
+# compiler flags
CXXFLAGS=-Wall -g $(INCLUDES)
# Enable debug output for PFO creation.
@@ -69,11 +81,15 @@
endif
# Create library and tests.
-all: libs tests
+all: debug libs tests
# Default target.
.DEFAULT: all
+# Print build settings.
+debug:
+ @echo CXXFLAGS=$(CXXFLAGS); echo LIBS=$(LIBS); echo INCLUDES=$(INCLUDES)
+
# Make the lib directory.
libdir:
@mkdir -p $(PWD)/lib;
@@ -108,7 +124,7 @@
# Compile a test.
$(TESTS):
@echo "Compiling $@ ..."; \
- $(CXX) $(CXXFLAGS) $(RUNLIBS) -o ./bin/$@ $(PWD)[log in to unmask]
+ echo "$(CXX) $(CXXFLAGS) $(RUNLIBS) -o ./bin/$@ $(PWD)[log in to unmask]";
# Clean up the object files and build directories.
clean:
slicPandora
diff -u -r1.6 -r1.7
--- make_setup_script.sh 16 Aug 2010 17:51:57 -0000 1.6
+++ make_setup_script.sh 6 Oct 2010 20:59:54 -0000 1.7
@@ -1,12 +1,15 @@
#!/bin/sh
+# remove old setup
rm -rf ./mysetup.sh
+# Pandora
if [ -z "$PANDORAPFA" ]; then
echo "The PANDORAPFA variable is not set."
exit 1
fi
+# LCIO
if [ -z "$LCIO" ]; then
echo "The LCIO variable is not set."
exit 1
@@ -19,6 +22,29 @@
"#!/bin/bash
export PANDORAPFA=$PANDORAPFA" > mysetup.sh
+# lib path for basic deps
echo -e \
"export LCIO=$LCIO
-export LD_LIBRARY_PATH=${PANDORAPFA}/lib:${LCIO}/lib:${PWD}/lib:\$LD_LIBRARY_PATH" >> mysetup.sh
+export LD_LIBRARY_PATH=\${PANDORAPFA}/lib:\${LCIO}/lib:${PWD}/lib:\${LD_LIBRARY_PATH}" >> mysetup.sh
+
+# Pandora Monitoring
+if [ -n "$PANDORAMONITORING" ]; then
+ echo "PANDORAMONITORING=$PANDORAMONITORING"
+ echo -e "export PANDORAMONITORING=$PANDORAMONITORING" >> mysetup.sh
+ echo -e \
+ "export LD_LIBRARY_PATH=\${PANDORAMONITORING}/lib:\${LD_LIBRARY_PATH}" >> mysetup.sh
+else
+ echo "The PANDORAMONITORING variable is not set."
+ exit 1
+fi
+
+# ROOT
+if [ -n "$ROOTSYS" ]; then
+ echo "ROOTSYS=$ROOTSYS"
+ echo "export ROOTSYS=$ROOTSYS" >> mysetup.sh
+ echo -e \
+ "export LD_LIBRARY_PATH=\${ROOTSYS}/lib:\${LD_LIBRARY_PATH}" >> mysetup.sh
+else
+ echo "The ROOTSYS variable is not set."
+ exit 1
+fi