Makefile_viewer 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. CFLAGS += -DIGL_STATIC_LIBRARY
  2. include Makefile.conf
  3. all: CFLAGS += -O3 -DNDEBUG -fopenmp
  4. debug: CFLAGS += -g -Wall -Werror -fopenmp
  5. .PHONY: all
  6. all: libiglviewer
  7. debug: libiglviewer
  8. .PHONY: libviewer
  9. libiglviewer: obj ../lib/libiglviewer.a
  10. SRC_DIR=../include/igl/viewer/
  11. CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
  12. OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
  13. # include igl headers
  14. INC+=-I../include/
  15. # EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY
  16. # Eigen dependency
  17. EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
  18. INC+=$(EIGEN3_INC)
  19. # GLFW dependency
  20. ifndef GLFW
  21. GLFW=../external/glfw/
  22. endif
  23. GLFW_INC=-I$(GLFW)/include
  24. INC+=$(GLFW_INC)
  25. ifndef ANTTWEAKBAR
  26. ANTTWEAKBAR=../external/AntTweakBar/
  27. endif
  28. # Viewer also uses source files from AntTweakBar for font rendering
  29. ANTTWEAKBAR_INC=-I$(ANTTWEAKBAR)/include -I$(ANTTWEAKBAR)/src
  30. INC+=$(ANTTWEAKBAR_INC)
  31. obj:
  32. mkdir -p obj
  33. ../lib/libiglviewer.a: $(OBJ_FILES)
  34. rm -f $@
  35. ar cqs $@ $(OBJ_FILES)
  36. obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
  37. $(GG) $(AFLAGS) $(CFLAGS) -c -o $@ $< $(INC)
  38. clean:
  39. rm -f $(OBJ_FILES)
  40. rm -f ../lib/libiglmatlab.a