Makefile 889 B

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