DISTRHO Plugin Framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 4.9KB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
8 years ago
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #!/usr/bin/make -f
  2. # Makefile for DGL #
  3. # ---------------- #
  4. # Created by falkTX
  5. #
  6. include ../Makefile.base.mk
  7. # ---------------------------------------------------------------------------------------------------------------------
  8. BUILD_C_FLAGS += $(DGL_FLAGS) -I. -Isrc
  9. BUILD_CXX_FLAGS += $(DGL_FLAGS) -I. -Isrc -DDONT_SET_USING_DGL_NAMESPACE -Wno-unused-parameter
  10. LINK_FLAGS += $(DGL_LIBS)
  11. # ifneq ($(MACOS_OLD),true)
  12. # needed by sofd right now, fix later
  13. # BUILD_CXX_FLAGS += -Wno-type-limits -fpermissive
  14. # endif
  15. # ---------------------------------------------------------------------------------------------------------------------
  16. OBJS_common = \
  17. ../build/dgl/Application.cpp.o \
  18. ../build/dgl/Color.cpp.o \
  19. ../build/dgl/Geometry.cpp.o \
  20. ../build/dgl/ImageBase.cpp.o \
  21. ../build/dgl/Resources.cpp.o \
  22. ../build/dgl/Widget.cpp.o
  23. # TODO: ImageWidgets.cpp
  24. # ---------------------------------------------------------------------------------------------------------------------
  25. OBJS_cairo = $(OBJS_common) \
  26. ../build/dgl/Cairo.cpp.cairo.o \
  27. ../build/dgl/WidgetPrivateData.cpp.cairo.o
  28. ifeq ($(MACOS),true)
  29. OBJS_cairo += ../build/dgl/Window.mm.cairo.o
  30. else
  31. OBJS_cairo += ../build/dgl/Window.cpp.cairo.o
  32. endif
  33. # ---------------------------------------------------------------------------------------------------------------------
  34. OBJS_opengl = $(OBJS_common) \
  35. ../build/dgl/OpenGL.cpp.opengl.o \
  36. ../build/dgl/Image.cpp.opengl.o \
  37. ../build/dgl/ImageWidgets.cpp.opengl.o \
  38. ../build/dgl/NanoVG.cpp.opengl.o \
  39. ../build/dgl/WidgetPrivateData.cpp.opengl.o
  40. ifeq ($(MACOS),true)
  41. OBJS_opengl += ../build/dgl/Window.mm.opengl.o
  42. else
  43. OBJS_opengl += ../build/dgl/Window.cpp.opengl.o
  44. endif
  45. # ---------------------------------------------------------------------------------------------------------------------
  46. ifeq ($(HAVE_CAIRO),true)
  47. TARGETS += ../build/libdgl-cairo.a
  48. endif
  49. ifeq ($(HAVE_OPENGL),true)
  50. TARGETS += ../build/libdgl-opengl.a
  51. # Compat name, to be removed soon
  52. TARGETS += ../build/libdgl.a
  53. endif
  54. # ---------------------------------------------------------------------------------------------------------------------
  55. all: $(TARGETS)
  56. # ---------------------------------------------------------------------------------------------------------------------
  57. ../build/libdgl-cairo.a: $(OBJS_cairo)
  58. -@mkdir -p ../build
  59. @echo "Creating libdgl-cairo.a"
  60. $(SILENT)rm -f $@
  61. $(SILENT)$(AR) crs $@ $^
  62. ../build/libdgl-opengl.a: $(OBJS_opengl)
  63. -@mkdir -p ../build
  64. @echo "Creating libdgl-opengl.a"
  65. $(SILENT)rm -f $@
  66. $(SILENT)$(AR) crs $@ $^
  67. # Compat name, to be removed soon
  68. ../build/libdgl.a: ../build/libdgl-opengl.a
  69. @echo "Symlinking libdgl.a"
  70. $(SILENT)ln -sf $< $@
  71. # ---------------------------------------------------------------------------------------------------------------------
  72. ../build/dgl/%.c.o: src/%.c
  73. -@mkdir -p ../build/dgl
  74. @echo "Compiling $<"
  75. $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -c -o $@
  76. ../build/dgl/%.cpp.o: src/%.cpp
  77. -@mkdir -p ../build/dgl
  78. @echo "Compiling $<"
  79. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  80. # ---------------------------------------------------------------------------------------------------------------------
  81. ../build/dgl/%.cpp.cairo.o: src/%.cpp
  82. -@mkdir -p ../build/dgl
  83. @echo "Compiling $< (Cairo variant)"
  84. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(CAIRO_FLAGS) -DDGL_CAIRO -c -o $@
  85. ../build/dgl/Window.cpp.cairo.o: src/Window.cpp src/sofd/* src/pugl/*
  86. -@mkdir -p ../build/dgl
  87. @echo "Compiling $< (Cairo variant)"
  88. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(CAIRO_FLAGS) -DDGL_CAIRO -c -o $@
  89. ../build/dgl/Window.mm.cairo.o: src/Window.cpp src/sofd/* src/pugl/*
  90. -@mkdir -p ../build/dgl
  91. @echo "Compiling $< (Cairo variant)"
  92. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(CAIRO_FLAGS) -DDGL_CAIRO -ObjC++ -c -o $@
  93. # ---------------------------------------------------------------------------------------------------------------------
  94. ../build/dgl/%.cpp.opengl.o: src/%.cpp
  95. -@mkdir -p ../build/dgl
  96. @echo "Compiling $< (OpenGL variant)"
  97. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -c -o $@
  98. ../build/dgl/Window.cpp.opengl.o: src/Window.cpp src/sofd/* src/pugl/*
  99. -@mkdir -p ../build/dgl
  100. @echo "Compiling $< (OpenGL variant)"
  101. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -c -o $@
  102. ../build/dgl/Window.mm.opengl.o: src/Window.cpp src/sofd/* src/pugl/*
  103. -@mkdir -p ../build/dgl
  104. @echo "Compiling $< (OpenGL variant)"
  105. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -ObjC++ -c -o $@
  106. # ---------------------------------------------------------------------------------------------------------------------
  107. clean:
  108. rm -rf ../build/dgl ../build/libdgl*.*
  109. debug:
  110. $(MAKE) DEBUG=true
  111. # ---------------------------------------------------------------------------------------------------------------------
  112. -include $(OBJS_common:%.o=%.d)
  113. -include $(OBJS_cairo:%.o=%.d)
  114. -include $(OBJS_opengl:%.o=%.d)
  115. # ---------------------------------------------------------------------------------------------------------------------