-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile.3rd
74 lines (59 loc) · 2.24 KB
/
Makefile.3rd
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
# Copyright 2019 the deepx authors.
# Author: Yafei Zhang ([email protected])
#
LIBGFLAGS_SOURCES := \
thirdparty/gflags-2.1.2/gflags_reporting.cc \
thirdparty/gflags-2.1.2/gflags_completions.cc \
thirdparty/gflags-2.1.2/gflags.cc
LIBGFLAGS_OBJECTS := $(addprefix $(BUILD_DIR_ABS)/,$(LIBGFLAGS_SOURCES))
LIBGFLAGS_OBJECTS := $(LIBGFLAGS_OBJECTS:.cc=.o)
LIBGTEST_SOURCES := \
thirdparty/gtest-1.8.0/gtest-all.cc \
thirdparty/gtest-1.8.0/gtest_main.cc
LIBGTEST_OBJECTS := $(addprefix $(BUILD_DIR_ABS)/,$(LIBGTEST_SOURCES))
LIBGTEST_OBJECTS := $(LIBGTEST_OBJECTS:.cc=.o)
LIBLZ4_SOURCES := $(wildcard thirdparty/lz4-1.9.2/*.c)
LIBLZ4_OBJECTS := $(addprefix $(BUILD_DIR_ABS)/,$(LIBLZ4_SOURCES))
LIBLZ4_OBJECTS := $(LIBLZ4_OBJECTS:.c=.o)
LIBZ_SOURCES := $(wildcard thirdparty/zlib-1.2.11/*.c)
LIBZ_OBJECTS := $(addprefix $(BUILD_DIR_ABS)/,$(LIBZ_SOURCES))
LIBZ_OBJECTS := $(LIBZ_OBJECTS:.c=.o)
3RD_LIBS := \
$(BUILD_DIR_ABS)/libdeepx_gflags.a \
$(BUILD_DIR_ABS)/libdeepx_gtest.a \
$(BUILD_DIR_ABS)/libdeepx_lz4.a \
$(BUILD_DIR_ABS)/libdeepx_z.a
################################################################
$(BUILD_DIR_ABS)/thirdparty/gflags-2.1.2/%.o: thirdparty/gflags-2.1.2/%.cc
@echo Compiling $<
@mkdir -p $(@D)
@$(CXX) $(3RD_CPPFLAGS) -Ithirdparty/gflags $(3RD_CXXFLAGS) -c -o $@ $<
$(BUILD_DIR_ABS)/thirdparty/zlib-1.2.11/%.o: thirdparty/zlib-1.2.11/%.c
@echo Compiling $<
@mkdir -p $(@D)
@$(CC) $(3RD_CPPFLAGS) -DZ_HAVE_UNISTD_H=1 $(3RD_CFLAGS) -c -o $@ $<
$(BUILD_DIR_ABS)/thirdparty/%.o: thirdparty/%.c
@echo Compiling $<
@mkdir -p $(@D)
@$(CC) $(3RD_CPPFLAGS) $(3RD_CFLAGS) -c -o $@ $<
$(BUILD_DIR_ABS)/thirdparty/%.o: thirdparty/%.cc
@echo Compiling $<
@mkdir -p $(@D)
@$(CXX) $(3RD_CPPFLAGS) $(3RD_CXXFLAGS) -c -o $@ $<
################################################################
$(BUILD_DIR_ABS)/libdeepx_gflags.a: $(LIBGFLAGS_OBJECTS)
@echo Archiving $@
@mkdir -p $(@D)
@$(AR) rcs $@ $^
$(BUILD_DIR_ABS)/libdeepx_gtest.a: $(LIBGTEST_OBJECTS)
@echo Archiving $@
@mkdir -p $(@D)
@$(AR) rcs $@ $^
$(BUILD_DIR_ABS)/libdeepx_lz4.a: $(LIBLZ4_OBJECTS)
@echo Archiving $@
@mkdir -p $(@D)
@$(AR) rcs $@ $^
$(BUILD_DIR_ABS)/libdeepx_z.a: $(LIBZ_OBJECTS)
@echo Archiving $@
@mkdir -p $(@D)
@$(AR) rcs $@ $^