SHARE
TWEET

Deep Mimic Makefile

a guest Sep 8th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BIN=Main
  2. OBJ_DIR = objs
  3. MKDIR = mkdir -p
  4.  
  5. EIGEN_DIR = /usr/local/include/eigen3/
  6. BULLET_INC_DIR = /usr/local/include/bullet
  7. #FREEGLUT_DIR = /usr/local/opt/freeglut/include/
  8. FREEGLUT_INC = /usr/local/lib
  9. FREEGLUT_LIB = /usr/local/include
  10. X11_INC = /opt/X11/include
  11. X11_LIB = /opt/X11/lib
  12.  
  13.  
  14. PYTHON_INC = /Users/name/anaconda3/envs/deepmimic/include/python3.6m
  15. PYTHON_LIB = /Users/name/anaconda3/envs/deepmimic/lib -lpython3.6m
  16.  
  17. INC = -I./ \
  18.     -I$(EIGEN_DIR) \
  19.     -I$(BULLET_INC_DIR) \
  20.     -I$(FREEGLUT_INC) \
  21.     -I$(X11_INC)
  22. #   -I$(X11_LIB)
  23. #   -I$(FREEGLUT_LIB)
  24.  
  25. LIBS = -L$(X11_LIB) -L$(FREEGLUT_LIB)  
  26.  
  27. LFLAGS = -lGLEW -lBulletDynamics -lBulletCollision -lLinearMath -lm -lstdc++ -framework OpenGL -lGLUT
  28. #-framework OpenGL
  29.  
  30. CC = clang++
  31. CFLAGS = -std=c++11 -O3 -Wall -fPIC
  32.  
  33. SRC_DIRS = util/ \
  34.     util/json/ \
  35.     anim/ \
  36.     sim/ \
  37.     render/ \
  38.     render/lodepng/ \
  39.     scenes/ \
  40.     scenes/arm/ \
  41.     scenes/particle/ \
  42.     scenes/pendulum/
  43.  
  44. SRC_FILES = $(BIN).cpp DeepMimicCore.cpp $(foreach dir, $(SRC_DIRS), $(wildcard $(dir)*.cpp))
  45. OUT_DIRS = $(addprefix $(OBJ_DIR)/, $(SRC_DIRS))
  46. OBJ = $(addprefix $(OBJ_DIR)/, $(patsubst %.cpp, %.o, $(SRC_FILES)))
  47.  
  48.  
  49. default: build
  50.  
  51. build: $(BIN)
  52.  
  53. print:
  54.     $(OUT_DIRS)
  55.  
  56. python: $(OUT_DIRS) $(OBJ)
  57.     swig -c++ -python DeepMimicCore.i
  58.     $(CC) -c -g $(CFLAGS) $(INC) $(LFLAGS) DeepMimicCore.cpp DeepMimicCore_wrap.cxx -I$(PYTHON_INC)
  59.     $(CC) -shared $(CFLAGS) $(OBJ) $(LFLAGS) $(LIBS) DeepMimicCore_wrap.o -o _DeepMimicCore.so -L$(PYTHON_LIB)
  60.  
  61. $(OBJ_DIR)/%.o: %.cpp
  62.     $(CC) -c -g $(CFLAGS) $(INC) -o $@ $<
  63.  
  64. $(BIN): $(OUT_DIRS) $(OBJ)
  65.     $(CC) -g $(CFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $@
  66.  
  67. $(OUT_DIRS):
  68.     $(MKDIR) $(OUT_DIRS)
  69.    
  70. clean:
  71.     - rm -f -r $(OUT_DIRS) $(BIN) $(OBJ) $(OBJ_DIR) DeepMimicCore_wrap.cxx _DeepMimicCore.so
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top