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.

230 lines
8.2KB

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