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

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