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.

Makefile 9.7KB

11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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 += $(JUCE_CORE_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
  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-*
  78. debug:
  79. $(MAKE) DEBUG=true
  80. doxygen: carla_bridge.doxygen
  81. doxygen $<
  82. # ----------------------------------------------------------------------------------------------------------------------------
  83. ui_lv2-gtk2: $(BINDIR)/$(MODULENAME)-lv2-gtk2
  84. ui_lv2-gtk3: $(BINDIR)/$(MODULENAME)-lv2-gtk3
  85. ui_lv2-qt4: $(BINDIR)/$(MODULENAME)-lv2-qt4
  86. ui_lv2-qt5: $(BINDIR)/$(MODULENAME)-lv2-qt5
  87. ui_lv2-x11: $(BINDIR)/$(MODULENAME)-lv2-x11
  88. ui_lv2-cocoa: $(BINDIR)/$(MODULENAME)-lv2-cocoa
  89. ui_lv2-windows: $(BINDIR)/$(MODULENAME)-lv2-windows.exe
  90. # ----------------------------------------------------------------------------------------------------------------------------
  91. # Common libs
  92. LIBS = \
  93. $(MODULEDIR)/juce_core.a \
  94. $(MODULEDIR)/lilv.a
  95. LIBS_JUCE = \
  96. $(LIBS) \
  97. $(MODULEDIR)/juce_data_structures.a \
  98. $(MODULEDIR)/juce_events.a \
  99. $(MODULEDIR)/juce_graphics.a \
  100. $(MODULEDIR)/juce_gui_basics.a
  101. ifeq ($(MACOS),true)
  102. LIBS_JUCE += \
  103. $(MODULEDIR)/juce_gui_extra.a
  104. endif
  105. # ----------------------------------------------------------------------------------------------------------------------------
  106. # Common objects
  107. $(OBJDIR)/%.cpp.o: %.cpp
  108. -@mkdir -p $(OBJDIR)
  109. @echo "Compiling $<"
  110. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  111. # ----------------------------------------------------------------------------------------------------------------------------
  112. # ui_lv2-gtk2
  113. OBJS_GTK2 = \
  114. $(OBJDIR)/CarlaBridgeUI.cpp.o \
  115. $(OBJDIR)/CarlaBridgeUI-LV2.cpp-gtk2.o \
  116. $(OBJDIR)/CarlaBridgeToolkitGtk.cpp-gtk2.o
  117. $(BINDIR)/$(MODULENAME)-lv2-gtk2: $(OBJS_GTK2) $(LIBS)
  118. -@mkdir -p $(BINDIR)
  119. @echo "Linking $(MODULENAME)-lv2-gtk2"
  120. @$(CXX) $(OBJS_GTK2) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_GTK2_FLAGS) -o $@
  121. $(OBJDIR)/%.cpp-gtk2.o: %.cpp
  122. -@mkdir -p $(OBJDIR)
  123. @echo "Compiling $< (GTK2)"
  124. @$(CXX) $< $(BUILD_GTK2_FLAGS) -c -o $@
  125. -include $(OBJS_GTK2:%.o=%.d)
  126. # ----------------------------------------------------------------------------------------------------------------------------
  127. # ui_lv2-gtk3
  128. OBJS_GTK3 = \
  129. $(OBJDIR)/CarlaBridgeUI.cpp.o \
  130. $(OBJDIR)/CarlaBridgeUI-LV2.cpp-gtk3.o \
  131. $(OBJDIR)/CarlaBridgeToolkitGtk.cpp-gtk3.o
  132. $(BINDIR)/$(MODULENAME)-lv2-gtk3: $(OBJS_GTK3) $(LIBS)
  133. -@mkdir -p $(BINDIR)
  134. @echo "Linking $(MODULENAME)-lv2-gtk3"
  135. @$(CXX) $(OBJS_GTK3) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_GTK3_FLAGS) -o $@
  136. $(OBJDIR)/%.cpp-gtk3.o: %.cpp
  137. -@mkdir -p $(OBJDIR)
  138. @echo "Compiling $< (GTK3)"
  139. @$(CXX) $< $(BUILD_GTK3_FLAGS) -c -o $@
  140. -include $(OBJS_GTK3:%.o=%.d)
  141. # ----------------------------------------------------------------------------------------------------------------------------
  142. # ui_lv2-qt4
  143. OBJS_QT4 = \
  144. $(OBJDIR)/CarlaBridgeUI.cpp.o \
  145. $(OBJDIR)/CarlaBridgeUI-LV2.cpp-qt4.o \
  146. $(OBJDIR)/CarlaBridgeToolkitQt.cpp-qt4.o
  147. $(BINDIR)/$(MODULENAME)-lv2-qt4: $(OBJS_QT4) $(LIBS) $(MODULEDIR)/theme.qt4.a
  148. -@mkdir -p $(BINDIR)
  149. @echo "Linking $(MODULENAME)-lv2-qt4"
  150. @$(CXX) $(OBJS_QT4) $(LIBS_START) $(LIBS) $(MODULEDIR)/theme.qt4.a $(LIBS_END) $(LINK_QT4_FLAGS) -o $@
  151. $(OBJDIR)/%.cpp-qt4.o: %.cpp $(OBJDIR)/CarlaBridgeToolkitQt4.moc $(OBJDIR)/resources.qt4.cpp
  152. -@mkdir -p $(OBJDIR)
  153. @echo "Compiling $< (QT4)"
  154. @$(CXX) $< $(BUILD_QT4_FLAGS) -c -o $@
  155. $(OBJDIR)/CarlaBridgeToolkitQt4.moc: CarlaBridgeToolkitQt.cpp
  156. -@mkdir -p $(OBJDIR)
  157. @echo "Generating CarlaBridgeToolkitQt4.moc"
  158. @$(MOC_QT4) $< -DMOC_PARSING -o $@
  159. $(OBJDIR)/resources.qt4.cpp: ../../resources/resources-theme.qrc
  160. -@mkdir -p $(OBJDIR)
  161. @echo "Generating resources.qt4.cpp"
  162. @$(RCC_QT4) $< -o $@
  163. -include $(OBJS_QT4:%.o=%.d)
  164. # ----------------------------------------------------------------------------------------------------------------------------
  165. # ui_lv2-qt5
  166. OBJS_QT5 = \
  167. $(OBJDIR)/CarlaBridgeUI.cpp.o \
  168. $(OBJDIR)/CarlaBridgeUI-LV2.cpp-qt5.o \
  169. $(OBJDIR)/CarlaBridgeToolkitQt.cpp-qt5.o
  170. $(BINDIR)/$(MODULENAME)-lv2-qt5: $(OBJS_QT5) $(LIBS) $(MODULEDIR)/theme.qt5.a
  171. -@mkdir -p $(BINDIR)
  172. @echo "Linking $(MODULENAME)-lv2-qt5"
  173. @$(CXX) $(OBJS_QT5) $(LIBS_START) $(LIBS) $(MODULEDIR)/theme.qt5.a $(LIBS_END) $(LINK_QT5_FLAGS) -o $@
  174. $(OBJDIR)/%.cpp-qt5.o: %.cpp $(OBJDIR)/CarlaBridgeToolkitQt5.moc $(OBJDIR)/resources.qt5.cpp
  175. -@mkdir -p $(OBJDIR)
  176. @echo "Compiling $< (QT5)"
  177. @$(CXX) $< $(BUILD_QT5_FLAGS) -c -o $@
  178. $(OBJDIR)/CarlaBridgeToolkitQt5.moc: CarlaBridgeToolkitQt.cpp
  179. -@mkdir -p $(OBJDIR)
  180. @echo "Generating CarlaBridgeToolkitQt5.moc"
  181. @$(MOC_QT5) $< -DMOC_PARSING -o $@
  182. $(OBJDIR)/resources.qt5.cpp: ../../resources/resources-theme.qrc
  183. -@mkdir -p $(OBJDIR)
  184. @echo "Generating resources.qt5.cpp"
  185. @$(RCC_QT5) $< -o $@
  186. -include $(OBJS_QT5:%.o=%.d)
  187. # ----------------------------------------------------------------------------------------------------------------------------
  188. # ui_lv2-x11
  189. OBJS_X11 = \
  190. $(OBJDIR)/CarlaBridgeUI.cpp.o \
  191. $(OBJDIR)/CarlaBridgeUI-LV2.cpp-x11.o \
  192. $(OBJDIR)/CarlaBridgeToolkitPlugin.cpp-x11.o
  193. $(BINDIR)/$(MODULENAME)-lv2-x11: $(OBJS_X11) $(LIBS)
  194. -@mkdir -p $(BINDIR)
  195. @echo "Linking $(MODULENAME)-lv2-x11"
  196. @$(CXX) $(OBJS_X11) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_X11_FLAGS) -o $@
  197. $(OBJDIR)/%.cpp-x11.o: %.cpp
  198. -@mkdir -p $(OBJDIR)
  199. @echo "Compiling $< (X11)"
  200. @$(CXX) $< $(BUILD_X11_FLAGS) -c -o $@
  201. -include $(OBJS_X11:%.o=%.d)
  202. # ----------------------------------------------------------------------------------------------------------------------------
  203. # ui_lv2-cocoa
  204. OBJS_COCOA = \
  205. $(OBJDIR)/CarlaBridgeUI.cpp.o \
  206. $(OBJDIR)/CarlaBridgeUI-LV2.cpp-cocoa.o \
  207. $(OBJDIR)/CarlaBridgeToolkitPlugin.cpp-cocoa.o
  208. $(BINDIR)/$(MODULENAME)-lv2-cocoa: $(OBJS_COCOA) $(LIBS_JUCE)
  209. -@mkdir -p $(BINDIR)
  210. @echo "Linking $(MODULENAME)-lv2-cocoa"
  211. @$(CXX) $(OBJS_COCOA) $(LIBS_START) $(LIBS_JUCE) $(LIBS_END) $(LINK_COCOA_FLAGS) -o $@
  212. $(OBJDIR)/%.cpp-cocoa.o: %.cpp
  213. -@mkdir -p $(OBJDIR)
  214. @echo "Compiling $< (Cocoa)"
  215. @$(CXX) $< $(BUILD_COCOA_FLAGS) -c -o $@
  216. -include $(OBJS_COCOA:%.o=%.d)
  217. # ----------------------------------------------------------------------------------------------------------------------------
  218. # ui_lv2-windows
  219. OBJS_WINDOWS = \
  220. $(OBJDIR)/CarlaBridgeUI.cpp.o \
  221. $(OBJDIR)/CarlaBridgeUI-LV2.cpp-windows.o \
  222. $(OBJDIR)/CarlaBridgeToolkitPlugin.cpp-windows.o
  223. $(BINDIR)/$(MODULENAME)-lv2-windows.exe: $(OBJS_WINDOWS) $(LIBS_JUCE)
  224. -@mkdir -p $(BINDIR)
  225. @echo "Linking $(MODULENAME)-lv2-windows.exe"
  226. @$(CXX) $(OBJS_WINDOWS) $(LIBS_START) $(LIBS_JUCE) $(LIBS_END) $(LINK_WINDOWS_FLAGS) -o $@
  227. $(OBJDIR)/%.cpp-windows.o: %.cpp
  228. -@mkdir -p $(OBJDIR)
  229. @echo "Compiling $< (Windows)"
  230. @$(CXX) $< $(BUILD_WINDOWS_FLAGS) -c -o $@
  231. -include $(OBJS_WINDOWS:%.o=%.d)
  232. # ----------------------------------------------------------------------------------------------------------------------------