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

11 years ago
10 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. # 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. LINK_FLAGS += $(WATER_LIBS)
  57. LINK_FLAGS += $(LIBDL_LIBS)
  58. ifeq ($(USING_JUCE),true)
  59. LIBS_native += $(MODULEDIR)/juce_audio_basics.a
  60. LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a
  61. LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a
  62. LIBS_win32 += $(MODULEDIR)/juce_audio_basics.win32.a
  63. LIBS_win64 += $(MODULEDIR)/juce_audio_basics.win64.a
  64. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  65. LIBS_native += $(MODULEDIR)/juce_audio_processors.a
  66. LIBS_posix32 += $(MODULEDIR)/juce_audio_processors.posix32.a
  67. LIBS_posix64 += $(MODULEDIR)/juce_audio_processors.posix64.a
  68. LIBS_win32 += $(MODULEDIR)/juce_audio_processors.win32.a
  69. LIBS_win64 += $(MODULEDIR)/juce_audio_processors.win64.a
  70. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  71. LIBS_native += $(MODULEDIR)/juce_core.a
  72. LIBS_posix32 += $(MODULEDIR)/juce_core.posix32.a
  73. LIBS_posix64 += $(MODULEDIR)/juce_core.posix64.a
  74. LIBS_win32 += $(MODULEDIR)/juce_core.win32.a
  75. LIBS_win64 += $(MODULEDIR)/juce_core.win64.a
  76. LINK_FLAGS += $(JUCE_CORE_LIBS)
  77. LIBS_native += $(MODULEDIR)/juce_data_structures.a
  78. LIBS_posix32 += $(MODULEDIR)/juce_data_structures.posix32.a
  79. LIBS_posix64 += $(MODULEDIR)/juce_data_structures.posix64.a
  80. LIBS_win32 += $(MODULEDIR)/juce_data_structures.win32.a
  81. LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a
  82. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  83. LIBS_native += $(MODULEDIR)/juce_events.a
  84. LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a
  85. LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a
  86. LIBS_win32 += $(MODULEDIR)/juce_events.win32.a
  87. LIBS_win64 += $(MODULEDIR)/juce_events.win64.a
  88. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  89. LIBS_native += $(MODULEDIR)/juce_graphics.a
  90. LIBS_posix32 += $(MODULEDIR)/juce_graphics.posix32.a
  91. LIBS_posix64 += $(MODULEDIR)/juce_graphics.posix64.a
  92. LIBS_win32 += $(MODULEDIR)/juce_graphics.win32.a
  93. LIBS_win64 += $(MODULEDIR)/juce_graphics.win64.a
  94. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  95. LIBS_native += $(MODULEDIR)/juce_gui_basics.a
  96. LIBS_posix32 += $(MODULEDIR)/juce_gui_basics.posix32.a
  97. LIBS_posix64 += $(MODULEDIR)/juce_gui_basics.posix64.a
  98. LIBS_win32 += $(MODULEDIR)/juce_gui_basics.win32.a
  99. LIBS_win64 += $(MODULEDIR)/juce_gui_basics.win64.a
  100. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  101. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  102. LIBS_native += $(MODULEDIR)/juce_gui_extra.a
  103. LIBS_posix32 += $(MODULEDIR)/juce_gui_extra.posix32.a
  104. LIBS_posix64 += $(MODULEDIR)/juce_gui_extra.posix64.a
  105. LIBS_win32 += $(MODULEDIR)/juce_gui_extra.win32.a
  106. LIBS_win64 += $(MODULEDIR)/juce_gui_extra.win64.a
  107. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  108. endif # USING_JUCE_GUI_EXTRA
  109. endif # USING_JUCE
  110. # ---------------------------------------------------------------------------------------------------------------------
  111. OBJS_native = $(OBJDIR)/$(MODULENAME).cpp.o
  112. OBJS_arm32 = $(OBJDIR)/$(MODULENAME).cpp.arm32.o
  113. OBJS_posix32 = $(OBJDIR)/$(MODULENAME).cpp.posix32.o
  114. OBJS_posix64 = $(OBJDIR)/$(MODULENAME).cpp.posix64.o
  115. OBJS_win32 = $(OBJDIR)/$(MODULENAME).cpp.win32.o
  116. OBJS_win64 = $(OBJDIR)/$(MODULENAME).cpp.win64.o
  117. # ---------------------------------------------------------------------------------------------------------------------
  118. all: native
  119. # ---------------------------------------------------------------------------------------------------------------------
  120. clean:
  121. rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-*
  122. debug:
  123. $(MAKE) DEBUG=true
  124. # ---------------------------------------------------------------------------------------------------------------------
  125. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT)
  126. arm32: $(BINDIR)/$(MODULENAME)-arm32
  127. posix32: $(BINDIR)/$(MODULENAME)-posix32
  128. posix64: $(BINDIR)/$(MODULENAME)-posix64
  129. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  130. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  131. # ---------------------------------------------------------------------------------------------------------------------
  132. $(BINDIR)/$(MODULENAME)-native: $(OBJS_native) $(LIBS_native)
  133. -@mkdir -p $(BINDIR)
  134. @echo "Linking $(MODULENAME)-native"
  135. @$(CXX) $< $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  136. $(BINDIR)/$(MODULENAME)-native.exe: $(OBJS_native) $(LIBS_native)
  137. -@mkdir -p $(BINDIR)
  138. @echo "Linking $(MODULENAME)-native.exe"
  139. @$(CXX) $< $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  140. @echo "Symlinking $(MODULENAME)-win$(winv).exe"
  141. @rm -f $(BINDIR)/$(MODULENAME)-win$(winv).exe
  142. @ln -s $(MODULENAME)-native.exe $(BINDIR)/$(MODULENAME)-win$(winv).exe
  143. $(BINDIR)/$(MODULENAME)-arm32: $(OBJS_arm32) $(LIBS_arm32)
  144. -@mkdir -p $(BINDIR)
  145. @echo "Linking $(MODULENAME)-posix32"
  146. @$(CXX) $< $(LIBS_START) $(LIBS_arm32) $(LIBS_END) $(LINK_FLAGS) $(ARM32_FLAGS) -o $@
  147. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  148. -@mkdir -p $(BINDIR)
  149. @echo "Linking $(MODULENAME)-posix32"
  150. @$(CXX) $< $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  151. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  152. -@mkdir -p $(BINDIR)
  153. @echo "Linking $(MODULENAME)-posix64"
  154. @$(CXX) $< $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  155. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  156. -@mkdir -p $(BINDIR)
  157. @echo "Linking $(MODULENAME)-win32.exe"
  158. @$(CXX) $< $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  159. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  160. -@mkdir -p $(BINDIR)
  161. @echo "Linking $(MODULENAME)-win64.exe"
  162. @$(CXX) $< $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  163. # ---------------------------------------------------------------------------------------------------------------------
  164. $(OBJDIR)/$(MODULENAME).cpp.o: $(MODULENAME).cpp
  165. -@mkdir -p $(OBJDIR)
  166. @echo "Compiling $<"
  167. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  168. $(OBJDIR)/$(MODULENAME).cpp.%32.o: $(MODULENAME).cpp
  169. -@mkdir -p $(OBJDIR)
  170. @echo "Compiling $< (32bit)"
  171. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  172. $(OBJDIR)/$(MODULENAME).cpp.%64.o: $(MODULENAME).cpp
  173. -@mkdir -p $(OBJDIR)
  174. @echo "Compiling $< (64bit)"
  175. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  176. $(OBJDIR)/$(MODULENAME).cpp.arm32.o: $(MODULENAME).cpp
  177. -@mkdir -p $(OBJDIR)
  178. @echo "Compiling $< (ARM32)"
  179. @$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@
  180. # ---------------------------------------------------------------------------------------------------------------------
  181. -include $(OBJS_native:%.o=%.d)
  182. -include $(OBJS_arm32:%.o=%.d)
  183. -include $(OBJS_posix32:%.o=%.d)
  184. -include $(OBJS_posix64:%.o=%.d)
  185. -include $(OBJS_win32:%.o=%.d)
  186. -include $(OBJS_win64:%.o=%.d)
  187. # ---------------------------------------------------------------------------------------------------------------------