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.

215 lines
7.7KB

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