-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile_native
76 lines (57 loc) · 2.86 KB
/
Makefile_native
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
# Makefile for the deep learning server example
#
# AUTHORS
#
# The Veracruz Development Team.
#
# COPYRIGHT AND LICENSING
#
# See the `LICENSE_MIT.markdown` file in the Veracruz deep learning server
# example repository root directory for copyright and licensing information.
##########################################################
EXEC=detector
DARKNET_PATH = darknet
OPENH264_LIB_PATH = openh264
OPENH264DEC_LIB_PATH = openh264-dec
VPATH=./$(DARKNET_PATH)
OBJ=o
############
ifeq ($(shell uname), Darwin)
OS=macos
endif
ifeq ($(shell uname), Linux)
OS=linux
endif
############
CFLAGS=-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -Wno-write-strings -fPIC -march=native
OPTS=-Ofast
#OPTS=-O0 -g
CFLAGS+=$(OPTS)
LDFLAGS= -lm
############
# compare.c is excluded from the source because it fails to compile
DARKNET_SRC = gemm.c utils.c cuda.c deconvolutional_layer.c convolutional_layer.c list.c image.c activations.c im2col.c col2im.c blas.c crop_layer.c dropout_layer.c maxpool_layer.c softmax_layer.c data.c matrix.c network.c connected_layer.c cost_layer.c parser.c option_list.c detection_layer.c route_layer.c upsample_layer.c box.c normalization_layer.c avgpool_layer.c layer.c local_layer.c shortcut_layer.c logistic_layer.c activation_layer.c rnn_layer.c gru_layer.c crnn_layer.c demo.c batchnorm_layer.c region_layer.c reorg_layer.c tree.c lstm_layer.c l2norm_layer.c yolo_layer.c iseg_layer.c
DARKNET_SRCS = $(addprefix $(DARKNET_PATH)/, $(DARKNET_SRC))
DARKNET_OBJS = $(DARKNET_SRCS:%.c=%.$(OBJ))
MAIN_SRCS = $(wildcard src/*.cpp)
##########################################################
.PHONY: yolo_detection clean
.DEFAULT_GOAL := all
all: $(EXEC)
##########################################################
$(EXEC): $(DARKNET_OBJS) $(MAIN_SRCS) libopenh264_native.a libopenh264dec_native.a
$(CXX) $(CFLAGS) $(DARKNET_OBJS) $(MAIN_SRCS) -o $@ $(LDFLAGS) -Iinclude -I$(DARKNET_PATH) -I $(OPENH264_LIB_PATH)/codec/api/svc -I $(OPENH264DEC_LIB_PATH)/inc -L $(OPENH264DEC_LIB_PATH) -lopenh264dec_native -L $(OPENH264_LIB_PATH) -lopenh264_native -static
#$(CXX) $(CFLAGS) $(DARKNET_OBJS) $(MAIN_SRCS) -o $@ $(LDFLAGS) -Iinclude -I$(DARKNET_PATH) -I $(OPENH264_LIB_PATH)/codec/api/svc -I $(OPENH264DEC_LIB_PATH)/inc -L $(OPENH264DEC_LIB_PATH) -lopenh264dec_native -L $(OPENH264_LIB_PATH) -lopenh264_native -pthread
$(DARKNET_PATH)/%.$(OBJ): %.c
$(CC) $(CFLAGS) -I$(DARKNET_PATH) -Iinclude -c $< -o $@
libopenh264_native.a:
make -f Makefile_native -C $(OPENH264_LIB_PATH) libopenh264_native.a
#make -f Makefile_native -C $(OPENH264_LIB_PATH) CFLAGS="-DENABLE_THREADS -DENABLE_SEMAPHORES" libopenh264_native.a
libopenh264dec_native.a:
make -f Makefile_native -C $(OPENH264DEC_LIB_PATH)
##########################################################
# Generate alphabet for box annotation
generate_alphabet:
cd labels && python make_labels.py
clean:
rm -rf $(DARKNET_OBJS) $(EXEC)