Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7876926
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Subscribers
None
View Options
diff --git a/Makefile b/Makefile
index 90afd88..bfd4add 100644
--- a/Makefile
+++ b/Makefile
@@ -1,149 +1,148 @@
##########################################################################
# Copyright University of Warwick 2004 - 2013. #
# Distributed under the Boost Software License, Version 1.0. #
# (See accompanying file LICENSE_1_0.txt or copy at #
# http://www.boost.org/LICENSE_1_0.txt) #
# #
# Authors: #
# Thomas Latham #
# John Back #
# Paul Harrison #
# #
# ------------------------------- #
# Standalone Makefile for Laura++ #
# ------------------------------- #
# #
# Instructions #
# - Review 'external configuration' section below #
# to match systems compilers setup #
# #
# - Make sure the ROOTSYS environment variable is set and points #
# to your ROOT release or the root-config script is in your PATH #
# #
# - run 'make <target>' #
# #
# Build targets #
# lib - make libLaura++.a #
# shlib - make libLaura++.so (default) #
# clean - delete all intermediate and final build objects #
# #
##########################################################################
# --- External configuration ----------------------------------
# first check that ROOTSYS is defined
ifndef ROOTSYS
- ROOTSYS = $(shell root-config --prefix)
- ROOTBINDIR = $(shell root-config --bindir)
+ ROOTSYS := $(shell root-config --prefix)
+ ROOTBINDIR := $(shell root-config --bindir)
ifeq ($(ROOTSYS), )
$(error running of root-config failed or reported null value)
endif
else
- ROOTBINDIR = $(ROOTSYS)/bin
+ ROOTBINDIR := $(ROOTSYS)/bin
endif
ROOTCONFIG := $(ROOTBINDIR)/root-config
ARCH := $(shell $(ROOTCONFIG) --arch)
PLATFORM := $(shell $(ROOTCONFIG) --platform)
INCLUDES =
SRCDIR = src
INCDIR = inc
LIBDIR = lib
WORKDIR = tmp
ifeq ($(findstring linux, $(ARCH)),linux)
# This set here should work for Linux.
CXX = g++
LD = g++
CXXFLAGS = -g -O2 -Wall -Wextra -Wshadow -Woverloaded-virtual -fPIC
MFLAGS = -MM
SOFLAGS = -shared
endif
ifeq ($(ARCH),macosx64)
# For Mac OS X you may need to put -m64 in CXXFLAGS and SOFLAGS.
CXX = g++
LD = g++
CXXFLAGS = -g -O3 -Wall -Wextra -Wshadow -Woverloaded-virtual -fPIC -m64
MFLAGS = -MM
SOFLAGS = -m64 -dynamiclib -single_module -undefined dynamic_lookup
endif
# --- Internal configuration ----------------------------------
PACKAGE=Laura++
DEPDIR=$(WORKDIR)/dependencies
OBJDIR=$(WORKDIR)/objects
-VPATH=$(INCDIR) $(OBJDIR)
INCLUDES += -I$(INCDIR) -I$(shell $(ROOTBINDIR)/root-config --incdir)
CXXFLAGS += $(INCLUDES)
SKIPLIST = test.cc
CINTFILE = $(WORKDIR)/$(PACKAGE)Cint.cc
CINTOBJ = $(OBJDIR)/$(PACKAGE)Cint.o
LIBFILE = $(LIBDIR)/lib$(PACKAGE).a
SHLIBFILE = $(LIBDIR)/lib$(PACKAGE).so
default: shlib
# List of all header files
-HHLIST=$(wildcard $(INCDIR)/*.hh)
+HHLIST:=$(wildcard $(INCDIR)/*.hh)
# List of all source files to build
-CCLIST=$(filter-out $(SKIPLIST),$(wildcard $(SRCDIR)/*.cc))
+CCLIST:=$(filter-out $(SKIPLIST),$(wildcard $(SRCDIR)/*.cc))
# List of all object files to build
-OLIST=$(patsubst %.cc,%.o,$(addprefix $(OBJDIR)/,$(notdir $(CCLIST))))
+OLIST:=$(patsubst %.cc,%.o,$(addprefix $(OBJDIR)/,$(notdir $(CCLIST))))
# List of all dependency file to make
-DLIST=$(patsubst %.hh,%.d,$(addprefix $(DEPDIR)/,$(notdir $(HHLIST))))
+DLIST:=$(patsubst %.hh,%.d,$(addprefix $(DEPDIR)/,$(notdir $(HHLIST))))
# Implicit rule making all dependency Makefiles included at the end of this makefile
-$(DEPDIR)/%.d: $(SRCDIR)/%.cc $(HHLIST)
+$(DEPDIR)/%.d: $(SRCDIR)/%.cc
@echo "Making $@"
@mkdir -p $(DEPDIR)
@set -e; $(CXX) $(MFLAGS) $(CXXFLAGS) $< \
- | sed 's/\($(notdir $*)\)\.o[ :]*/\1.o $(notdir $@) : /g' > $@; \
+ | sed 's#\($(notdir $*)\)\.o[ :]*#$(OBJDIR)/\1.o $@ : #g' > $@; \
[ -s $@ ] || rm -f $@
# Implicit rule to compile all classes
$(OBJDIR)/%.o : $(SRCDIR)/%.cc
@echo "Compiling $<"
@mkdir -p $(OBJDIR)
@$(CXX) $(CXXFLAGS) -c $< -o $@
# Rule to make ROOTCINT output file
$(CINTOBJ): $(HHLIST) $(INCDIR)/$(PACKAGE)_LinkDef.h
@mkdir -p $(OBJDIR)
@echo "Running rootcint"
@$(ROOTBINDIR)/rootcint -f $(CINTFILE) -c $(INCLUDES) $(notdir $(HHLIST)) $(INCDIR)/$(PACKAGE)_LinkDef.h
@echo "Compiling $(CINTFILE)"
@$(CXX) $(CXXFLAGS) -c $(CINTFILE) -o $(CINTOBJ)
# Rule to combine objects into a library
$(LIBFILE): $(OLIST) $(CINTOBJ)
@echo "Making $(LIBFILE)"
@mkdir -p $(LIBDIR)
@rm -f $(LIBFILE)
@ar rcs $(LIBFILE) $(OLIST) $(CINTOBJ)
# Rule to combine objects into a shared library
$(SHLIBFILE): $(OLIST) $(CINTOBJ)
@echo "Making $(SHLIBFILE)"
@mkdir -p $(LIBDIR)
@rm -f $(SHLIBFILE)
@$(CXX) $(OLIST) $(CINTOBJ) $(SOFLAGS) -o $(SHLIBFILE)
# Useful build targets
lib: $(LIBFILE)
shlib: $(SHLIBFILE)
clean:
rm -rf $(WORKDIR)
rm -f $(LIBFILE)
rm -f $(SHLIBFILE)
.PHONY : shlib lib default clean
-include $(DLIST)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 2:37 PM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3804772
Default Alt Text
(6 KB)
Attached To
rLAURA laura
Event Timeline
Log In to Comment