forked from PandoraPFA/LCContent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (61 loc) · 2.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ifndef PROJECT_DIR
PROJECT_DIR = $(PANDORA_DIR)/LCContent
PROJECT_LIBRARY_DIR = $(PANDORA_DIR)/lib
else
PROJECT_LIBRARY_DIR = $(PROJECT_DIR)/lib
endif
CC = g++
CFLAGS = -c -g -fPIC -O2 -Wall -Wextra -Werror -pedantic -Wno-long-long -Wno-sign-compare -Wshadow -fno-strict-aliasing -std=c++11
ifdef BUILD_32BIT_COMPATIBLE
CFLAGS += -m32
endif
LIBS = -L$(PANDORA_DIR)/lib -lPandoraSDK
ifdef MONITORING
LIBS += -lPandoraMonitoring
endif
ifdef BUILD_32BIT_COMPATIBLE
LIBS += -m32
endif
PROJECT_INCLUDE_DIR = $(PROJECT_DIR)/include/
PROJECT_LIBRARY = $(PROJECT_LIBRARY_DIR)/libLCContent.so
INCLUDES = -I$(PROJECT_INCLUDE_DIR)
INCLUDES += -I$(PANDORA_DIR)/PandoraSDK/include
ifdef MONITORING
INCLUDES += -I$(PANDORA_DIR)/PandoraMonitoring/include
endif
ifdef MONITORING
DEFINES = -DMONITORING=1
endif
SOURCES = $(wildcard $(PROJECT_DIR)/src/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCCheating/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCClustering/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCFragmentRemoval/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCHelpers/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCMonitoring/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCParticleId/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCPersistency/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCPfoConstruction/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCPlugins/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCReclustering/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCTopologicalAssociation/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCTrackClusterAssociation/*.cc)
SOURCES += $(wildcard $(PROJECT_DIR)/src/LCUtility/*.cc)
OBJECTS = $(SOURCES:.cc=.o)
DEPENDS = $(OBJECTS:.o=.d)
all: library
library: $(SOURCES) $(OBJECTS)
$(CC) $(OBJECTS) $(LIBS) -shared -o $(PROJECT_LIBRARY)
-include $(DEPENDS)
%.o:%.cc
$(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -MP -MMD -MT $*.o -MT $*.d -MF $*.d -o $*.o $*.cc
clean:
rm -f $(OBJECTS)
rm -f $(DEPENDS)
rm -f $(PROJECT_LIBRARY)
install:
ifdef INCLUDE_TARGET
rsync -r --include '*/' --include '*.h' --exclude '*' --prune-empty-dirs $(PROJECT_DIR)/ ${INCLUDE_TARGET}
endif
ifdef LIB_TARGET
cp $(PROJECT_LIBRARY) ${LIB_TARGET}
endif