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.9KB

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