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 10KB

11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
2 years ago
2 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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. ifneq ($(WASM),true)
  22. ifeq ($(HAIKU),true)
  23. LINK_FLAGS += -lpthread
  24. else
  25. LINK_FLAGS += -pthread
  26. endif
  27. endif
  28. # ---------------------------------------------------------------------------------------------------------------------
  29. BUILD_GTK2_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_GTK2 $(X11_FLAGS)
  30. LINK_GTK2_FLAGS = $(LINK_FLAGS) $(X11_LIBS) $(LIBDL_LIBS)
  31. BUILD_GTK3_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_GTK3 $(X11_FLAGS)
  32. LINK_GTK3_FLAGS = $(LINK_FLAGS) $(X11_LIBS) $(LIBDL_LIBS)
  33. BUILD_QT4_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_QT4 $(shell pkg-config --cflags QtCore QtGui) $(X11_FLAGS) -I$(OBJDIR) -I$(CWD)/theme -Wno-unused-variable
  34. LINK_QT4_FLAGS = $(LINK_FLAGS) $(shell pkg-config --libs QtCore QtGui) $(X11_LIBS) $(LIBDL_LIBS)
  35. BUILD_QT5_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_QT5 $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets) -I$(OBJDIR) -I$(CWD)/theme
  36. LINK_QT5_FLAGS = $(LINK_FLAGS) $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets) $(LIBDL_LIBS)
  37. BUILD_X11_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_X11 $(X11_FLAGS)
  38. LINK_X11_FLAGS = $(LINK_FLAGS) $(X11_LIBS) $(LIBDL_LIBS)
  39. BUILD_COCOA_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_COCOA -ObjC++
  40. LINK_COCOA_FLAGS = $(LINK_FLAGS) -framework Cocoa $(LIBDL_LIBS)
  41. BUILD_WINDOWS_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_HWND
  42. LINK_WINDOWS_FLAGS = $(LINK_FLAGS) -static -mwindows
  43. ifeq ($(MACOS),true)
  44. BUILD_GTK2_FLAGS += -ObjC++
  45. BUILD_GTK3_FLAGS += -ObjC++
  46. endif
  47. ifeq ($(TESTBUILD),true)
  48. BUILD_QT4_FLAGS += -isystem /usr/include/qt4
  49. BUILD_QT5_FLAGS += -isystem /usr/include/qt5
  50. BUILD_QT5_FLAGS += -isystem /usr/include/x86_64-linux-gnu/qt5
  51. endif
  52. # ---------------------------------------------------------------------------------------------------------------------
  53. TARGETS += ui_lv2-gtk2
  54. TARGETS += ui_lv2-gtk3
  55. ifneq ($(MACOS_OR_WINDOWS),true)
  56. ifeq ($(HAVE_QT4),true)
  57. TARGETS += ui_lv2-qt4
  58. endif
  59. ifeq ($(HAVE_QT5),true)
  60. TARGETS += ui_lv2-qt5
  61. endif
  62. ifeq ($(HAVE_X11),true)
  63. TARGETS += ui_lv2-x11
  64. endif
  65. endif
  66. ifeq ($(MACOS),true)
  67. TARGETS += ui_lv2-cocoa
  68. endif
  69. ifeq ($(WINDOWS),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$(APP_EXT)
  88. ui_lv2-gtk3: $(BINDIR)/$(MODULENAME)-lv2-gtk3$(APP_EXT)
  89. ui_lv2-qt4: $(BINDIR)/$(MODULENAME)-lv2-qt4$(APP_EXT)
  90. ui_lv2-qt5: $(BINDIR)/$(MODULENAME)-lv2-qt5$(APP_EXT)
  91. ui_lv2-x11: $(BINDIR)/$(MODULENAME)-lv2-x11$(APP_EXT)
  92. ui_lv2-cocoa: $(BINDIR)/$(MODULENAME)-lv2-cocoa$(APP_EXT)
  93. ui_lv2-windows: $(BINDIR)/$(MODULENAME)-lv2-windows$(APP_EXT)
  94. # ---------------------------------------------------------------------------------------------------------------------
  95. # Common libs
  96. LIBS = \
  97. $(MODULEDIR)/lilv.a \
  98. $(MODULEDIR)/water.files.a
  99. # ---------------------------------------------------------------------------------------------------------------------
  100. # Common objects
  101. $(OBJDIR)/%.cpp.o: %.cpp
  102. -@mkdir -p $(OBJDIR)
  103. @echo "Compiling $<"
  104. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  105. # ---------------------------------------------------------------------------------------------------------------------
  106. # ui_lv2-gtk2
  107. OBJS_GTK2 = \
  108. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  109. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-gtk2.o \
  110. $(OBJDIR)/CarlaBridgeToolkitGtk.cpp-gtk2.o
  111. $(BINDIR)/$(MODULENAME)-lv2-gtk2$(APP_EXT): $(OBJS_GTK2) $(LIBS)
  112. -@mkdir -p $(BINDIR)
  113. @echo "Linking $(MODULENAME)-lv2-gtk2$(APP_EXT)"
  114. $(SILENT)$(CXX) $(OBJS_GTK2) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_GTK2_FLAGS) -o $@
  115. $(OBJDIR)/%.cpp-gtk2.o: %.cpp
  116. -@mkdir -p $(OBJDIR)
  117. @echo "Compiling $< (GTK2)"
  118. $(SILENT)$(CXX) $< $(BUILD_GTK2_FLAGS) -c -o $@
  119. -include $(OBJS_GTK2:%.o=%.d)
  120. # ---------------------------------------------------------------------------------------------------------------------
  121. # ui_lv2-gtk3
  122. OBJS_GTK3 = \
  123. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  124. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-gtk3.o \
  125. $(OBJDIR)/CarlaBridgeToolkitGtk.cpp-gtk3.o
  126. $(BINDIR)/$(MODULENAME)-lv2-gtk3$(APP_EXT): $(OBJS_GTK3) $(LIBS)
  127. -@mkdir -p $(BINDIR)
  128. @echo "Linking $(MODULENAME)-lv2-gtk3$(APP_EXT)"
  129. $(SILENT)$(CXX) $(OBJS_GTK3) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_GTK3_FLAGS) -o $@
  130. $(OBJDIR)/%.cpp-gtk3.o: %.cpp
  131. -@mkdir -p $(OBJDIR)
  132. @echo "Compiling $< (GTK3)"
  133. $(SILENT)$(CXX) $< $(BUILD_GTK3_FLAGS) -c -o $@
  134. -include $(OBJS_GTK3:%.o=%.d)
  135. # ---------------------------------------------------------------------------------------------------------------------
  136. # ui_lv2-qt4
  137. OBJS_QT4 = \
  138. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  139. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-qt4.o \
  140. $(OBJDIR)/CarlaBridgeToolkitQt.cpp-qt4.o
  141. $(BINDIR)/$(MODULENAME)-lv2-qt4$(APP_EXT): $(OBJS_QT4) $(LIBS) $(MODULEDIR)/theme.qt4.a
  142. -@mkdir -p $(BINDIR)
  143. @echo "Linking $(MODULENAME)-lv2-qt4$(APP_EXT)"
  144. $(SILENT)$(CXX) $(OBJS_QT4) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(MODULEDIR)/theme.qt4.a $(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. $(SILENT)$(CXX) $< $(BUILD_QT4_FLAGS) -c -o $@
  149. $(OBJDIR)/CarlaBridgeToolkitQt4.moc: CarlaBridgeToolkitQt.cpp
  150. -@mkdir -p $(OBJDIR)
  151. @echo "Generating CarlaBridgeToolkitQt4.moc"
  152. $(SILENT)$(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. $(SILENT)$(RCC_QT4) $< -o $@
  157. -include $(OBJS_QT4:%.o=%.d)
  158. # ---------------------------------------------------------------------------------------------------------------------
  159. # ui_lv2-qt5
  160. OBJS_QT5 = \
  161. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  162. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-qt5.o \
  163. $(OBJDIR)/CarlaBridgeToolkitQt.cpp-qt5.o
  164. $(BINDIR)/$(MODULENAME)-lv2-qt5$(APP_EXT): $(OBJS_QT5) $(LIBS) $(MODULEDIR)/theme.qt5.a
  165. -@mkdir -p $(BINDIR)
  166. @echo "Linking $(MODULENAME)-lv2-qt5$(APP_EXT)"
  167. $(SILENT)$(CXX) $(OBJS_QT5) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(MODULEDIR)/theme.qt5.a $(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. $(SILENT)$(CXX) $< $(BUILD_QT5_FLAGS) -c -o $@
  172. $(OBJDIR)/CarlaBridgeToolkitQt5.moc: CarlaBridgeToolkitQt.cpp
  173. -@mkdir -p $(OBJDIR)
  174. @echo "Generating CarlaBridgeToolkitQt5.moc"
  175. $(SILENT)$(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. $(SILENT)$(RCC_QT5) $< -o $@
  180. -include $(OBJS_QT5:%.o=%.d)
  181. # ---------------------------------------------------------------------------------------------------------------------
  182. # ui_lv2-x11
  183. OBJS_X11 = \
  184. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  185. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-x11.o \
  186. $(OBJDIR)/CarlaBridgeToolkitNative.cpp-x11.o
  187. $(BINDIR)/$(MODULENAME)-lv2-x11$(APP_EXT): $(OBJS_X11) $(LIBS)
  188. -@mkdir -p $(BINDIR)
  189. @echo "Linking $(MODULENAME)-lv2-x11$(APP_EXT)"
  190. $(SILENT)$(CXX) $(OBJS_X11) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_X11_FLAGS) -o $@
  191. $(OBJDIR)/%.cpp-x11.o: %.cpp
  192. -@mkdir -p $(OBJDIR)
  193. @echo "Compiling $< (X11)"
  194. $(SILENT)$(CXX) $< $(BUILD_X11_FLAGS) -c -o $@
  195. -include $(OBJS_X11:%.o=%.d)
  196. # ---------------------------------------------------------------------------------------------------------------------
  197. # ui_lv2-cocoa
  198. OBJS_COCOA = \
  199. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  200. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-cocoa.o \
  201. $(OBJDIR)/CarlaBridgeToolkitNative.cpp-cocoa.o
  202. $(BINDIR)/$(MODULENAME)-lv2-cocoa$(APP_EXT): $(OBJS_COCOA) $(LIBS)
  203. -@mkdir -p $(BINDIR)
  204. @echo "Linking $(MODULENAME)-lv2-cocoa$(APP_EXT)"
  205. $(SILENT)$(CXX) $(OBJS_COCOA) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_COCOA_FLAGS) -o $@
  206. $(OBJDIR)/%.cpp-cocoa.o: %.cpp
  207. -@mkdir -p $(OBJDIR)
  208. @echo "Compiling $< (Cocoa)"
  209. $(SILENT)$(CXX) $< $(BUILD_COCOA_FLAGS) -c -o $@
  210. -include $(OBJS_COCOA:%.o=%.d)
  211. # ---------------------------------------------------------------------------------------------------------------------
  212. # ui_lv2-windows
  213. OBJS_WINDOWS = \
  214. $(OBJDIR)/CarlaBridgeFormat.cpp.o \
  215. $(OBJDIR)/CarlaBridgeFormatLV2.cpp-windows.o \
  216. $(OBJDIR)/CarlaBridgeToolkitNative.cpp-windows.o
  217. $(BINDIR)/$(MODULENAME)-lv2-windows$(APP_EXT): $(OBJS_WINDOWS) $(LIBS)
  218. -@mkdir -p $(BINDIR)
  219. @echo "Linking $(MODULENAME)-lv2-windows$(APP_EXT)"
  220. $(SILENT)$(CXX) $(OBJS_WINDOWS) $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_WINDOWS_FLAGS) -o $@
  221. $(OBJDIR)/%.cpp-windows.o: %.cpp
  222. -@mkdir -p $(OBJDIR)
  223. @echo "Compiling $< (Windows)"
  224. $(SILENT)$(CXX) $< $(BUILD_WINDOWS_FLAGS) -c -o $@
  225. -include $(OBJS_WINDOWS:%.o=%.d)
  226. # ---------------------------------------------------------------------------------------------------------------------