-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (26 loc) · 881 Bytes
/
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
SRCDIR = src
SRCS := $(wildcard $(SRCDIR)/*.cxx)
PROGS=FillHistograms
OBJDIR = obj
OBJS := $(SRCS:$(SRCDIR)/%.cxx=$(OBJDIR)/%.o)
LD=g++
CXXFLAGS = -g -O0 -W -Wall -Wextra -pedantic -std=c++11 -MP -MD
INCLUDEFLAGS = -I./include
ROOTLIBS = `root-config --libs` -lFoam -lMinuit -lTreePlayer #-lXMLParser
ROOTCFLAGS = $(shell root-config --cflags)
ROOTGLIBS = $(shell root-config --glibs)
PWD = $(shell pwd)
MKDIR_P = mkdir -p
COMMONOBJS1 = $(OBJS)
COMMONOBJS = $(filter-out $(OBJDIR)/FillHistograms.o, $(COMMONOBJS1))
all: $(PROGS)
$(OBJS): | ${OBJDIR}
$(OBJDIR):
mkdir -p $(OBJDIR)
$(OBJDIR)/%.o : $(SRCDIR)/%.cxx
$(CXX) $(CXXFLAGS) $(ROOTCFLAGS) $(INCLUDEFLAGS) -c $< -o $@
$(PROGS): $(OBJS) ${COMMONOBJS}
$(LD) -o $@ ${COMMONOBJS} ${OBJDIR}/[email protected] -lz $(ROOTLIBS)
-include $(OBJS:.o=.d)
clean:
rm *.o *.d $(OBJDIR)/*.o $(OBJDIR)/*.d $(PROGS) 2> /dev/null || true