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 8.7KB

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