forked from dmlc/dmlc-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (51 loc) · 1.39 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
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
# this is the common build script for dmlc lib
export LDFLAGS= -pthread -lm
export CFLAGS = -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x
LDFLAGS+= $(DMLC_LDFLAGS)
CFLAGS+= $(DMLC_CFLAGS)
ifdef DEPS_PATH
CFLAGS+= -I$(DEPS_PATH)/include
endif
.PHONY: clean all test
OBJ=line_split.o recordio_split.o input_split_base.o io.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
ALIB=libdmlc.a
all: $(ALIB) test
include test/dmlc_test.mk
ifeq ($(BUILD_TEST), 1)
test: $(ALL_TEST)
endif
line_split.o: src/io/line_split.cc
recordio_split.o: src/io/recordio_split.cc
input_split_base.o: src/io/input_split_base.cc
hdfs_filesys.o: src/io/hdfs_filesys.cc
s3_filesys.o: src/io/s3_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 $@ $+
clean:
$(RM) $(OBJ) $(BIN) $(ALIB) $(ALL_TEST) $(ALL_TEST_OBJ) *~ src/*~ src/*/*~ include/dmlc/*~ test/*~