-
Notifications
You must be signed in to change notification settings - Fork 59
/
Makefile
48 lines (33 loc) · 1.09 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
DMLC_CORE_PATH ?= ../dmlc-core
DLPACK_INCLUDE_PATH ?= ../dlpack/include
LDFLAGS = -pthread -lm
CFLAGS = -std=c++11 -Wall -O2\
-Iinclude -I${DMLC_CORE_PATH}/include -I../include -I${DLPACK_INCLUDE_PATH} -Isrc -fPIC -fvisibility=hidden
ifdef no_rtti
CFLAGS += -fno-rtti
endif
# specify tensor path
.PHONY: clean all test doc
CCSUFFIX=cpp
all: lib/libHalideIR.a lib/libHalideIR.so
SRC = $(wildcard src/*.$(CCSUFFIX) src/*/*.$(CCSUFFIX) src/*/*/*.$(CCSUFFIX))
ALL_OBJ = $(patsubst src/%.$(CCSUFFIX), build/%.o, $(SRC))
ALL_DEP = $(ALL_OBJ)
build/%.o: src/%.$(CCSUFFIX)
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d
$(CXX) -c $(CFLAGS) -c $< -o $@
lib/libHalideIR.a: $(ALL_DEP)
@mkdir -p $(@D)
ar crv $@ $(filter %.o, $?)
lib/libHalideIR.so: $(ALL_DEP)
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.o %.a, $^) $(LDFLAGS)
lint:
python2 dmlc-core/scripts/lint.py tvm cpp include src/tvm
doc:
doxygen docs/Doxyfile
clean:
$(RM) -rf build lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o */*.d */*/*.d */*/*/*.d
-include build/*.d
-include build/*/*.d