Makefile 772 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. MATLAB_INC=-I$(MATLAB)/extern/include/
  16. MATLAB_LIB=-L$(MATLAB)/bin/maci64 -lmx -leng
  17. INC+=$(MATLAB_INC)
  18. obj:
  19. mkdir -p obj
  20. ../../../lib/libiglmatlab.a: $(OBJ_FILES)
  21. rm -f $@
  22. ar cqs $@ $(OBJ_FILES)
  23. obj/%.o: %.cpp %.h
  24. g++ $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
  25. clean:
  26. rm -f obj/*.o
  27. rm -f ../../../lib/libiglmatlab.a