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.

304 lines
9.6KB

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