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.

240 lines
8.5KB

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