Makefile 855 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # AntTweakBar dependency
  18. MY_INC=-I/opt/local/include -I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
  19. INC+=$(MY_INC)
  20. ## OpenGL dependency
  21. #LIB+=-framework OpenGL
  22. #LIB+=-framework GLUT
  23. #LIB+=-framework AppKit
  24. obj:
  25. mkdir -p obj
  26. libigl.a: $(OBJ_FILES)
  27. rm -f $@
  28. ar cqs $@ $(OBJ_FILES)
  29. obj/%.o: %.cpp %.h
  30. g++ $(CFLAGS) -c -o $@ $< $(INC)
  31. clean:
  32. rm -f obj/*.o
  33. rm -f libigl.a
  34. make -C examples clean