Audio plugin host https://kx.studio/carla
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.

301 lines
9.7KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-bridges-ui #
  3. # ----------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. MODULENAME=carla-bridge
  8. include $(CWD)/Makefile.mk
  9. # ---------------------------------------------------------------------------------------------------------------------
  10. BINDIR := $(CWD)/../bin
  11. ifeq ($(DEBUG),true)
  12. OBJDIR := $(CWD)/../build/bridges-ui/Debug
  13. MODULEDIR := $(CWD)/../build/modules/Debug
  14. else
  15. OBJDIR := $(CWD)/../build/bridges-ui/Release
  16. MODULEDIR := $(CWD)/../build/modules/Release
  17. endif
  18. # ---------------------------------------------------------------------------------------------------------------------
  19. BUILD_CXX_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_UI -I. -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/utils -I$(CWD)/modules
  20. LINK_FLAGS += $(WATER_LIBS)
  21. ifeq ($(HAIKU),true)
  22. LINK_FLAGS += -lpthread
  23. else
  24. LINK_FLAGS += -pthread
  25. endif
  26. # ---------------------------------------------------------------------------------------------------------------------
  27. BUILD_GTK2_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_GTK2 $(X11_FLAGS)
  28. LINK_GTK2_FLAGS = $(LINK_FLAGS) $(X11_LIBS) $(LIBDL_LIBS)
  29. BUILD_GTK3_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_GTK3 $(X11_FLAGS)
  30. LINK_GTK3_FLAGS = $(LINK_FLAGS) $(X11_LIBS) $(LIBDL_LIBS)
  31. BUILD_QT4_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_QT4 $(shell pkg-config --cflags QtCore QtGui) $(X11_FLAGS) -I$(OBJDIR) -I$(CWD)/theme -Wno-unused-variable
  32. LINK_QT4_FLAGS = $(LINK_FLAGS) $(shell pkg-config --libs QtCore QtGui) $(X11_LIBS) $(LIBDL_LIBS)
  33. BUILD_QT5_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_QT5 $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets) -I$(OBJDIR) -I$(CWD)/theme
  34. LINK_QT5_FLAGS = $(LINK_FLAGS) $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets) $(LIBDL_LIBS)
  35. BUILD_X11_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_X11 $(X11_FLAGS)
  36. LINK_X11_FLAGS = $(LINK_FLAGS) $(X11_LIBS) $(LIBDL_LIBS)
  37. BUILD_COCOA_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_COCOA -ObjC++
  38. LINK_COCOA_FLAGS = $(LINK_FLAGS) -framework Cocoa $(LIBDL_LIBS)
  39. BUILD_WINDOWS_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_HWND
  40. LINK_WINDOWS_FLAGS = $(LINK_FLAGS) -static -mwindows
  41. ifeq ($(MACOS),true)
  42. BUILD_GTK2_FLAGS += -ObjC++
  43. BUILD_GTK3_FLAGS += -ObjC++
  44. endif
  45. ifeq ($(TESTBUILD),true)
  46. BUILD_QT4_FLAGS += -isystem /usr/include/qt4
  47. BUILD_QT5_FLAGS += -isystem /usr/include/qt5
  48. BUILD_QT5_FLAGS += -isystem /usr/include/x86_64-linux-gnu/qt5
  49. endif
  50. # ---------------------------------------------------------------------------------------------------------------------
  51. TARGETS += ui_lv2-gtk2
  52. TARGETS += ui_lv2-gtk3
  53. ifneq ($(MACOS_OR_WIN32),true)
  54. ifeq ($(HAVE_QT4),true)
  55. TARGETS += ui_lv2-qt4
  56. endif
  57. ifeq ($(HAVE_QT5),true)
  58. TARGETS += ui_lv2-qt5
  59. endif
  60. ifeq ($(HAVE_X11),true)
  61. TARGETS += ui_lv2-x11
  62. endif
  63. endif
  64. ifeq ($(MACOS),true)
  65. TARGETS += ui_lv2-cocoa
  66. endif
  67. ifeq ($(WIN32),true)
  68. TARGETS += ui_lv2-windows
  69. endif
  70. # ---------------------------------------------------------------------------------------------------------------------
  71. all: $(TARGETS)
  72. # ---------------------------------------------------------------------------------------------------------------------
  73. clean:
  74. rm -f $(OBJDIR)/*.cpp $(OBJDIR)/*.moc $(OBJDIR)/*.o
  75. rm -f $(BINDIR)/$(MODULENAME)-lv2-gtk*
  76. rm -f $(BINDIR)/$(MODULENAME)-lv2-qt*
  77. rm -f $(BINDIR)/$(MODULENAME)-lv2-cocoa
  78. rm -f $(BINDIR)/$(MODULENAME)-lv2-x11
  79. rm -f $(BINDIR)/$(MODULENAME)-lv2-windows
  80. debug:
  81. $(MAKE) DEBUG=true
  82. doxygen: carla_bridge.doxygen
  83. doxygen $<
  84. # ---------------------------------------------------------------------------------------------------------------------
  85. ui_lv2-gtk2: $(BINDIR)/$(MODULENAME)-lv2-gtk2
  86. ui_lv2-gtk3: $(BINDIR)/$(MODULENAME)-lv2-gtk3
  87. ui_lv2-qt4: $(BINDIR)/$(MODULENAME)-lv2-qt4
  88. ui_lv2-qt5: $(BINDIR)/$(MODULENAME)-lv2-qt5
  89. ui_lv2-x11: $(BINDIR)/$(MODULENAME)-lv2-x11
  90. ui_lv2-cocoa: $(BINDIR)/$(MODULENAME)-lv2-cocoa
  91. ui_lv2-windows: $(BINDIR)/$(MODULENAME)-lv2-windows.exe
  92. # ---------------------------------------------------------------------------------------------------------------------
  93. # Common libs
  94. LIBS = \
  95. $(MODULEDIR)/lilv.a \
  96. $(MODULEDIR)/water.files.a
  97. # ---------------------------------------------------------------------------------------------------------------------
  98. # Common objects
  99. $(OBJDIR)/%.cpp.o: %.cpp
  100. -@mkdir -p $(OBJDIR)
  101. @echo "Compiling $<"
  102. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  103. # ---------------------------------------------------------------------------------------------------------------------
  104. # ui_lv2-gtk2
  105. OBJS_GTK2 = \
  106. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  107. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-gtk2.o \
  108. $(OBJDIR)/CarlaBridgeToolkitGtk.cpp-gtk2.o
  109. $(BINDIR)/$(MODULENAME)-lv2-gtk2: $(OBJS_GTK2) $(LIBS)
  110. -@mkdir -p $(BINDIR)
  111. @echo "Linking $(MODULENAME)-lv2-gtk2"
  112. @$(CXX) $(OBJS_GTK2) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_GTK2_FLAGS) -o $@
  113. $(OBJDIR)/%.cpp-gtk2.o: %.cpp
  114. -@mkdir -p $(OBJDIR)
  115. @echo "Compiling $< (GTK2)"
  116. @$(CXX) $< $(BUILD_GTK2_FLAGS) -c -o $@
  117. -include $(OBJS_GTK2:%.o=%.d)
  118. # ---------------------------------------------------------------------------------------------------------------------
  119. # ui_lv2-gtk3
  120. OBJS_GTK3 = \
  121. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  122. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-gtk3.o \
  123. $(OBJDIR)/CarlaBridgeToolkitGtk.cpp-gtk3.o
  124. $(BINDIR)/$(MODULENAME)-lv2-gtk3: $(OBJS_GTK3) $(LIBS)
  125. -@mkdir -p $(BINDIR)
  126. @echo "Linking $(MODULENAME)-lv2-gtk3"
  127. @$(CXX) $(OBJS_GTK3) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_GTK3_FLAGS) -o $@
  128. $(OBJDIR)/%.cpp-gtk3.o: %.cpp
  129. -@mkdir -p $(OBJDIR)
  130. @echo "Compiling $< (GTK3)"
  131. @$(CXX) $< $(BUILD_GTK3_FLAGS) -c -o $@
  132. -include $(OBJS_GTK3:%.o=%.d)
  133. # ---------------------------------------------------------------------------------------------------------------------
  134. # ui_lv2-qt4
  135. OBJS_QT4 = \
  136. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  137. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-qt4.o \
  138. $(OBJDIR)/CarlaBridgeToolkitQt.cpp-qt4.o
  139. $(BINDIR)/$(MODULENAME)-lv2-qt4: $(OBJS_QT4) $(LIBS) $(MODULEDIR)/theme.qt4.a
  140. -@mkdir -p $(BINDIR)
  141. @echo "Linking $(MODULENAME)-lv2-qt4"
  142. @$(CXX) $(OBJS_QT4) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(MODULEDIR)/theme.qt4.a $(LINK_QT4_FLAGS) -o $@
  143. $(OBJDIR)/%.cpp-qt4.o: %.cpp $(OBJDIR)/CarlaBridgeToolkitQt4.moc $(OBJDIR)/resources.qt4.cpp
  144. -@mkdir -p $(OBJDIR)
  145. @echo "Compiling $< (QT4)"
  146. @$(CXX) $< $(BUILD_QT4_FLAGS) -c -o $@
  147. $(OBJDIR)/CarlaBridgeToolkitQt4.moc: CarlaBridgeToolkitQt.cpp
  148. -@mkdir -p $(OBJDIR)
  149. @echo "Generating CarlaBridgeToolkitQt4.moc"
  150. @$(MOC_QT4) $< -DMOC_PARSING -o $@
  151. $(OBJDIR)/resources.qt4.cpp: ../../resources/resources-theme.qrc
  152. -@mkdir -p $(OBJDIR)
  153. @echo "Generating resources.qt4.cpp"
  154. @$(RCC_QT4) $< -o $@
  155. -include $(OBJS_QT4:%.o=%.d)
  156. # ---------------------------------------------------------------------------------------------------------------------
  157. # ui_lv2-qt5
  158. OBJS_QT5 = \
  159. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  160. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-qt5.o \
  161. $(OBJDIR)/CarlaBridgeToolkitQt.cpp-qt5.o
  162. $(BINDIR)/$(MODULENAME)-lv2-qt5: $(OBJS_QT5) $(LIBS) $(MODULEDIR)/theme.qt5.a
  163. -@mkdir -p $(BINDIR)
  164. @echo "Linking $(MODULENAME)-lv2-qt5"
  165. @$(CXX) $(OBJS_QT5) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(MODULEDIR)/theme.qt5.a $(LINK_QT5_FLAGS) -o $@
  166. $(OBJDIR)/%.cpp-qt5.o: %.cpp $(OBJDIR)/CarlaBridgeToolkitQt5.moc $(OBJDIR)/resources.qt5.cpp
  167. -@mkdir -p $(OBJDIR)
  168. @echo "Compiling $< (QT5)"
  169. @$(CXX) $< $(BUILD_QT5_FLAGS) -c -o $@
  170. $(OBJDIR)/CarlaBridgeToolkitQt5.moc: CarlaBridgeToolkitQt.cpp
  171. -@mkdir -p $(OBJDIR)
  172. @echo "Generating CarlaBridgeToolkitQt5.moc"
  173. @$(MOC_QT5) $< -DMOC_PARSING -o $@
  174. $(OBJDIR)/resources.qt5.cpp: ../../resources/resources-theme.qrc
  175. -@mkdir -p $(OBJDIR)
  176. @echo "Generating resources.qt5.cpp"
  177. @$(RCC_QT5) $< -o $@
  178. -include $(OBJS_QT5:%.o=%.d)
  179. # ---------------------------------------------------------------------------------------------------------------------
  180. # ui_lv2-x11
  181. OBJS_X11 = \
  182. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  183. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-x11.o \
  184. $(OBJDIR)/CarlaBridgeToolkitNative.cpp-x11.o
  185. $(BINDIR)/$(MODULENAME)-lv2-x11: $(OBJS_X11) $(LIBS)
  186. -@mkdir -p $(BINDIR)
  187. @echo "Linking $(MODULENAME)-lv2-x11"
  188. @$(CXX) $(OBJS_X11) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_X11_FLAGS) -o $@
  189. $(OBJDIR)/%.cpp-x11.o: %.cpp
  190. -@mkdir -p $(OBJDIR)
  191. @echo "Compiling $< (X11)"
  192. @$(CXX) $< $(BUILD_X11_FLAGS) -c -o $@
  193. -include $(OBJS_X11:%.o=%.d)
  194. # ---------------------------------------------------------------------------------------------------------------------
  195. # ui_lv2-cocoa
  196. OBJS_COCOA = \
  197. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  198. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-cocoa.o \
  199. $(OBJDIR)/CarlaBridgeToolkitNative.cpp-cocoa.o
  200. $(BINDIR)/$(MODULENAME)-lv2-cocoa: $(OBJS_COCOA) $(LIBS)
  201. -@mkdir -p $(BINDIR)
  202. @echo "Linking $(MODULENAME)-lv2-cocoa"
  203. @$(CXX) $(OBJS_COCOA) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_COCOA_FLAGS) -o $@
  204. $(OBJDIR)/%.cpp-cocoa.o: %.cpp
  205. -@mkdir -p $(OBJDIR)
  206. @echo "Compiling $< (Cocoa)"
  207. @$(CXX) $< $(BUILD_COCOA_FLAGS) -c -o $@
  208. -include $(OBJS_COCOA:%.o=%.d)
  209. # ---------------------------------------------------------------------------------------------------------------------
  210. # ui_lv2-windows
  211. OBJS_WINDOWS = \
  212. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  213. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-windows.o \
  214. $(OBJDIR)/CarlaBridgeToolkitNative.cpp-windows.o
  215. $(BINDIR)/$(MODULENAME)-lv2-windows.exe: $(OBJS_WINDOWS) $(LIBS)
  216. -@mkdir -p $(BINDIR)
  217. @echo "Linking $(MODULENAME)-lv2-windows.exe"
  218. @$(CXX) $(OBJS_WINDOWS) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_WINDOWS_FLAGS) -o $@
  219. $(OBJDIR)/%.cpp-windows.o: %.cpp
  220. -@mkdir -p $(OBJDIR)
  221. @echo "Compiling $< (Windows)"
  222. @$(CXX) $< $(BUILD_WINDOWS_FLAGS) -c -o $@
  223. -include $(OBJS_WINDOWS:%.o=%.d)
  224. # ---------------------------------------------------------------------------------------------------------------------