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.

Makefile 9.1KB

11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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 -lssp -mwindows
  31. endif
  32. ifeq ($(USING_JUCE),true)
  33. BUILD_CXX_FLAGS += -std=gnu++14
  34. endif
  35. ifeq ($(USING_JUCE),true)
  36. ifeq ($(WINDOWS),true)
  37. BUILD_CXX_FLAGS += -I$(CWD)/modules/mingw-std-threads
  38. endif
  39. endif
  40. 32BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  41. 64BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  42. ARM32_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  43. # ---------------------------------------------------------------------------------------------------------------------
  44. NATIVE_BUILD_FLAGS =
  45. NATIVE_LINK_FLAGS =
  46. ifeq ($(HAVE_FLUIDSYNTH),true)
  47. NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
  48. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  49. endif
  50. NATIVE_BUILD_FLAGS += $(YSFX_FLAGS)
  51. # ---------------------------------------------------------------------------------------------------------------------
  52. LIBS_native = $(MODULEDIR)/lilv.a
  53. LIBS_arm32 = $(MODULEDIR)/lilv.arm32.a
  54. LIBS_posix32 = $(MODULEDIR)/lilv.posix32.a
  55. LIBS_posix64 = $(MODULEDIR)/lilv.posix64.a
  56. LIBS_win32 = $(MODULEDIR)/lilv.win32.a
  57. LIBS_win64 = $(MODULEDIR)/lilv.win64.a
  58. LINK_FLAGS += $(LILV_LIBS)
  59. LIBS_native += $(MODULEDIR)/water.files.a
  60. LIBS_arm32 = $(MODULEDIR)/water.files.arm32.a
  61. LIBS_posix32 = $(MODULEDIR)/water.posix32.a
  62. LIBS_posix64 = $(MODULEDIR)/water.posix64.a
  63. LIBS_win32 = $(MODULEDIR)/water.win32.a
  64. LIBS_win64 = $(MODULEDIR)/water.win64.a
  65. LINK_FLAGS += $(WATER_LIBS)
  66. LINK_FLAGS += $(LIBDL_LIBS)
  67. ifeq ($(USING_JUCE),true)
  68. LIBS_native += $(MODULEDIR)/carla_juce.a
  69. LIBS_posix32 += $(MODULEDIR)/carla_juce.posix32.a
  70. LIBS_posix64 += $(MODULEDIR)/carla_juce.posix64.a
  71. LIBS_win32 += $(MODULEDIR)/carla_juce.win32.a
  72. LIBS_win64 += $(MODULEDIR)/carla_juce.win64.a
  73. LIBS_native += $(MODULEDIR)/juce_audio_basics.a
  74. LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a
  75. LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a
  76. LIBS_win32 += $(MODULEDIR)/juce_audio_basics.win32.a
  77. LIBS_win64 += $(MODULEDIR)/juce_audio_basics.win64.a
  78. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  79. LIBS_native += $(MODULEDIR)/juce_audio_processors.a
  80. LIBS_posix32 += $(MODULEDIR)/juce_audio_processors.posix32.a
  81. LIBS_posix64 += $(MODULEDIR)/juce_audio_processors.posix64.a
  82. LIBS_win32 += $(MODULEDIR)/juce_audio_processors.win32.a
  83. LIBS_win64 += $(MODULEDIR)/juce_audio_processors.win64.a
  84. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  85. LIBS_native += $(MODULEDIR)/juce_core.a
  86. LIBS_posix32 += $(MODULEDIR)/juce_core.posix32.a
  87. LIBS_posix64 += $(MODULEDIR)/juce_core.posix64.a
  88. LIBS_win32 += $(MODULEDIR)/juce_core.win32.a
  89. LIBS_win64 += $(MODULEDIR)/juce_core.win64.a
  90. LINK_FLAGS += $(JUCE_CORE_LIBS)
  91. LIBS_native += $(MODULEDIR)/juce_data_structures.a
  92. LIBS_posix32 += $(MODULEDIR)/juce_data_structures.posix32.a
  93. LIBS_posix64 += $(MODULEDIR)/juce_data_structures.posix64.a
  94. LIBS_win32 += $(MODULEDIR)/juce_data_structures.win32.a
  95. LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a
  96. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  97. LIBS_native += $(MODULEDIR)/juce_events.a
  98. LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a
  99. LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a
  100. LIBS_win32 += $(MODULEDIR)/juce_events.win32.a
  101. LIBS_win64 += $(MODULEDIR)/juce_events.win64.a
  102. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  103. LIBS_native += $(MODULEDIR)/juce_graphics.a
  104. LIBS_posix32 += $(MODULEDIR)/juce_graphics.posix32.a
  105. LIBS_posix64 += $(MODULEDIR)/juce_graphics.posix64.a
  106. LIBS_win32 += $(MODULEDIR)/juce_graphics.win32.a
  107. LIBS_win64 += $(MODULEDIR)/juce_graphics.win64.a
  108. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  109. LIBS_native += $(MODULEDIR)/juce_gui_basics.a
  110. LIBS_posix32 += $(MODULEDIR)/juce_gui_basics.posix32.a
  111. LIBS_posix64 += $(MODULEDIR)/juce_gui_basics.posix64.a
  112. LIBS_win32 += $(MODULEDIR)/juce_gui_basics.win32.a
  113. LIBS_win64 += $(MODULEDIR)/juce_gui_basics.win64.a
  114. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  115. LIBS_native += $(MODULEDIR)/juce_gui_extra.a
  116. LIBS_posix32 += $(MODULEDIR)/juce_gui_extra.posix32.a
  117. LIBS_posix64 += $(MODULEDIR)/juce_gui_extra.posix64.a
  118. LIBS_win32 += $(MODULEDIR)/juce_gui_extra.win32.a
  119. LIBS_win64 += $(MODULEDIR)/juce_gui_extra.win64.a
  120. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  121. endif # USING_JUCE
  122. LIBS_native += $(MODULEDIR)/ysfx.a
  123. LINK_FLAGS += $(YSFX_GRAPHICS_LIBS)
  124. # ---------------------------------------------------------------------------------------------------------------------
  125. OBJS_native = $(OBJDIR)/$(MODULENAME).cpp.o
  126. OBJS_arm32 = $(OBJDIR)/$(MODULENAME).cpp.arm32.o
  127. OBJS_posix32 = $(OBJDIR)/$(MODULENAME).cpp.posix32.o
  128. OBJS_posix64 = $(OBJDIR)/$(MODULENAME).cpp.posix64.o
  129. OBJS_win32 = $(OBJDIR)/$(MODULENAME).cpp.win32.o
  130. OBJS_win64 = $(OBJDIR)/$(MODULENAME).cpp.win64.o
  131. # ---------------------------------------------------------------------------------------------------------------------
  132. all: native
  133. # ---------------------------------------------------------------------------------------------------------------------
  134. clean:
  135. rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-*
  136. debug:
  137. $(MAKE) DEBUG=true
  138. # ---------------------------------------------------------------------------------------------------------------------
  139. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT)
  140. arm32: $(BINDIR)/$(MODULENAME)-arm32
  141. posix32: $(BINDIR)/$(MODULENAME)-posix32
  142. posix64: $(BINDIR)/$(MODULENAME)-posix64
  143. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  144. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  145. # ---------------------------------------------------------------------------------------------------------------------
  146. $(BINDIR)/$(MODULENAME)-native: $(OBJS_native) $(LIBS_native)
  147. -@mkdir -p $(BINDIR)
  148. @echo "Linking $(MODULENAME)-native"
  149. $(SILENT)$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  150. $(BINDIR)/$(MODULENAME)-native.exe: $(OBJS_native) $(LIBS_native)
  151. -@mkdir -p $(BINDIR)
  152. @echo "Linking $(MODULENAME)-native.exe"
  153. $(SILENT)$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  154. $(BINDIR)/$(MODULENAME)-arm32: $(OBJS_arm32) $(LIBS_arm32)
  155. -@mkdir -p $(BINDIR)
  156. @echo "Linking $(MODULENAME)-posix32"
  157. $(SILENT)$(CXX) $(OBJS_arm32) $(LIBS_START) $(LIBS_arm32) $(LIBS_END) $(LINK_FLAGS) $(ARM32_FLAGS) -o $@
  158. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  159. -@mkdir -p $(BINDIR)
  160. @echo "Linking $(MODULENAME)-posix32"
  161. $(SILENT)$(CXX) $(OBJS_posix32) $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  162. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  163. -@mkdir -p $(BINDIR)
  164. @echo "Linking $(MODULENAME)-posix64"
  165. $(SILENT)$(CXX) $(OBJS_posix64) $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  166. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  167. -@mkdir -p $(BINDIR)
  168. @echo "Linking $(MODULENAME)-win32.exe"
  169. $(SILENT)$(CXX) $(OBJS_win32) $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  170. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  171. -@mkdir -p $(BINDIR)
  172. @echo "Linking $(MODULENAME)-win64.exe"
  173. $(SILENT)$(CXX) $(OBJS_win64) $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  174. # ---------------------------------------------------------------------------------------------------------------------
  175. $(OBJDIR)/$(MODULENAME).cpp.o: $(MODULENAME).cpp
  176. -@mkdir -p $(OBJDIR)
  177. @echo "Compiling $<"
  178. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  179. $(OBJDIR)/$(MODULENAME).cpp.%32.o: $(MODULENAME).cpp
  180. -@mkdir -p $(OBJDIR)
  181. @echo "Compiling $< (32bit)"
  182. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  183. $(OBJDIR)/$(MODULENAME).cpp.%64.o: $(MODULENAME).cpp
  184. -@mkdir -p $(OBJDIR)
  185. @echo "Compiling $< (64bit)"
  186. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  187. $(OBJDIR)/$(MODULENAME).cpp.arm32.o: $(MODULENAME).cpp
  188. -@mkdir -p $(OBJDIR)
  189. @echo "Compiling $< (ARM32)"
  190. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@
  191. # ---------------------------------------------------------------------------------------------------------------------
  192. -include $(OBJS_native:%.o=%.d)
  193. -include $(OBJS_arm32:%.o=%.d)
  194. -include $(OBJS_posix32:%.o=%.d)
  195. -include $(OBJS_posix64:%.o=%.d)
  196. -include $(OBJS_win32:%.o=%.d)
  197. -include $(OBJS_win64:%.o=%.d)
  198. # ---------------------------------------------------------------------------------------------------------------------