-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
58 lines (47 loc) · 1.37 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
ifndef PANDORA_LARCONTENT_DIR
PANDORA_LARCONTENT_DIR = $(PANDORA_DIR)/LArContent
endif
CC = g++
CFLAGS = -c -g -fPIC -O2 -Wall -Wextra -Werror -pedantic -Wno-long-long -Wno-sign-compare -Wshadow -fno-strict-aliasing -std=c++17
ifdef BUILD_32BIT_COMPATIBLE
CFLAGS += -m32
endif
LIBS = -L$(PANDORA_LARCONTENT_DIR)/lib -lLArContent
LIBS += -L$(PANDORA_DIR)/lib -lPandoraSDK
ifdef MONITORING
LIBS += $(shell root-config --glibs --evelibs)
LIBS += -lPandoraMonitoring
endif
ifdef BUILD_32BIT_COMPATIBLE
LIBS += -m32
endif
ifdef PANDORA_LIBTORCH
LIBS += -lLArDLContent
endif
PROJECT_BINARY = $(PROJECT_DIR)/bin/PandoraInterface
INCLUDES = -I $(PROJECT_DIR)/include/
INCLUDES += -I $(PANDORA_DIR)/PandoraSDK/include/
INCLUDES += -I $(PANDORA_LARCONTENT_DIR)/
ifdef MONITORING
INCLUDES += -I $(shell root-config --incdir)
INCLUDES += -I $(PANDORA_DIR)/PandoraMonitoring/include/
endif
ifdef MONITORING
DEFINES = -DMONITORING=1
endif
ifdef PANDORA_LIBTORCH
DEFINES += -DLIBTORCH_DL=1
endif
SOURCES = $(wildcard $(PROJECT_DIR)/test/*.cxx)
OBJECTS = $(SOURCES:.cxx=.o)
DEPENDS = $(OBJECTS:.o=.d)
all: binary
binary: $(OBJECTS)
$(CC) $(OBJECTS) $(LIBS) -o $(PROJECT_BINARY)
-include $(DEPENDS)
%.o:%.cxx
$(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -MP -MMD -MT $*.o -MT $*.d -MF $*.d -o $*.o $*.cxx
clean:
rm -f $(OBJECTS)
rm -f $(DEPENDS)
rm -f $(PROJECT_BINARY)