Makefile 717 B

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