-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
81 lines (64 loc) · 2.54 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
78
79
80
81
###################################################################
# This Makefile was created using the bat-project script
# for project DeepBayesIris
# 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 (models) sources used in the program
# Add classes to the end. Backslash indicates continuation
# on the next line
CXXSRCS = DeepBayesIris.cxx FeedForward.cxx
# List of all program sources used in the program
# Add classes to the end. Backslash indicates continuation
# on the next line
PRGSRCS = runDeepBayesIris.cxx predict.cxx
# compiler and flags
CXX = g++
CXXFLAGS = -g -O2 -Wall -fPIC -Wno-deprecated
#LD = /Library/Developer/CommandLineTools/usr/bin/ld
LD = /usr/bin/ld
LDFLAGS = -g -O2
# ----------------------------------------------------------------------
# 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) -lpthread
# ----------------------------------------------------------------------
# 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 $@
$(MYPROGS) : $(CXXOBJS)
$(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
#predict : predict.cxx FeedForward.o
# $(CXX) $(LDFLAGS) -stdlib=libc++ -std=c++11 -m64 $^ -o $@
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)