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.2KB

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