Makefile_matlab 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. include Makefile.conf
  2. all: CFLAGS += -O3 -DNDEBUG
  3. debug: CFLAGS += -g -Wall -Werror
  4. .PHONY: all
  5. all: libiglmatlab
  6. debug: libiglmatlab
  7. .PHONY: libmatlab
  8. libiglmatlab: obj ../lib/libiglmatlab.a
  9. SRC_DIR=../include/igl/matlab/
  10. CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
  11. OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
  12. # include igl headers
  13. INC+=-I../include/
  14. # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY
  15. # Eigen dependency
  16. EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
  17. INC+=$(EIGEN3_INC)
  18. # Matlab dependency
  19. ifndef MATLAB
  20. MATLAB=/Applications/MATLAB_R2013b.app/
  21. $(warning MATLAB undefined. Setting MATLAB=${MATLAB})
  22. endif
  23. MATLAB_INC=-I$(MATLAB)/extern/include/
  24. MATLAB_LIB=-L$(MATLAB)/bin/maci64 -lmx -leng
  25. INC+=$(MATLAB_INC)
  26. obj:
  27. mkdir -p obj
  28. ../lib/libiglmatlab.a: $(OBJ_FILES)
  29. rm -f $@
  30. ar cqs $@ $(OBJ_FILES)
  31. obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
  32. g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
  33. clean:
  34. rm -f $(OBJ_FILES)
  35. rm -f ../lib/libiglmatlab.a