-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (70 loc) · 2.43 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
82
83
84
85
86
# C source code
CSRC = two_photos_psf_estim.c two_photos_psf_estim_main.c image.c ls.c io_pgm.c
# C++ source code
#Third-Party Software (ORSA-homography)
CXXSRC = ./third_party/lib_orsa_homography.cpp \
./third_party/OrsaHomography_20120515/src/libOrsa/conditioning.cpp \
./third_party/OrsaHomography_20120515/src/libOrsa/homography_model.cpp \
./third_party/OrsaHomography_20120515/src/libOrsa/orsa_model.cpp \
./third_party/OrsaHomography_20120515/src/extras/sift/demo_lib_sift.cpp \
./third_party/OrsaHomography_20120515/src/extras/sift/domain.cpp \
./third_party/OrsaHomography_20120515/src/extras/sift/filter.cpp \
./third_party/OrsaHomography_20120515/src/extras/sift/library.cpp \
./third_party/OrsaHomography_20120515/src/extras/sift/splines.cpp \
./third_party/OrsaHomography_20120515/src/extras/libNumerics/matrix.cpp \
./third_party/OrsaHomography_20120515/src/extras/libNumerics/numerics.cpp \
./third_party/OrsaHomography_20120515/src/extras/libNumerics/vector.cpp
# all source code
SRC = $(CSRC) $(CXXSRC)
# C objects
COBJ = $(CSRC:.c=.o)
# C++ objects
CXXOBJ = $(CXXSRC:.cpp=.o)
# all objects
OBJ = $(COBJ) $(CXXOBJ)
# binary target
BIN = two_photos_psf_estim
default : $(BIN)
# C optimization flags
COPT = -O3 -ftree-vectorize -funroll-loops
COPT = -g
# C++ optimization flags
CXXOPT = $(COPT)
# C compilation flags
CFLAGS = $(COPT) -Wall -Wextra -Wno-write-strings -ansi
# C++ compilation flags
CXXFLAGS = $(CXXOPT) -Wall -Wextra \
-Wno-write-strings -Wno-deprecated -ansi
# link flags
LDFLAGS = -lm -lfftw3f -lblas -llapack -lstdc++ -lgomp
# include dir for fftw, lapack, blas
INCDIR=-I/usr/local/include \
-I./third_party/OrsaHomography_20120515/src/demo \
-I./third_party/OrsaHomography_20120515/src/extras \
-I./third_party/OrsaHomography_20120515/src/extras/libMatch \
-I./third_party/OrsaHomography_20120515/src
LIBDIR=-L/usr/local/lib
# use openMP with `make OMP=1`
ifdef OMP
CFLAGS += -fopenmp
CXXFLAGS += -fopenmp
LDFLAGS += -lgomp
else
CFLAGS += -Wno-unknown-pragmas
CXXFLAGS += -Wno-unknown-pragmas
endif
# partial compilation of C source code
%.o: %.c %.h
$(CC) $(INCDIR) -c -o $@ $< $(CFLAGS)
# partial compilation of C++ source code
%.o: %.cpp
$(CXX) $(INCDIR) -c -o $@ $< $(CXXFLAGS)
# link all the opject code
$(BIN): $(OBJ) $(LIBDEPS)
$(CXX) $(LIBDIR) -o $@ $(OBJ) $(LDFLAGS)
# housekeeping
.PHONY : clean distclean
clean :
$(RM) $(OBJ)
distclean : clean
$(RM) $(BIN)