Makefile 890 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. # optimized default settings
  13. all: LFLAGS +=
  14. all: CFLAGS += -O3 -DNDEBUG -Wall
  15. debug: CFLAGS += -g -Wall -Werror
  16. # Eigen dependency
  17. EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
  18. INC+=$(EIGEN3_INC)
  19. # AntTweakBar dependency
  20. ANTTWEAKBAR_INC=-I/opt/local/include
  21. INC+=$(ANTTWEAKBAR_INC)
  22. ## OpenGL dependency
  23. #LIB+=-framework OpenGL
  24. #LIB+=-framework GLUT
  25. #LIB+=-framework AppKit
  26. obj:
  27. mkdir -p obj
  28. lib/libigl.a: $(OBJ_FILES)
  29. rm -f $@
  30. ar cqs $@ $(OBJ_FILES)
  31. obj/%.o: include/igl/%.cpp include/igl/%.h
  32. g++ $(CFLAGS) -c -o $@ $< $(INC)
  33. clean:
  34. rm -f obj/*.o
  35. rm -f lib/libigl.a
  36. make -C examples clean