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