slicPandora
diff -u -r1.4 -r1.5
--- Makefile 13 Jan 2010 04:19:55 -0000 1.4
+++ Makefile 9 Feb 2010 00:05:09 -0000 1.5
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 2010/01/13 04:19:55 jeremy Exp $
+# $Id: Makefile,v 1.5 2010/02/09 00:05:09 jeremy Exp $
ifndef PANDORAPFA
$(error Set PANDORAPFA env var to location of Pandora PFA New.)
@@ -8,27 +8,36 @@
$(error Set LCIO env var to location of standalone LCIO project.)
endif
+# tools
CXX=g++
AR=ar
+# binary name
BINNAME=slicPandora
+# sources
SRCDIR=$(PWD)/src
SRCS=$(wildcard $(SRCDIR)/*.cpp)
TESTSRCS=$(wildcard $(PWD)/tests/*.cpp)
+# objects
OBJS=$(addsuffix .o, $(basename $(SRCS)))
+# includes
INCDIR=$(PWD)/include
INCLUDES=-I$(INCDIR) -I$(PANDORAPFA)/include -I$(LCIO)/src/cpp/include/
+# libs
LIBS=-L$(PANDORAPFA)/lib -lPandoraPFANew -L$(LCIO)/lib -llcio -lsio
+# tests
TESTLIBS=$(LIBS) -L$(PWD)/lib -l$(BINNAME)
TESTBINS=$(subst tests,bin,$(basename $(TESTSRCS)))
TESTOBJ=$(addsuffix .o, $(basename $(TESTSRCS)))
TESTSCRIPT=$(PWD)/scripts/run_test.sh
TESTRUN=$(addsuffix _run,$(TESTBINS))
+
+# flags
CXXFLAGS=-Wall -g $(INCLUDES)
# Create bin, static lib, and shared lib.
@@ -43,11 +52,11 @@
# Create .o files from .cpp files.
%.o: %.cpp
- @$(CXX) -c $(CXXFLAGS) -o $@ $<
+ @echo "Compiling $< ..."; $(CXX) -c $(CXXFLAGS) -o $@ $<
# Create all the .o files.
obj:
- @$(MAKE) $(OBJS)
+ @$(MAKE) -s $(OBJS)
# Create a static library.
lib: libdir obj
@@ -64,7 +73,7 @@
# Compile all the tests.
tests: bindir lib shlib
@echo $(TESTBINS); \
- $(MAKE) $(TESTBINS)
+ $(MAKE) -s $(TESTBINS)
# Run a single test.
# These are named like ${BINNAME}_run to avoid conflicts with other targets.
@@ -76,7 +85,7 @@
@rm -f $(PWD)/test.log; \
for testrun in $(TESTRUN); do \
echo "Running test case: $$testrun"; \
- $(MAKE) $$testrun; \
+ $(MAKE) -s $$testrun; \
done;
FORCE:
@@ -91,4 +100,4 @@
# Create the bin directory.
bindir:
- @mkdir -p $(PWD)/bin;
\ No newline at end of file
+ @mkdir -p $(PWD)/bin;