forked from quantumjot/btrack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (47 loc) · 1.48 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
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
# do something Linux #-fopenmp -static
CXX = g++
EXT = so
XLDFLAGS = -Wl,--no-undefined -Wl,--no-allow-shlib-undefined
#-L/usr/local/cuda/lib64 -lcuda -lcudart
endif
ifeq ($(UNAME), Darwin)
# do something OSX
CXX = clang++ -arch x86_64 -arch arm64
EXT = dylib
XLD_FLAGS = -arch x86_64 -arch arm64
endif
ifeq ($(UNAME), Windows)
# do something Windowsy
CXX = x86_64-w64-mingw32-g++
EXT = DLL
XLDFLAGS = -static-libgcc -static-libstdc++
endif
NVCC = nvcc
# automatically get the version numbers from VERSION.txt
VERSION_FILE := ./btrack/VERSION.txt
VERSION_MAJOR = $(shell cat $(VERSION_FILE) | cut -f1 -d.)
VERSION_MINOR = $(shell cat $(VERSION_FILE) | cut -f2 -d.)
VERSION_BUILD = $(shell cat $(VERSION_FILE) | cut -f3 -d.)
# If your compiler is a bit older you may need to change -std=c++11 to -std=c++0x
#-I/usr/include/python2.7 -L/usr/lib/python2.7 # -O3
GDBFLAGS = -g3 -O0 -ggdb
CXXFLAGS = -c -std=c++11 -m64 -O3 -fPIC -I"./btrack/include" \
-DDEBUG=false -DVERSION_MAJOR=$(VERSION_MAJOR) \
-DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_BUILD=$(VERSION_BUILD) \
-DBUILD_SHARED_LIB
LDFLAGS = -shared $(XLDFLAGS)
EXE = tracker
SRC_DIR = ./btrack/src
OBJ_DIR = ./btrack/obj
SRC = $(wildcard $(SRC_DIR)/*.cc)
OBJ = $(SRC:$(SRC_DIR)/%.cc=$(OBJ_DIR)/%.o)
# make it
all: $(EXE)
$(EXE): $(OBJ)
$(CXX) $(LDFLAGS) -o ./btrack/libs/libtracker.$(EXT) $^
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cc
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
$(RM) $(OBJ)