PAR: includes from previously enabled PARfiles
[u/mrichter/AliRoot.git] / cmake / PARfiles / Makefile.in
CommitLineData
b24da1d3 1# Makefile for @PARMODULE@ -- automatically generated
2
0f52e1c4 3# Include this file from the ROOT installed on the system where we are using the PARfile
4include $(shell root-config --etcdir)/Makefile.arch
b24da1d3 5
6# Name of this module
7PAR_MODULE := @PARMODULE@
8
0c9d4db8 9# This module depends on the following libraries
10PAR_LIBDEPS := @PARLIBDEPS@
11
a9eacf03 12# Current OS
13OS := $(shell uname)
14
5fc5c635 15# Include paths: take into consideration "extra includes" (manually entered by users) and includes
16# from other previously enabled PARfiles
42ad3e35 17PAR_EXTRAINCLUDES = @PAREXTRAINCLUDES@
5fc5c635 18PAR_INCLUDES = -I. $(addprefix -I../,$(ALICE_PARFILES_ENABLED)) $(addprefix -I,$(PAR_EXTRAINCLUDES)) -I$(ALICE_ROOT)/include -I$(ALICE_PHYSICS)/include -I$(shell root-config --incdir)
0798b0ca 19ifneq ($(FASTJET),)
20 PAR_INCLUDES += -I$(FASTJET)/include
21endif
b24da1d3 22
6358896a 23# Get C++ flags form ROOT
24PAR_CXXFLAGS = $(CXXFLAGS) $(PAR_INCLUDES)
b24da1d3 25
6358896a 26# Get linker flags from ROOT
27PAR_SOFLAGS = $(SOFLAGS) $(LDFLAGS)
a9eacf03 28ifeq ($(OS),Darwin)
29 # Only on OS X
30 PAR_SOFLAGS += -undefined dynamic_lookup
31endif
b24da1d3 32
a2840dc4 33# Get some ROOT build flags from the current installation
34ROOT_DEFINES += $(shell root-config --features | grep -q xml && echo '-DWITHXML')
35ROOT_DEFINES += $(shell root-config --features | grep -q alien && echo '-DWITHALIEN')
ed0d5f1d 36ifneq ($(FASTJET),)
37 ROOT_DEFINES += -DHAVE_FASTJET
38endif
a2840dc4 39
3c3403d8 40SRCS := @PARSOURCES_FLAT@
a05f4fbd 41HDRS := @PARHEADERS_FLAT@
b24da1d3 42
6358896a 43DHDR := $(PAR_MODULE)LinkDef.h
44
45SRCS += G__$(PAR_MODULE).cxx
46OBJS := $(SRCS:.cxx=.o)
47
48COLM := \033[35m
49COLC := \033[36m
50COLG := \033[32m
51COLZ := \033[m
52
17e95a2b 53# Multiplatform echo. Interprets escapes. Use it with $(call ECHO,"<message>")
54ECHO = printf $(1)"\n"
55
6358896a 56# Default rule (it's the first one, "all" is just a convention)
0c9d4db8 57all: lib$(PAR_MODULE).rootmap lib$(PAR_MODULE).so
17e95a2b 58 @$(call ECHO,"[$(COLM)$(PAR_MODULE)$(COLZ)] $(COLG)PARfile built successfully$(COLZ)")
6358896a 59
60# Abstract rule to compile classes to objects
b24da1d3 61%.o: %.cxx %.h
17e95a2b 62 @$(call ECHO,"[$(COLM)$(PAR_MODULE)$(COLZ)] compiling $(COLC)$<$(COLZ)")
6358896a 63 @$(CXX) $(PAR_CXXFLAGS) -c $< -o $@
b24da1d3 64
65# Generate library from objects
6358896a 66lib$(PAR_MODULE).so: $(OBJS)
17e95a2b 67 @$(call ECHO,"[$(COLM)$(PAR_MODULE)$(COLZ)] building shared library")
6358896a 68 @$(LD) $(PAR_SOFLAGS) $^ -o $@ $(EXPLLINKLIBS)
b24da1d3 69
8409a855 70# Generate dictionary (rule broken up to accommodate parallel builds)
71G__$(PAR_MODULE).h: G__$(PAR_MODULE).cxx
72
73G__$(PAR_MODULE).cxx: $(HDRS) $(DHDR)
17e95a2b 74 @$(call ECHO,"[$(COLM)$(PAR_MODULE)$(COLZ)] generating dictionary")
a2840dc4 75 @rootcint -f $@ -c -p $(ROOT_DEFINES) $(PAR_INCLUDES) $^
b24da1d3 76
0c9d4db8 77# Generate rootmap (for automatic loading of libraries)
78lib$(PAR_MODULE).rootmap: lib$(PAR_MODULE).so
17e95a2b 79 @$(call ECHO,"[$(COLM)$(PAR_MODULE)$(COLZ)] generating rootmap")
0c9d4db8 80 @rlibmap -o $@ -l lib$(PAR_MODULE) -d $(PAR_LIBDEPS) -c $(DHDR)
81
b24da1d3 82# Delete all
83clean:
0c9d4db8 84 rm -f $(OBJS) *.so G__$(PAR_MODULE).* *.rootmap