Skip to content
Snippets Groups Projects
Makefile 801 B
Newer Older
tqchen's avatar
tqchen committed
export LDFLAGS = -pthread -lm
export CFLAGS =  -std=c++11 -Wall -O2  -Wno-unknown-pragmas -funroll-loops\
	 -Iinclude -Idmlc-core/include -fPIC

# specify tensor path
.PHONY: clean all test doc
tqchen's avatar
tqchen committed

all: lib/libtvm.a
SRC = $(wildcard src/*.cc src/*/*.cc)
ALL_OBJ = $(patsubst src/%.cc, build/%.o, $(SRC))
ALL_DEP = $(ALL_OBJ)

tqchen's avatar
tqchen committed
include tests/cpp/unittest.mk

test: $(TEST)

tqchen's avatar
tqchen committed
build/%.o: src/%.cc
	@mkdir -p $(@D)
	$(CXX) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d
	$(CXX) -c $(CFLAGS) -c $< -o $@


lib/libtvm.a: $(ALL_DEP)
	@mkdir -p $(@D)
	ar crv $@ $(filter %.o, $?)

lint:
	python2 dmlc-core/scripts/lint.py tvm cpp include src

doc:
	doxygen docs/Doxyfile

tqchen's avatar
tqchen committed
clean:
tqchen's avatar
tqchen committed
	$(RM) -rf build lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o */*.d */*/*.d */*/*/*.d
tqchen's avatar
tqchen committed

-include build/*.d
-include build/*/*.d