1
+ UNAME := $(shell uname)
2
+
1
3
# the following two options are used to control all C and C++ compilations
2
4
CFLAGS ?= -march=native -O3
3
5
CXXFLAGS ?= -march=native -O3
6
+
7
+ ifeq ($(UNAME ) , Darwin)
8
+ # on Mac OS, use recommended flag for sse2neon
9
+ CFLAGS ?= -march=armv8-a+fp+simd+crypto+crc -O3
10
+ CXXFLAGS ?= -march=armv8-a+fp+simd+crypto+crc -O3
11
+ endif
12
+
4
13
export CFLAGS
5
14
export CXXFLAGS
6
15
16
+ ifeq ($(UNAME ) , Darwin)
17
+ # on mac, also link to homebrew
18
+ export C_INCLUDE_PATH := ${C_INCLUDE_PATH}:/opt/homebrew/include
19
+ export CPLUS_INCLUDE_PATH := ${CPLUS_INCLUDE_PATH}:/opt/homebrew/include
20
+ export LIBRARY_PATH := ${LIBRARY_PATH}:/opt/homebrew/lib
21
+ export LD_LIBRARY_PATH := ${LD_LIBRARY_PATH}:/opt/homebrew/lib
22
+ # apply patches, ignore if they fail (already patched)
23
+ patch_osx = git apply 3rdparty/*.patch || true
24
+ endif
25
+
7
26
# these options are only used for the programs directly inside "./c/"
8
27
IIOLIBS = -lz -ltiff -lpng -ljpeg -lm
9
28
10
29
11
30
# default rule builds only the programs necessary for the test
12
- default : homography sift mgm_multi tvl1 lsd executables libraries
31
+ default : patch_osx homography sift mgm_multi tvl1 lsd executables libraries
13
32
14
33
# the "all" rule builds three further correlators
15
34
all : default msmw3 sgbm
@@ -22,6 +41,9 @@ test: default
22
41
# four standard "modules": homography, sift, mgm, and mgm_multi
23
42
#
24
43
44
+ patch_osx :
45
+ $(patch_osx )
46
+
25
47
homography :
26
48
$(MAKE ) -j -C 3rdparty/homography
27
49
cp 3rdparty/homography/homography bin
0 commit comments