Makefile 928 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. all: lib examples
  2. .PHONY: all
  3. .PHONY: examples
  4. debug: lib
  5. lib: obj lib/libigl.a
  6. examples:
  7. make -C examples
  8. CPP_FILES=$(wildcard include/igl/*.cpp)
  9. OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
  10. # include igl headers
  11. INC+=-Iinclude/
  12. CFLAGS += -Wall -arch i386 -arch x86_64
  13. # optimized default settings
  14. all: LFLAGS +=
  15. all: CFLAGS += -O3 -DNDEBUG -j
  16. debug: CFLAGS += -g -Wall -Werror
  17. # Eigen dependency
  18. EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
  19. INC+=$(EIGEN3_INC)
  20. # AntTweakBar dependency
  21. ANTTWEAKBAR_INC=-I/opt/local/include
  22. INC+=$(ANTTWEAKBAR_INC)
  23. ## OpenGL dependency
  24. #LIB+=-framework OpenGL
  25. #LIB+=-framework GLUT
  26. #LIB+=-framework AppKit
  27. obj:
  28. mkdir -p obj
  29. lib/libigl.a: $(OBJ_FILES)
  30. rm -f $@
  31. ar cqs $@ $(OBJ_FILES)
  32. obj/%.o: include/igl/%.cpp include/igl/%.h
  33. g++ $(CFLAGS) -c -o $@ $< $(INC)
  34. clean:
  35. rm -f obj/*.o
  36. rm -f lib/libigl.a
  37. make -C examples clean