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.

210 lines
7.1KB

  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. # Workaround GCC bug
  10. ifeq ($(TESTBUILD),true)
  11. ifeq ($(USING_JUCE),true)
  12. BUILD_CXX_FLAGS += -Wno-undef
  13. endif
  14. endif
  15. # ---------------------------------------------------------------------------------------------------------------------
  16. BINDIR := $(CWD)/../bin
  17. ifeq ($(DEBUG),true)
  18. OBJDIR := $(CWD)/../build/discovery/Debug
  19. MODULEDIR := $(CWD)/../build/modules/Debug
  20. else
  21. OBJDIR := $(CWD)/../build/discovery/Release
  22. MODULEDIR := $(CWD)/../build/modules/Release
  23. endif
  24. # ---------------------------------------------------------------------------------------------------------------------
  25. BUILD_CXX_FLAGS += -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
  26. ifeq ($(MACOS),true)
  27. BUILD_CXX_FLAGS += -ObjC++
  28. endif
  29. ifeq ($(WINDOWS),true)
  30. LINK_FLAGS += -lole32 -lws2_32 -mwindows
  31. endif
  32. ifeq ($(HAIKU),true)
  33. LINK_FLAGS += -lpthread
  34. else
  35. BUILD_CXX_FLAGS += -pthread
  36. LINK_FLAGS += -pthread
  37. endif
  38. ifeq ($(USING_JUCE),true)
  39. BUILD_CXX_FLAGS += -std=gnu++14
  40. endif
  41. 32BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  42. 64BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  43. ARM32_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  44. # ---------------------------------------------------------------------------------------------------------------------
  45. NATIVE_BUILD_FLAGS =
  46. NATIVE_LINK_FLAGS =
  47. ifeq ($(HAVE_FLUIDSYNTH),true)
  48. NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
  49. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  50. endif
  51. ifeq ($(HAVE_YSFX),true)
  52. NATIVE_BUILD_FLAGS += $(YSFX_FLAGS)
  53. endif
  54. # ---------------------------------------------------------------------------------------------------------------------
  55. LIBS_native = $(MODULEDIR)/lilv.a
  56. LIBS_arm32 = $(MODULEDIR)/lilv.arm32.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. LIBS_native += $(MODULEDIR)/water.files.a
  63. LIBS_arm32 = $(MODULEDIR)/water.files.arm32.a
  64. LIBS_posix32 = $(MODULEDIR)/water.posix32.a
  65. LIBS_posix64 = $(MODULEDIR)/water.posix64.a
  66. LIBS_win32 = $(MODULEDIR)/water.win32.a
  67. LIBS_win64 = $(MODULEDIR)/water.win64.a
  68. LINK_FLAGS += $(WATER_LIBS)
  69. LINK_FLAGS += $(LIBDL_LIBS)
  70. ifeq ($(HAVE_YSFX),true)
  71. LIBS_native += $(MODULEDIR)/ysfx.a
  72. LINK_FLAGS += $(YSFX_GRAPHICS_LIBS)
  73. endif
  74. ifeq ($(USING_JUCE),true)
  75. LIBS_native += $(MODULEDIR)/carla_juce.a
  76. LIBS_native += $(MODULEDIR)/juce_audio_basics.a
  77. LIBS_native += $(MODULEDIR)/juce_audio_processors.a
  78. LIBS_native += $(MODULEDIR)/juce_core.a
  79. LIBS_native += $(MODULEDIR)/juce_data_structures.a
  80. LIBS_native += $(MODULEDIR)/juce_events.a
  81. LIBS_native += $(MODULEDIR)/juce_graphics.a
  82. LIBS_native += $(MODULEDIR)/juce_gui_basics.a
  83. LIBS_native += $(MODULEDIR)/juce_gui_extra.a
  84. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  85. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  86. LINK_FLAGS += $(JUCE_CORE_LIBS)
  87. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  88. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  89. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  90. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  91. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  92. endif # USING_JUCE
  93. # ---------------------------------------------------------------------------------------------------------------------
  94. OBJS_native = $(OBJDIR)/$(MODULENAME).cpp.o
  95. OBJS_arm32 = $(OBJDIR)/$(MODULENAME).cpp.arm32.o
  96. OBJS_posix32 = $(OBJDIR)/$(MODULENAME).cpp.posix32.o
  97. OBJS_posix64 = $(OBJDIR)/$(MODULENAME).cpp.posix64.o
  98. OBJS_win32 = $(OBJDIR)/$(MODULENAME).cpp.win32.o
  99. OBJS_win64 = $(OBJDIR)/$(MODULENAME).cpp.win64.o
  100. # ---------------------------------------------------------------------------------------------------------------------
  101. all: native
  102. # ---------------------------------------------------------------------------------------------------------------------
  103. clean:
  104. rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-*
  105. debug:
  106. $(MAKE) DEBUG=true
  107. # ---------------------------------------------------------------------------------------------------------------------
  108. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT)
  109. arm32: $(BINDIR)/$(MODULENAME)-arm32
  110. posix32: $(BINDIR)/$(MODULENAME)-posix32
  111. posix64: $(BINDIR)/$(MODULENAME)-posix64
  112. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  113. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  114. # ---------------------------------------------------------------------------------------------------------------------
  115. $(BINDIR)/$(MODULENAME)-native$(APP_EXT): $(OBJS_native) $(LIBS_native)
  116. -@mkdir -p $(BINDIR)
  117. @echo "Linking $(MODULENAME)-native$(APP_EXT)"
  118. $(SILENT)$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  119. $(BINDIR)/$(MODULENAME)-arm32: $(OBJS_arm32) $(LIBS_arm32)
  120. -@mkdir -p $(BINDIR)
  121. @echo "Linking $(MODULENAME)-posix32"
  122. $(SILENT)$(CXX) $(OBJS_arm32) $(LIBS_START) $(LIBS_arm32) $(LIBS_END) $(LINK_FLAGS) $(ARM32_FLAGS) -o $@
  123. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  124. -@mkdir -p $(BINDIR)
  125. @echo "Linking $(MODULENAME)-posix32"
  126. $(SILENT)$(CXX) $(OBJS_posix32) $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  127. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  128. -@mkdir -p $(BINDIR)
  129. @echo "Linking $(MODULENAME)-posix64"
  130. $(SILENT)$(CXX) $(OBJS_posix64) $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  131. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  132. -@mkdir -p $(BINDIR)
  133. @echo "Linking $(MODULENAME)-win32.exe"
  134. $(SILENT)$(CXX) $(OBJS_win32) $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  135. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  136. -@mkdir -p $(BINDIR)
  137. @echo "Linking $(MODULENAME)-win64.exe"
  138. $(SILENT)$(CXX) $(OBJS_win64) $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  139. # ---------------------------------------------------------------------------------------------------------------------
  140. $(OBJDIR)/$(MODULENAME).cpp.o: $(MODULENAME).cpp
  141. -@mkdir -p $(OBJDIR)
  142. @echo "Compiling $<"
  143. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  144. $(OBJDIR)/$(MODULENAME).cpp.%32.o: $(MODULENAME).cpp
  145. -@mkdir -p $(OBJDIR)
  146. @echo "Compiling $< (32bit)"
  147. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  148. $(OBJDIR)/$(MODULENAME).cpp.%64.o: $(MODULENAME).cpp
  149. -@mkdir -p $(OBJDIR)
  150. @echo "Compiling $< (64bit)"
  151. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  152. $(OBJDIR)/$(MODULENAME).cpp.arm32.o: $(MODULENAME).cpp
  153. -@mkdir -p $(OBJDIR)
  154. @echo "Compiling $< (ARM32)"
  155. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@
  156. # ---------------------------------------------------------------------------------------------------------------------
  157. -include $(OBJS_native:%.o=%.d)
  158. -include $(OBJS_arm32:%.o=%.d)
  159. -include $(OBJS_posix32:%.o=%.d)
  160. -include $(OBJS_posix64:%.o=%.d)
  161. -include $(OBJS_win32:%.o=%.d)
  162. -include $(OBJS_win64:%.o=%.d)
  163. # ---------------------------------------------------------------------------------------------------------------------