Makefile_viewer 1.1 KB

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