-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (45 loc) · 1.32 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
#!/bin/make
SHELL=/bin/bash
#Define the virtual paths
vpath %.cpp src/
vpath %.hpp inc/
vpath %.o obj/
#Set some of the compile options
CXX = g++
CINCLUDEDIRS = -Iinc
CXXFLAGS = -fPIC -g -std=c++11 -Wall $(CINCLUDEDIRS)
LDLIBS = -ldl -lpthread
c++SrcSuf = cpp
#Add the root information to the compilation
CXXFLAGS += $(shell root-config --cflags)
LDFLAGS += $(shell root-config --ldflags)
LDLIBS += $(shell root-config --libs)
#Set the name of the program to be compiled
PROGRAM = traceFit
#Define Objects
MAINO = main.o
CSIFUNCTIONO = CsiFunction.o
VANDLETIMINGO = VandleTimingFunction.o
EMCALTIMINGO = EmCalTimingFunction.o
SIPMTFASTTIMINGO = SiPmtFastTimingFunction.o
TOKENIZERO = Tokenizer.o
TRACEO = Trace.o
INPUTHANDLERO = InputHandler.o
#Make the object list and prefix the object directory
OBJS = $(MAINO) $(VANDLETIMINGO) $(TRACEO) $(EMCALTIMINGO) $(TOKENIZERO)
OBJS += $(SIPMTFASTTIMINGO) $(INPUTHANDLERO) $(CSIFUNCTIONO)
OBJDIR = obj
OBJS_W_DIR = $(addprefix $(OBJDIR)/,$(OBJS))
.SUFFIXES: .$(c++SrcSuf)
all: $(OBJS_W_DIR) $(PROGRAM)
$(OBJS_W_DIR): | $(OBJDIR)
$(OBJDIR):
mkdir $(OBJDIR)
$(PROGRAM): $(OBJS_W_DIR)
$(CXX) $(CXXFLAGS) $(LDLIBS) $^ -o $@
$(OBJDIR)/%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
.PHONY: clean so
clean:
@echo "Cleaning..."
@rm -f $(OBJDIR)/*.o $(PROGRAM) *~ src/*~ include/*~