forked from OAID/FaceRecognition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (47 loc) · 1.59 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
BUILD_DIR=./build
include ./config.mk
include detect/Makefile
DETECT_OBJS:=$(addprefix $(BUILD_DIR)/detect/, $(detect-obj-y))
include align/Makefile
ALIGN_OBJS:=$(addprefix $(BUILD_DIR)/align/, $(align-obj-y))
include lib/Makefile
LIB_OBJS=$(addprefix $(BUILD_DIR)/lib/, $(lib-obj-y))
include extract/Makefile
EXTRACT_OBJS=$(addprefix $(BUILD_DIR)/extract/, $(extract-obj-y))
include verify/Makefile
VERIFY_OBJS=$(addprefix $(BUILD_DIR)/verify/, $(verify-obj-y))
include store/Makefile
STORE_OBJS=$(addprefix $(BUILD_DIR)/store/, $(store-obj-y))
include test/Makefile
TEST_OBJS=$(addprefix $(BUILD_DIR)/test/, $(test-obj-y))
include bin/Makefile
BIN_OBJS=$(addprefix $(BUILD_DIR)/bin/, $(bin-obj-y))
COMM_CFLAGS= -Wall -g $(OPT) -I./include
CXXFLAGS+=$(COMM_CFLAGS)
CFLAGS+=$(COMM_CFLAGS)
MODEL_DIR=$(realpath ./models)
CXXFLAGS+=-DMODEL_DIR=\"$(MODEL_DIR)\"
CC=gcc -std=gnu99
CXX=g++ -std=c++11
LD=g++
COMMON_OBJS=$(DETECT_OBJS) $(ALIGN_OBJS) $(LIB_OBJS) $(EXTRACT_OBJS) $(VERIFY_OBJS) $(STORE_OBJS)
BIN_OBJS+=$(TEST_OBJS)
BIN_EXES=$(BIN_OBJS:.o=)
all : $(BIN_EXES)
$(BIN_EXES): $(COMMON_OBJS)
$(BIN_EXES):$(BUILD_DIR)/%:$(BUILD_DIR)/%.o
clean:
rm -f $(BIN_EXES) $(BIN_OBJS) $(COMMON_OBJS)
.PHONY : all clean
$(BUILD_DIR)/%.o:%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o : %.cpp
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -c $< -o $@
$(BUILD_DIR)/%: $(BUILD_DIR)/%.o
@mkdir -p $(@D)
$(LD) $(LDFLAGS) $< $(COMMON_OBJS) -o $@ $(LIBS)
$(BUILD_DIR)/test/%: $(BUILD_DIR)/test/%.o
@mkdir -p $(@D)
$(LD) $(LDFLAGS) $< $(COMMON_OBJS) -o $@ $(LIBS) $(TEST_LIBS)