-
Notifications
You must be signed in to change notification settings - Fork 63
/
Makefile
46 lines (29 loc) · 1.2 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
CC = gcc
CPP = g++
PYTHON_VERSION = 3.5m
PYTHON_INCLUDE = /usr/include/python$(PYTHON_VERSION)
IDIRS = -I$(PYTHON_INCLUDE) -I.
DEFINES = -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DZLIB_CONST -D_GNU_SOURCE=1 -D_REENTRANT -D__STDC_CONSTANT_MACROS
CFLAGS = -fomit-frame-pointer -fPIC -pthread -Wall -Wextra -DNDEBUG -O3 -g -rdynamic $(IDIRS) $(DEFINES)
LIBRARIES = -L/usr/lib -L/usr/lib/python$(PYTHON_VERSION)/config -L/usr/lib/x86_64-linux-gnu/ -lpython$(PYTHON_VERSION) -lboost_python-py35
CPPFLAGS = -std=c++11 $(CFLAGS)
LFLAGS = -lm -lstdc++ -llzma -lz -ldl -lpthread
LDFLAGS = $(LIBRARIES) $(LFLAGS)
SRC = ./src
SOURCES = $(wildcard $(SRC)/*.cpp)
EXECUTABLE = ./libpydetector.so
OBJECTS = $(patsubst %.cpp,%.o,$(SOURCES))
all: $(SOURCES) $(EXECUTABLE)
%.o : %.c
@echo Compiling: $<
@$(CC) $(CFLAGS) -c $< -o $@
%.o : %.cpp
@echo Compiling: $<
@$(CPP) $(CPPFLAGS) -c $< -o $@
clean:
rm -f $(OBJECTS)
rm -f $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
@echo Linking: $@
@$(CPP) -shared -Wl,--export-dynamic $(OBJECTS) $(LDFLAGS) -o $@
cp -f $(EXECUTABLE) ./detectionExample/$(EXECUTABLE)