Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 fasttext.o
  12. INCLUDES = -I.
  13. opt: CXXFLAGS += -O3 -funroll-loops
  14. opt: fasttext
  15. debug: CXXFLAGS += -g -O0 -fno-inline
  16. debug: fasttext
  17. args.o: src/args.cc src/args.h
  18. $(CXX) $(CXXFLAGS) -c src/args.cc
  19. dictionary.o: src/dictionary.cc src/dictionary.h src/args.h
  20. $(CXX) $(CXXFLAGS) -c src/dictionary.cc
  21. productquantizer.o: src/productquantizer.cc src/productquantizer.h src/utils.h
  22. $(CXX) $(CXXFLAGS) -c src/productquantizer.cc
  23. matrix.o: src/matrix.cc src/matrix.h src/utils.h
  24. $(CXX) $(CXXFLAGS) -c src/matrix.cc
  25. qmatrix.o: src/qmatrix.cc src/qmatrix.h src/utils.h
  26. $(CXX) $(CXXFLAGS) -c src/qmatrix.cc
  27. vector.o: src/vector.cc src/vector.h src/utils.h
  28. $(CXX) $(CXXFLAGS) -c src/vector.cc
  29. model.o: src/model.cc src/model.h src/args.h
  30. $(CXX) $(CXXFLAGS) -c src/model.cc
  31. utils.o: src/utils.cc src/utils.h
  32. $(CXX) $(CXXFLAGS) -c src/utils.cc
  33. fasttext.o: src/fasttext.cc src/*.h
  34. $(CXX) $(CXXFLAGS) -c src/fasttext.cc
  35. fasttext: $(OBJS) src/fasttext.cc
  36. $(CXX) $(CXXFLAGS) $(OBJS) src/main.cc -o fasttext
  37. clean:
  38. rm -rf *.o fasttext