-
Notifications
You must be signed in to change notification settings - Fork 419
/
Makefile.inc
54 lines (42 loc) · 1.45 KB
/
Makefile.inc
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
# Default values.
CXX ?= g++
CXXWARNINGS ?= -Wall -Wextra -Wundef -pedantic
CXXINTRINSICS ?= -march=native
CXXFEATURES ?= -funsafe-math-optimizations -fno-math-errno -std=c++14
CXXFLAGS ?= ${CXXWARNINGS} ${CXXINTRINSICS} ${CXXFEATURES} -g -O3
# Delete this if OpenMP is not available (e.g., OS X without gcc)
OPENMP ?= -fopenmp
# Always compile programs and libs with multi-threading.
CXXFLAGS += -pthread
UNAME = $(shell uname)
ifeq (${UNAME},Darwin)
CXXFLAGS += -DGL_SILENCE_DEPRECATION=1
OPENMP =
endif
LIBJPEG_CFLAGS = `pkg-config --cflags libjpeg`
LIBJPEG_LDFLAGS = `pkg-config --libs libjpeg`
LIBPNG_CFLAGS = `pkg-config --cflags libpng`
LIBPNG_LDFLAGS = `pkg-config --libs libpng`
LIBTIFF_CFLAGS = `pkg-config --cflags libtiff-4`
LIBTIFF_LDFLAGS = `pkg-config --libs libtiff-4`
COMPILE.cc = ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
LINK.o = ${CXX} ${LDFLAGS}
.DEFAULT_GOAL := ${TARGET}
# How to link example from example.o and other files.
%: %.o
${LINK.o} -o $@ $^ ${LDLIBS}
# How to compile example.o from example.cc.
%.o: %.cc
${COMPILE.cc} -o $@ $<
# Library paths.
vpath libmve_dmrecon.a ${MVE_ROOT}/libs/dmrecon/
vpath libmve_math.a ${MVE_ROOT}/libs/math/
vpath libmve.a ${MVE_ROOT}/libs/mve/
vpath libmve_ogl.a ${MVE_ROOT}/libs/ogl/
vpath libmve_util.a ${MVE_ROOT}/libs/util/
vpath libmve_sfm.a ${MVE_ROOT}/libs/sfm/
vpath libmve_fssr.a ${MVE_ROOT}/libs/fssr/
# Autogenerate dependencies.
Makefile.dep: [^_]*.cc
${COMPILE.cc} -MM $^ >$@
-include Makefile.dep