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.

259 lines
9.2KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-discovery #
  3. # ---------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. MODULENAME=carla-discovery
  8. include $(CWD)/Makefile.mk
  9. ifeq ($(WIN64),true)
  10. winv=64
  11. else
  12. winv=32
  13. endif
  14. # Workaround GCC bug
  15. ifeq ($(TESTBUILD),true)
  16. ifeq ($(USING_JUCE),true)
  17. BUILD_CXX_FLAGS += -Wno-undef
  18. endif
  19. endif
  20. # ---------------------------------------------------------------------------------------------------------------------
  21. BINDIR := $(CWD)/../bin
  22. ifeq ($(DEBUG),true)
  23. OBJDIR := $(CWD)/../build/discovery/Debug
  24. MODULEDIR := $(CWD)/../build/modules/Debug
  25. else
  26. OBJDIR := $(CWD)/../build/discovery/Release
  27. MODULEDIR := $(CWD)/../build/modules/Release
  28. endif
  29. # ---------------------------------------------------------------------------------------------------------------------
  30. BUILD_CXX_FLAGS += -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
  31. ifeq ($(MACOS),true)
  32. BUILD_CXX_FLAGS += -ObjC++
  33. endif
  34. ifeq ($(WIN32),true)
  35. LINK_FLAGS += -lole32 -lssp -mwindows
  36. endif
  37. ifeq ($(USING_JUCE),true)
  38. BUILD_CXX_FLAGS += -std=gnu++14
  39. endif
  40. ifeq ($(USING_JUCE),true)
  41. ifeq ($(WIN32),true)
  42. BUILD_CXX_FLAGS += -I$(CWD)/modules/mingw-std-threads
  43. endif
  44. endif
  45. 32BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  46. 64BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  47. ARM32_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  48. # ---------------------------------------------------------------------------------------------------------------------
  49. NATIVE_BUILD_FLAGS =
  50. NATIVE_LINK_FLAGS =
  51. ifeq ($(HAVE_FLUIDSYNTH),true)
  52. NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
  53. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  54. endif
  55. NATIVE_BUILD_FLAGS += $(YSFX_FLAGS)
  56. # ---------------------------------------------------------------------------------------------------------------------
  57. LIBS_native = $(MODULEDIR)/lilv.a
  58. LIBS_arm32 = $(MODULEDIR)/lilv.arm32.a
  59. LIBS_posix32 = $(MODULEDIR)/lilv.posix32.a
  60. LIBS_posix64 = $(MODULEDIR)/lilv.posix64.a
  61. LIBS_win32 = $(MODULEDIR)/lilv.win32.a
  62. LIBS_win64 = $(MODULEDIR)/lilv.win64.a
  63. LINK_FLAGS += $(LILV_LIBS)
  64. LIBS_native += $(MODULEDIR)/water.files.a
  65. LIBS_arm32 = $(MODULEDIR)/water.files.arm32.a
  66. LIBS_posix32 = $(MODULEDIR)/water.posix32.a
  67. LIBS_posix64 = $(MODULEDIR)/water.posix64.a
  68. LIBS_win32 = $(MODULEDIR)/water.win32.a
  69. LIBS_win64 = $(MODULEDIR)/water.win64.a
  70. LINK_FLAGS += $(WATER_LIBS)
  71. LINK_FLAGS += $(LIBDL_LIBS)
  72. ifeq ($(USING_JUCE),true)
  73. LIBS_native += $(MODULEDIR)/carla_juce.a
  74. LIBS_posix32 += $(MODULEDIR)/carla_juce.posix32.a
  75. LIBS_posix64 += $(MODULEDIR)/carla_juce.posix64.a
  76. LIBS_win32 += $(MODULEDIR)/carla_juce.win32.a
  77. LIBS_win64 += $(MODULEDIR)/carla_juce.win64.a
  78. LIBS_native += $(MODULEDIR)/juce_audio_basics.a
  79. LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a
  80. LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a
  81. LIBS_win32 += $(MODULEDIR)/juce_audio_basics.win32.a
  82. LIBS_win64 += $(MODULEDIR)/juce_audio_basics.win64.a
  83. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  84. LIBS_native += $(MODULEDIR)/juce_audio_processors.a
  85. LIBS_posix32 += $(MODULEDIR)/juce_audio_processors.posix32.a
  86. LIBS_posix64 += $(MODULEDIR)/juce_audio_processors.posix64.a
  87. LIBS_win32 += $(MODULEDIR)/juce_audio_processors.win32.a
  88. LIBS_win64 += $(MODULEDIR)/juce_audio_processors.win64.a
  89. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  90. LIBS_native += $(MODULEDIR)/juce_core.a
  91. LIBS_posix32 += $(MODULEDIR)/juce_core.posix32.a
  92. LIBS_posix64 += $(MODULEDIR)/juce_core.posix64.a
  93. LIBS_win32 += $(MODULEDIR)/juce_core.win32.a
  94. LIBS_win64 += $(MODULEDIR)/juce_core.win64.a
  95. LINK_FLAGS += $(JUCE_CORE_LIBS)
  96. LIBS_native += $(MODULEDIR)/juce_data_structures.a
  97. LIBS_posix32 += $(MODULEDIR)/juce_data_structures.posix32.a
  98. LIBS_posix64 += $(MODULEDIR)/juce_data_structures.posix64.a
  99. LIBS_win32 += $(MODULEDIR)/juce_data_structures.win32.a
  100. LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a
  101. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  102. LIBS_native += $(MODULEDIR)/juce_events.a
  103. LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a
  104. LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a
  105. LIBS_win32 += $(MODULEDIR)/juce_events.win32.a
  106. LIBS_win64 += $(MODULEDIR)/juce_events.win64.a
  107. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  108. LIBS_native += $(MODULEDIR)/juce_graphics.a
  109. LIBS_posix32 += $(MODULEDIR)/juce_graphics.posix32.a
  110. LIBS_posix64 += $(MODULEDIR)/juce_graphics.posix64.a
  111. LIBS_win32 += $(MODULEDIR)/juce_graphics.win32.a
  112. LIBS_win64 += $(MODULEDIR)/juce_graphics.win64.a
  113. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  114. LIBS_native += $(MODULEDIR)/juce_gui_basics.a
  115. LIBS_posix32 += $(MODULEDIR)/juce_gui_basics.posix32.a
  116. LIBS_posix64 += $(MODULEDIR)/juce_gui_basics.posix64.a
  117. LIBS_win32 += $(MODULEDIR)/juce_gui_basics.win32.a
  118. LIBS_win64 += $(MODULEDIR)/juce_gui_basics.win64.a
  119. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  120. LIBS_native += $(MODULEDIR)/juce_gui_extra.a
  121. LIBS_posix32 += $(MODULEDIR)/juce_gui_extra.posix32.a
  122. LIBS_posix64 += $(MODULEDIR)/juce_gui_extra.posix64.a
  123. LIBS_win32 += $(MODULEDIR)/juce_gui_extra.win32.a
  124. LIBS_win64 += $(MODULEDIR)/juce_gui_extra.win64.a
  125. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  126. endif # USING_JUCE
  127. LIBS_native += $(MODULEDIR)/ysfx.a
  128. LINK_FLAGS += $(YSFX_GRAPHICS_LIBS)
  129. # ---------------------------------------------------------------------------------------------------------------------
  130. OBJS_native = $(OBJDIR)/$(MODULENAME).cpp.o
  131. OBJS_arm32 = $(OBJDIR)/$(MODULENAME).cpp.arm32.o
  132. OBJS_posix32 = $(OBJDIR)/$(MODULENAME).cpp.posix32.o
  133. OBJS_posix64 = $(OBJDIR)/$(MODULENAME).cpp.posix64.o
  134. OBJS_win32 = $(OBJDIR)/$(MODULENAME).cpp.win32.o
  135. OBJS_win64 = $(OBJDIR)/$(MODULENAME).cpp.win64.o
  136. # ---------------------------------------------------------------------------------------------------------------------
  137. all: native
  138. # ---------------------------------------------------------------------------------------------------------------------
  139. clean:
  140. rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-*
  141. debug:
  142. $(MAKE) DEBUG=true
  143. # ---------------------------------------------------------------------------------------------------------------------
  144. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT)
  145. arm32: $(BINDIR)/$(MODULENAME)-arm32
  146. posix32: $(BINDIR)/$(MODULENAME)-posix32
  147. posix64: $(BINDIR)/$(MODULENAME)-posix64
  148. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  149. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  150. # ---------------------------------------------------------------------------------------------------------------------
  151. $(BINDIR)/$(MODULENAME)-native: $(OBJS_native) $(LIBS_native)
  152. -@mkdir -p $(BINDIR)
  153. @echo "Linking $(MODULENAME)-native"
  154. $(SILENT)$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  155. $(BINDIR)/$(MODULENAME)-native.exe: $(OBJS_native) $(LIBS_native)
  156. -@mkdir -p $(BINDIR)
  157. @echo "Linking $(MODULENAME)-native.exe"
  158. $(SILENT)$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  159. $(BINDIR)/$(MODULENAME)-arm32: $(OBJS_arm32) $(LIBS_arm32)
  160. -@mkdir -p $(BINDIR)
  161. @echo "Linking $(MODULENAME)-posix32"
  162. $(SILENT)$(CXX) $(OBJS_arm32) $(LIBS_START) $(LIBS_arm32) $(LIBS_END) $(LINK_FLAGS) $(ARM32_FLAGS) -o $@
  163. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  164. -@mkdir -p $(BINDIR)
  165. @echo "Linking $(MODULENAME)-posix32"
  166. $(SILENT)$(CXX) $(OBJS_posix32) $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  167. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  168. -@mkdir -p $(BINDIR)
  169. @echo "Linking $(MODULENAME)-posix64"
  170. $(SILENT)$(CXX) $(OBJS_posix64) $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  171. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  172. -@mkdir -p $(BINDIR)
  173. @echo "Linking $(MODULENAME)-win32.exe"
  174. $(SILENT)$(CXX) $(OBJS_win32) $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  175. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  176. -@mkdir -p $(BINDIR)
  177. @echo "Linking $(MODULENAME)-win64.exe"
  178. $(SILENT)$(CXX) $(OBJS_win64) $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  179. # ---------------------------------------------------------------------------------------------------------------------
  180. $(OBJDIR)/$(MODULENAME).cpp.o: $(MODULENAME).cpp
  181. -@mkdir -p $(OBJDIR)
  182. @echo "Compiling $<"
  183. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  184. $(OBJDIR)/$(MODULENAME).cpp.%32.o: $(MODULENAME).cpp
  185. -@mkdir -p $(OBJDIR)
  186. @echo "Compiling $< (32bit)"
  187. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  188. $(OBJDIR)/$(MODULENAME).cpp.%64.o: $(MODULENAME).cpp
  189. -@mkdir -p $(OBJDIR)
  190. @echo "Compiling $< (64bit)"
  191. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  192. $(OBJDIR)/$(MODULENAME).cpp.arm32.o: $(MODULENAME).cpp
  193. -@mkdir -p $(OBJDIR)
  194. @echo "Compiling $< (ARM32)"
  195. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@
  196. # ---------------------------------------------------------------------------------------------------------------------
  197. -include $(OBJS_native:%.o=%.d)
  198. -include $(OBJS_arm32:%.o=%.d)
  199. -include $(OBJS_posix32:%.o=%.d)
  200. -include $(OBJS_posix64:%.o=%.d)
  201. -include $(OBJS_win32:%.o=%.d)
  202. -include $(OBJS_win64:%.o=%.d)
  203. # ---------------------------------------------------------------------------------------------------------------------