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.

221 lines
7.9KB

  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)/utils -isystem $(CWD)/modules
  25. BUILD_CXX_FLAGS += -I$(CWD)/includes/vst2 -I$(CWD)/includes/vst3
  26. ifeq ($(CARLA_VESTIGE_HEADER),true)
  27. BUILD_CXX_FLAGS += -DVESTIGE_HEADER
  28. endif
  29. ifeq ($(MACOS),true)
  30. BUILD_CXX_FLAGS += -ObjC++
  31. endif
  32. # vstsdk requires this
  33. ifeq ($(MACOS_OR_WIN32),true)
  34. BUILD_CXX_FLAGS += -Wno-zero-as-null-pointer-constant
  35. endif
  36. 32BIT_FLAGS += -DBUILD_BRIDGE
  37. 64BIT_FLAGS += -DBUILD_BRIDGE
  38. # ----------------------------------------------------------------------------------------------------------------------------
  39. NATIVE_BUILD_FLAGS =
  40. NATIVE_LINK_FLAGS =
  41. ifeq ($(HAVE_FLUIDSYNTH),true)
  42. NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
  43. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  44. endif
  45. ifeq ($(HAVE_LINUXSAMPLER),true)
  46. NATIVE_BUILD_FLAGS += $(LINUXSAMPLER_FLAGS)
  47. NATIVE_LINK_FLAGS += $(LINUXSAMPLER_LIBS)
  48. endif
  49. # ----------------------------------------------------------------------------------------------------------------------------
  50. LIBS_native = $(MODULEDIR)/juce_core.a
  51. LIBS_posix32 = $(MODULEDIR)/juce_core.posix32.a
  52. LIBS_posix64 = $(MODULEDIR)/juce_core.posix64.a
  53. LIBS_win32 = $(MODULEDIR)/juce_core.win32.a
  54. LIBS_win64 = $(MODULEDIR)/juce_core.win64.a
  55. LINK_FLAGS += $(JUCE_CORE_LIBS)
  56. LIBS_native += $(MODULEDIR)/lilv.a
  57. LIBS_posix32 += $(MODULEDIR)/lilv.posix32.a
  58. LIBS_posix64 += $(MODULEDIR)/lilv.posix64.a
  59. LIBS_win32 += $(MODULEDIR)/lilv.win32.a
  60. LIBS_win64 += $(MODULEDIR)/lilv.win64.a
  61. LINK_FLAGS += $(LILV_LIBS)
  62. ifeq ($(MACOS_OR_WIN32),true)
  63. LIBS_native += $(MODULEDIR)/juce_audio_basics.a
  64. LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a
  65. LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a
  66. LIBS_win32 += $(MODULEDIR)/juce_audio_basics.win32.a
  67. LIBS_win64 += $(MODULEDIR)/juce_audio_basics.win64.a
  68. LIBS_native += $(MODULEDIR)/juce_audio_processors.a
  69. LIBS_posix32 += $(MODULEDIR)/juce_audio_processors.posix32.a
  70. LIBS_posix64 += $(MODULEDIR)/juce_audio_processors.posix64.a
  71. LIBS_win32 += $(MODULEDIR)/juce_audio_processors.win32.a
  72. LIBS_win64 += $(MODULEDIR)/juce_audio_processors.win64.a
  73. LIBS_native += $(MODULEDIR)/juce_data_structures.a
  74. LIBS_posix32 += $(MODULEDIR)/juce_data_structures.posix32.a
  75. LIBS_posix64 += $(MODULEDIR)/juce_data_structures.posix64.a
  76. LIBS_win32 += $(MODULEDIR)/juce_data_structures.win32.a
  77. LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a
  78. LIBS_native += $(MODULEDIR)/juce_events.a
  79. LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a
  80. LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a
  81. LIBS_win32 += $(MODULEDIR)/juce_events.win32.a
  82. LIBS_win64 += $(MODULEDIR)/juce_events.win64.a
  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. LIBS_native += $(MODULEDIR)/juce_gui_basics.a
  89. LIBS_posix32 += $(MODULEDIR)/juce_gui_basics.posix32.a
  90. LIBS_posix64 += $(MODULEDIR)/juce_gui_basics.posix64.a
  91. LIBS_win32 += $(MODULEDIR)/juce_gui_basics.win32.a
  92. LIBS_win64 += $(MODULEDIR)/juce_gui_basics.win64.a
  93. ifeq ($(MACOS),true)
  94. LIBS_native += $(MODULEDIR)/juce_gui_extra.a
  95. LIBS_posix32 += $(MODULEDIR)/juce_gui_extra.posix32.a
  96. LIBS_posix64 += $(MODULEDIR)/juce_gui_extra.posix64.a
  97. endif
  98. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  99. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  100. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  101. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  102. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  103. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  104. ifeq ($(MACOS),true)
  105. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  106. endif
  107. endif
  108. ifeq ($(UNIX),true)
  109. LINK_FLAGS += -ldl
  110. endif
  111. # ----------------------------------------------------------------------------------------------------------------------------
  112. OBJS_native = $(OBJDIR)/$(MODULENAME).cpp.o
  113. OBJS_posix32 = $(OBJDIR)/$(MODULENAME).cpp.posix32.o
  114. OBJS_posix64 = $(OBJDIR)/$(MODULENAME).cpp.posix64.o
  115. OBJS_win32 = $(OBJDIR)/$(MODULENAME).cpp.win32.o
  116. OBJS_win64 = $(OBJDIR)/$(MODULENAME).cpp.win64.o
  117. # ----------------------------------------------------------------------------------------------------------------------------
  118. all: native
  119. # ----------------------------------------------------------------------------------------------------------------------------
  120. clean:
  121. rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-*
  122. debug:
  123. $(MAKE) DEBUG=true
  124. # ----------------------------------------------------------------------------------------------------------------------------
  125. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT)
  126. posix32: $(BINDIR)/$(MODULENAME)-posix32
  127. posix64: $(BINDIR)/$(MODULENAME)-posix64
  128. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  129. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  130. # ----------------------------------------------------------------------------------------------------------------------------
  131. $(BINDIR)/$(MODULENAME)-native: $(OBJS_native) $(LIBS_native)
  132. -@mkdir -p $(BINDIR)
  133. @echo "Linking $(MODULENAME)-native"
  134. @$(CXX) $< $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  135. $(BINDIR)/$(MODULENAME)-native.exe: $(OBJS_native) $(LIBS_native)
  136. -@mkdir -p $(BINDIR)
  137. @echo "Linking $(MODULENAME)-native.exe"
  138. @$(CXX) $< $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  139. @echo "Symlinking $(MODULENAME)-win$(winv).exe"
  140. @rm -f $(BINDIR)/$(MODULENAME)-win$(winv).exe
  141. @ln -s $(BINDIR)/$(MODULENAME)-native.exe $(BINDIR)/$(MODULENAME)-win$(winv).exe
  142. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  143. -@mkdir -p $(BINDIR)
  144. @echo "Linking $(MODULENAME)-posix32"
  145. @$(CXX) $< $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(32BIT_FLAGS) $(LINK_FLAGS) -o $@
  146. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  147. -@mkdir -p $(BINDIR)
  148. @echo "Linking $(MODULENAME)-posix64"
  149. @$(CXX) $< $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(64BIT_FLAGS) $(LINK_FLAGS) -o $@
  150. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  151. -@mkdir -p $(BINDIR)
  152. @echo "Linking $(MODULENAME)-win32.exe"
  153. @$(CXX) $< $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(32BIT_FLAGS) $(LINK_FLAGS) -o $@
  154. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  155. -@mkdir -p $(BINDIR)
  156. @echo "Linking $(MODULENAME)-win64.exe"
  157. @$(CXX) $< $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(64BIT_FLAGS) $(LINK_FLAGS) -o $@
  158. # ----------------------------------------------------------------------------------------------------------------------------
  159. $(OBJDIR)/$(MODULENAME).cpp.o: $(MODULENAME).cpp
  160. -@mkdir -p $(OBJDIR)
  161. @echo "Compiling $<"
  162. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  163. $(OBJDIR)/$(MODULENAME).cpp.%32.o: $(MODULENAME).cpp
  164. -@mkdir -p $(OBJDIR)
  165. @echo "Compiling $< (32bit)"
  166. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  167. $(OBJDIR)/$(MODULENAME).cpp.%64.o: $(MODULENAME).cpp
  168. -@mkdir -p $(OBJDIR)
  169. @echo "Compiling $< (64bit)"
  170. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  171. # ----------------------------------------------------------------------------------------------------------------------------
  172. -include $(OBJS_native:%.o=%.d)
  173. -include $(OBJS_posix32:%.o=%.d)
  174. -include $(OBJS_posix64:%.o=%.d)
  175. -include $(OBJS_win32:%.o=%.d)
  176. -include $(OBJS_win64:%.o=%.d)
  177. # ----------------------------------------------------------------------------------------------------------------------------