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.

216 lines
7.8KB

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