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.

245 lines
8.6KB

  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. 32BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  38. 64BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  39. ARM32_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  40. # ---------------------------------------------------------------------------------------------------------------------
  41. NATIVE_BUILD_FLAGS =
  42. NATIVE_LINK_FLAGS =
  43. ifeq ($(HAVE_FLUIDSYNTH),true)
  44. NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
  45. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  46. endif
  47. NATIVE_BUILD_FLAGS += $(JSUSFX_FLAGS)
  48. # ---------------------------------------------------------------------------------------------------------------------
  49. LIBS_native = $(MODULEDIR)/lilv.a
  50. LIBS_arm32 = $(MODULEDIR)/lilv.arm32.a
  51. LIBS_posix32 = $(MODULEDIR)/lilv.posix32.a
  52. LIBS_posix64 = $(MODULEDIR)/lilv.posix64.a
  53. LIBS_win32 = $(MODULEDIR)/lilv.win32.a
  54. LIBS_win64 = $(MODULEDIR)/lilv.win64.a
  55. LINK_FLAGS += $(LILV_LIBS)
  56. LIBS_native += $(MODULEDIR)/water.files.a
  57. LIBS_arm32 = $(MODULEDIR)/water.files.arm32.a
  58. LIBS_posix32 = $(MODULEDIR)/water.posix32.a
  59. LIBS_posix64 = $(MODULEDIR)/water.posix64.a
  60. LIBS_win32 = $(MODULEDIR)/water.win32.a
  61. LIBS_win64 = $(MODULEDIR)/water.win64.a
  62. LINK_FLAGS += $(WATER_LIBS)
  63. LINK_FLAGS += $(LIBDL_LIBS)
  64. ifeq ($(USING_JUCE),true)
  65. LIBS_native += $(MODULEDIR)/juce_audio_basics.a
  66. LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a
  67. LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a
  68. LIBS_win32 += $(MODULEDIR)/juce_audio_basics.win32.a
  69. LIBS_win64 += $(MODULEDIR)/juce_audio_basics.win64.a
  70. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  71. LIBS_native += $(MODULEDIR)/juce_audio_processors.a
  72. LIBS_posix32 += $(MODULEDIR)/juce_audio_processors.posix32.a
  73. LIBS_posix64 += $(MODULEDIR)/juce_audio_processors.posix64.a
  74. LIBS_win32 += $(MODULEDIR)/juce_audio_processors.win32.a
  75. LIBS_win64 += $(MODULEDIR)/juce_audio_processors.win64.a
  76. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  77. LIBS_native += $(MODULEDIR)/juce_core.a
  78. LIBS_posix32 += $(MODULEDIR)/juce_core.posix32.a
  79. LIBS_posix64 += $(MODULEDIR)/juce_core.posix64.a
  80. LIBS_win32 += $(MODULEDIR)/juce_core.win32.a
  81. LIBS_win64 += $(MODULEDIR)/juce_core.win64.a
  82. LINK_FLAGS += $(JUCE_CORE_LIBS)
  83. LIBS_native += $(MODULEDIR)/juce_data_structures.a
  84. LIBS_posix32 += $(MODULEDIR)/juce_data_structures.posix32.a
  85. LIBS_posix64 += $(MODULEDIR)/juce_data_structures.posix64.a
  86. LIBS_win32 += $(MODULEDIR)/juce_data_structures.win32.a
  87. LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a
  88. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  89. LIBS_native += $(MODULEDIR)/juce_events.a
  90. LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a
  91. LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a
  92. LIBS_win32 += $(MODULEDIR)/juce_events.win32.a
  93. LIBS_win64 += $(MODULEDIR)/juce_events.win64.a
  94. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  95. LIBS_native += $(MODULEDIR)/juce_graphics.a
  96. LIBS_posix32 += $(MODULEDIR)/juce_graphics.posix32.a
  97. LIBS_posix64 += $(MODULEDIR)/juce_graphics.posix64.a
  98. LIBS_win32 += $(MODULEDIR)/juce_graphics.win32.a
  99. LIBS_win64 += $(MODULEDIR)/juce_graphics.win64.a
  100. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  101. LIBS_native += $(MODULEDIR)/juce_gui_basics.a
  102. LIBS_posix32 += $(MODULEDIR)/juce_gui_basics.posix32.a
  103. LIBS_posix64 += $(MODULEDIR)/juce_gui_basics.posix64.a
  104. LIBS_win32 += $(MODULEDIR)/juce_gui_basics.win32.a
  105. LIBS_win64 += $(MODULEDIR)/juce_gui_basics.win64.a
  106. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  107. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  108. LIBS_native += $(MODULEDIR)/juce_gui_extra.a
  109. LIBS_posix32 += $(MODULEDIR)/juce_gui_extra.posix32.a
  110. LIBS_posix64 += $(MODULEDIR)/juce_gui_extra.posix64.a
  111. LIBS_win32 += $(MODULEDIR)/juce_gui_extra.win32.a
  112. LIBS_win64 += $(MODULEDIR)/juce_gui_extra.win64.a
  113. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  114. endif # USING_JUCE_GUI_EXTRA
  115. endif # USING_JUCE
  116. LIBS_native += $(MODULEDIR)/jsusfx.a
  117. LIBS_native += $(MODULEDIR)/eel2.a
  118. # ---------------------------------------------------------------------------------------------------------------------
  119. OBJS_native = $(OBJDIR)/$(MODULENAME).cpp.o
  120. OBJS_arm32 = $(OBJDIR)/$(MODULENAME).cpp.arm32.o
  121. OBJS_posix32 = $(OBJDIR)/$(MODULENAME).cpp.posix32.o
  122. OBJS_posix64 = $(OBJDIR)/$(MODULENAME).cpp.posix64.o
  123. OBJS_win32 = $(OBJDIR)/$(MODULENAME).cpp.win32.o
  124. OBJS_win64 = $(OBJDIR)/$(MODULENAME).cpp.win64.o
  125. # ---------------------------------------------------------------------------------------------------------------------
  126. all: native
  127. # ---------------------------------------------------------------------------------------------------------------------
  128. clean:
  129. rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-*
  130. debug:
  131. $(MAKE) DEBUG=true
  132. # ---------------------------------------------------------------------------------------------------------------------
  133. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT)
  134. arm32: $(BINDIR)/$(MODULENAME)-arm32
  135. posix32: $(BINDIR)/$(MODULENAME)-posix32
  136. posix64: $(BINDIR)/$(MODULENAME)-posix64
  137. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  138. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  139. # ---------------------------------------------------------------------------------------------------------------------
  140. $(BINDIR)/$(MODULENAME)-native: $(OBJS_native) $(LIBS_native)
  141. -@mkdir -p $(BINDIR)
  142. @echo "Linking $(MODULENAME)-native"
  143. @$(CXX) $< $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  144. $(BINDIR)/$(MODULENAME)-native.exe: $(OBJS_native) $(LIBS_native)
  145. -@mkdir -p $(BINDIR)
  146. @echo "Linking $(MODULENAME)-native.exe"
  147. @$(CXX) $< $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  148. $(BINDIR)/$(MODULENAME)-arm32: $(OBJS_arm32) $(LIBS_arm32)
  149. -@mkdir -p $(BINDIR)
  150. @echo "Linking $(MODULENAME)-posix32"
  151. @$(CXX) $< $(LIBS_START) $(LIBS_arm32) $(LIBS_END) $(LINK_FLAGS) $(ARM32_FLAGS) -o $@
  152. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  153. -@mkdir -p $(BINDIR)
  154. @echo "Linking $(MODULENAME)-posix32"
  155. @$(CXX) $< $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  156. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  157. -@mkdir -p $(BINDIR)
  158. @echo "Linking $(MODULENAME)-posix64"
  159. @$(CXX) $< $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  160. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  161. -@mkdir -p $(BINDIR)
  162. @echo "Linking $(MODULENAME)-win32.exe"
  163. @$(CXX) $< $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  164. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  165. -@mkdir -p $(BINDIR)
  166. @echo "Linking $(MODULENAME)-win64.exe"
  167. @$(CXX) $< $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  168. # ---------------------------------------------------------------------------------------------------------------------
  169. $(OBJDIR)/$(MODULENAME).cpp.o: $(MODULENAME).cpp
  170. -@mkdir -p $(OBJDIR)
  171. @echo "Compiling $<"
  172. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  173. $(OBJDIR)/$(MODULENAME).cpp.%32.o: $(MODULENAME).cpp
  174. -@mkdir -p $(OBJDIR)
  175. @echo "Compiling $< (32bit)"
  176. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  177. $(OBJDIR)/$(MODULENAME).cpp.%64.o: $(MODULENAME).cpp
  178. -@mkdir -p $(OBJDIR)
  179. @echo "Compiling $< (64bit)"
  180. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  181. $(OBJDIR)/$(MODULENAME).cpp.arm32.o: $(MODULENAME).cpp
  182. -@mkdir -p $(OBJDIR)
  183. @echo "Compiling $< (ARM32)"
  184. @$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@
  185. # ---------------------------------------------------------------------------------------------------------------------
  186. -include $(OBJS_native:%.o=%.d)
  187. -include $(OBJS_arm32:%.o=%.d)
  188. -include $(OBJS_posix32:%.o=%.d)
  189. -include $(OBJS_posix64:%.o=%.d)
  190. -include $(OBJS_win32:%.o=%.d)
  191. -include $(OBJS_win64:%.o=%.d)
  192. # ---------------------------------------------------------------------------------------------------------------------