Makefile 972 B

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