-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
77 lines (61 loc) · 2.4 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
74
75
76
77
###################################################################
# This Makefile was created using the bat-project script
# for project BAT_GraphFit
# bat-project is part of Bayesian Analysis Toolkit (BAT).
# BAT can be downloaded from http://mpp.mpg.de/bat
###################################################################
#
# Run 'make' to compile the program and 'make clean' to remove
# all compiled parts and 'clean' the directory.
#
# You might need to adjust the CXXFLAGS and LIBS based on
# the BAT installation on your system. Consult the gmake manual
# for details.
#
###################################################################
# List of all class (model) sources used in the program,
# separated by spaces. A backslash indicates continuation
# on the next line
CXXSRCS = 'src/BAT_GraphFit.cxx' 'src/BatGraphFitter.cxx'
# List of all program sources used in the program,
# separated by spaces. A backslash indicates continuation
# on the next line
PRGSRCS = macros/CUPID_Sens.cxx
# compiler and flags
CXX = g++
CXXFLAGS = -g -O3 -Wall -fPIC -Wno-deprecated
LD = /usr/bin/ld -m elf_x86_64
LDFLAGS = -g -O3
# ----------------------------------------------------------------------
# The following definitions rely on the script bat-config being
# available in $PATH. If BAT is not installed in the standard system
# directories, update $PATH accordingly.
CXXFLAGS += $(shell bat-config --cflags)
LIBS := $(shell bat-config --libs)
# ----------------------------------------------------------------------
# don't change lines below unless you know what you're doing
#
CXXOBJS = $(addsuffix .o,$(basename $(CXXSRCS)))
MYPROGS = $(basename $(PRGSRCS))
PRGOBJS = $(addsuffix .o,$(basename $(PRGSRCS)))
GARBAGE = $(CXXOBJS) $(PRGOBJS) link.d $(MYPROGS)
# targets
all : $(MYPROGS)
.PHONY : all clean print
link.d : $(addsuffix .h,$(basename $(CXXSRCS))) $(CXXSRCS) $(PRGSRCS)
$(CXX) -MM $(CXXFLAGS) $(filter-out %.h,$^) > link.d;
@$(foreach prog,$(MYPROGS), echo $(prog) : $(prog).o >> link.d;)
-include link.d
$(CXXOBJS) $(PRGOBJS) :
$(CXX) $(CXXFLAGS) -c $(filter $(basename $@).%,$(filter-out %.h,$^)) -o bin/$@
$(MYPROGS) : $(CXXOBJS)
$(CXX) $(LDFLAGS) $^ $(LIBS) -o bin/$@
clean :
rm -f $(GARBAGE)
print :
@echo compiler : $(CXX)
@echo c++ srcs : $(CXXSRCS) $(PRGSRCS)
@echo c++ objs : $(CXXOBJS) $(PRGOBJS)
@echo c++ flags : $(CXXFLAGS)
@echo ld flags : $(LDFLAGS)
@echo libs : $(LIBS)