Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # Copyright (c) 2016-present, Facebook, Inc.
  3. # All rights reserved.
  4. #
  5. # This source code is licensed under the BSD-style license found in the
  6. # LICENSE file in the root directory of this source tree. An additional grant
  7. # of patent rights can be found in the PATENTS file in the same directory.
  8. #
  9. CXX = c++
  10. CXXFLAGS = -pthread -std=c++0x -march=native
  11. OBJS = args.o dictionary.o productquantizer.o matrix.o qmatrix.o vector.o model.o utils.o meter.o fasttext.o
  12. INCLUDES = -I.
  13. opt: CXXFLAGS += -O3 -funroll-loops
  14. opt: fasttext
  15. coverage: CXXFLAGS += -O0 -fno-inline -fprofile-arcs --coverage
  16. coverage: fasttext
  17. debug: CXXFLAGS += -g -O0 -fno-inline
  18. debug: fasttext
  19. args.o: src/args.cc src/args.h
  20. $(CXX) $(CXXFLAGS) -c src/args.cc
  21. dictionary.o: src/dictionary.cc src/dictionary.h src/args.h
  22. $(CXX) $(CXXFLAGS) -c src/dictionary.cc
  23. productquantizer.o: src/productquantizer.cc src/productquantizer.h src/utils.h
  24. $(CXX) $(CXXFLAGS) -c src/productquantizer.cc
  25. matrix.o: src/matrix.cc src/matrix.h src/utils.h
  26. $(CXX) $(CXXFLAGS) -c src/matrix.cc
  27. qmatrix.o: src/qmatrix.cc src/qmatrix.h src/utils.h
  28. $(CXX) $(CXXFLAGS) -c src/qmatrix.cc
  29. vector.o: src/vector.cc src/vector.h src/utils.h
  30. $(CXX) $(CXXFLAGS) -c src/vector.cc
  31. model.o: src/model.cc src/model.h src/args.h
  32. $(CXX) $(CXXFLAGS) -c src/model.cc
  33. utils.o: src/utils.cc src/utils.h
  34. $(CXX) $(CXXFLAGS) -c src/utils.cc
  35. meter.o: src/meter.cc src/meter.h
  36. $(CXX) $(CXXFLAGS) -c src/meter.cc
  37. fasttext.o: src/fasttext.cc src/*.h
  38. $(CXX) $(CXXFLAGS) -c src/fasttext.cc
  39. fasttext: $(OBJS) src/fasttext.cc
  40. $(CXX) $(CXXFLAGS) $(OBJS) src/main.cc -o fasttext
  41. clean:
  42. rm -rf *.o *.gcno *.gcda fasttext