forked from dmlc/dmlc-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (81 loc) · 2.19 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
ifndef config
ifneq ("$(wildcard ./config.mk)","")
config = config.mk
else
config = make/config.mk
endif
endif
# use customized config file
include $(config)
include make/dmlc.mk
NOLINT_FILES = --exclude_path include/dmlc/concurrentqueue.h include/dmlc/blockingconcurrentqueue.h
# this is the common build script for dmlc lib
export LDFLAGS= -pthread -lm
export CFLAGS = -O3 -Wall -Wno-unknown-pragmas -Iinclude
ifeq ($(USE_GNU11), 1)
CFLAGS += -std=gnu++11
else
CFLAGS += -std=c++0x
endif
LDFLAGS+= $(DMLC_LDFLAGS) $(ADD_LDFLAGS)
CFLAGS+= $(DMLC_CFLAGS) $(ADD_CFLAGS)
ifndef USE_SSE
USE_SSE = 1
endif
ifeq ($(USE_SSE), 1)
CFLAGS += -msse2
endif
ifdef DEPS_PATH
CFLAGS+= -I$(DEPS_PATH)/include
LDFLAGS+= -L$(DEPS_PATH)/lib
endif
.PHONY: clean all test lint doc example pylint
OBJ=line_split.o indexed_recordio_split.o recordio_split.o input_split_base.o io.o filesys.o local_filesys.o data.o recordio.o config.o
ifeq ($(USE_HDFS), 1)
OBJ += hdfs_filesys.o
endif
ifeq ($(USE_S3), 1)
OBJ += s3_filesys.o
endif
ifeq ($(USE_AZURE), 1)
OBJ += azure_filesys.o
endif
ifndef LINT_LANG
LINT_LANG="all"
endif
ALIB=libdmlc.a
all: $(ALIB) test
include test/dmlc_test.mk
include example/dmlc_example.mk
ifeq ($(BUILD_TEST), 1)
test: $(ALL_TEST)
endif
example: $(ALL_EXAMPLE)
line_split.o: src/io/line_split.cc
recordio_split.o: src/io/recordio_split.cc
indexed_recordio_split.o: src/io/indexed_recordio_split.cc
input_split_base.o: src/io/input_split_base.cc
filesys.o: src/io/filesys.cc
hdfs_filesys.o: src/io/hdfs_filesys.cc
s3_filesys.o: src/io/s3_filesys.cc
azure_filesys.o: src/io/azure_filesys.cc
local_filesys.o: src/io/local_filesys.cc
io.o: src/io.cc
data.o: src/data.cc
recordio.o: src/recordio.cc
config.o: src/config.cc
libdmlc.a: $(OBJ)
$(BIN) :
$(CXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c %.cc %.a, $^) $(LDFLAGS)
$(OBJ) :
$(CXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c %.cc, $^) )
$(ALIB):
$(AR) cr $@ $+
lint:
scripts/lint.py dmlc ${LINT_LANG} include src scripts $(NOLINT_FILES)
pylint:
scripts/lint.py dmlc ${LINT_LANG} tracker/dmlc_tracker
doxygen:
doxygen doc/Doxyfile
clean:
$(RM) $(OBJ) $(BIN) $(ALIB) $(ALL_TEST) $(ALL_TEST_OBJ) *~ src/*~ src/*/*~ include/dmlc/*~ test/*~