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.

183 lines
6.3KB

  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. # ---------------------------------------------------------------------------------------------------------------------
  10. BINDIR := $(CWD)/../bin
  11. ifeq ($(DEBUG),true)
  12. OBJDIR := $(CWD)/../build/discovery/Debug
  13. MODULEDIR := $(CWD)/../build/modules/Debug
  14. else
  15. OBJDIR := $(CWD)/../build/discovery/Release
  16. MODULEDIR := $(CWD)/../build/modules/Release
  17. endif
  18. # ---------------------------------------------------------------------------------------------------------------------
  19. BUILD_CXX_FLAGS += -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
  20. ifeq ($(MACOS),true)
  21. BUILD_CXX_FLAGS += -ObjC++
  22. endif
  23. ifeq ($(WINDOWS),true)
  24. LINK_FLAGS += -lole32 -lws2_32 -mwindows
  25. endif
  26. ifeq ($(HAIKU),true)
  27. LINK_FLAGS += -lpthread
  28. else
  29. BUILD_CXX_FLAGS += -pthread
  30. LINK_FLAGS += -pthread
  31. endif
  32. 32BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  33. 64BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  34. ARM32_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  35. # ---------------------------------------------------------------------------------------------------------------------
  36. NATIVE_BUILD_FLAGS =
  37. NATIVE_LINK_FLAGS =
  38. ifeq ($(HAVE_FLUIDSYNTH),true)
  39. NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
  40. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  41. endif
  42. ifeq ($(HAVE_YSFX),true)
  43. NATIVE_BUILD_FLAGS += $(YSFX_FLAGS)
  44. endif
  45. # ---------------------------------------------------------------------------------------------------------------------
  46. LIBS_native = $(MODULEDIR)/lilv.a
  47. LIBS_arm32 = $(MODULEDIR)/lilv.arm32.a
  48. LIBS_posix32 = $(MODULEDIR)/lilv.posix32.a
  49. LIBS_posix64 = $(MODULEDIR)/lilv.posix64.a
  50. LIBS_win32 = $(MODULEDIR)/lilv.win32.a
  51. LIBS_win64 = $(MODULEDIR)/lilv.win64.a
  52. LINK_FLAGS += $(LILV_LIBS)
  53. LIBS_native += $(MODULEDIR)/water.files.a
  54. LIBS_arm32 += $(MODULEDIR)/water.files.arm32.a
  55. LIBS_posix32 += $(MODULEDIR)/water.posix32.a
  56. LIBS_posix64 += $(MODULEDIR)/water.posix64.a
  57. LIBS_win32 += $(MODULEDIR)/water.win32.a
  58. LIBS_win64 += $(MODULEDIR)/water.win64.a
  59. LINK_FLAGS += $(WATER_LIBS)
  60. LINK_FLAGS += $(LIBDL_LIBS)
  61. ifeq ($(HAVE_YSFX),true)
  62. LIBS_native += $(MODULEDIR)/ysfx.a
  63. LINK_FLAGS += $(YSFX_GRAPHICS_LIBS)
  64. endif
  65. ifeq ($(BUILDING_FOR_WINE),true)
  66. LIBS_win32 += $(MODULEDIR)/jackbridge.win32e.a
  67. LIBS_win64 += $(MODULEDIR)/jackbridge.win64e.a
  68. endif
  69. # ---------------------------------------------------------------------------------------------------------------------
  70. OBJS_native = $(OBJDIR)/$(MODULENAME).cpp.o
  71. OBJS_arm32 = $(OBJDIR)/$(MODULENAME).cpp.arm32.o
  72. OBJS_posix32 = $(OBJDIR)/$(MODULENAME).cpp.posix32.o
  73. OBJS_posix64 = $(OBJDIR)/$(MODULENAME).cpp.posix64.o
  74. OBJS_win32 = $(OBJDIR)/$(MODULENAME).cpp.win32.o
  75. OBJS_win64 = $(OBJDIR)/$(MODULENAME).cpp.win64.o
  76. # ---------------------------------------------------------------------------------------------------------------------
  77. all: native
  78. # ---------------------------------------------------------------------------------------------------------------------
  79. clean:
  80. rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-*
  81. debug:
  82. $(MAKE) DEBUG=true
  83. # ---------------------------------------------------------------------------------------------------------------------
  84. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT)
  85. arm32: $(BINDIR)/$(MODULENAME)-arm32
  86. posix32: $(BINDIR)/$(MODULENAME)-posix32
  87. posix64: $(BINDIR)/$(MODULENAME)-posix64
  88. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  89. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  90. # ---------------------------------------------------------------------------------------------------------------------
  91. $(BINDIR)/$(MODULENAME)-native$(APP_EXT): $(OBJS_native) $(LIBS_native)
  92. -@mkdir -p $(BINDIR)
  93. @echo "Linking $(MODULENAME)-native$(APP_EXT)"
  94. $(SILENT)$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  95. $(BINDIR)/$(MODULENAME)-arm32: $(OBJS_arm32) $(LIBS_arm32)
  96. -@mkdir -p $(BINDIR)
  97. @echo "Linking $(MODULENAME)-posix32"
  98. $(SILENT)$(CXX) $(OBJS_arm32) $(LIBS_START) $(LIBS_arm32) $(LIBS_END) $(LINK_FLAGS) $(ARM32_FLAGS) -o $@
  99. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  100. -@mkdir -p $(BINDIR)
  101. @echo "Linking $(MODULENAME)-posix32"
  102. $(SILENT)$(CXX) $(OBJS_posix32) $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  103. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  104. -@mkdir -p $(BINDIR)
  105. @echo "Linking $(MODULENAME)-posix64"
  106. $(SILENT)$(CXX) $(OBJS_posix64) $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  107. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  108. -@mkdir -p $(BINDIR)
  109. @echo "Linking $(MODULENAME)-win32.exe"
  110. $(SILENT)$(CXX) $(OBJS_win32) $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  111. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  112. -@mkdir -p $(BINDIR)
  113. @echo "Linking $(MODULENAME)-win64.exe"
  114. $(SILENT)$(CXX) $(OBJS_win64) $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  115. # ---------------------------------------------------------------------------------------------------------------------
  116. $(OBJDIR)/$(MODULENAME).cpp.o: $(MODULENAME).cpp
  117. -@mkdir -p $(OBJDIR)
  118. @echo "Compiling $<"
  119. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  120. $(OBJDIR)/$(MODULENAME).cpp.%32.o: $(MODULENAME).cpp
  121. -@mkdir -p $(OBJDIR)
  122. @echo "Compiling $< (32bit)"
  123. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  124. $(OBJDIR)/$(MODULENAME).cpp.%64.o: $(MODULENAME).cpp
  125. -@mkdir -p $(OBJDIR)
  126. @echo "Compiling $< (64bit)"
  127. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  128. $(OBJDIR)/$(MODULENAME).cpp.arm32.o: $(MODULENAME).cpp
  129. -@mkdir -p $(OBJDIR)
  130. @echo "Compiling $< (ARM32)"
  131. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@
  132. # ---------------------------------------------------------------------------------------------------------------------
  133. -include $(OBJS_native:%.o=%.d)
  134. -include $(OBJS_arm32:%.o=%.d)
  135. -include $(OBJS_posix32:%.o=%.d)
  136. -include $(OBJS_posix64:%.o=%.d)
  137. -include $(OBJS_win32:%.o=%.d)
  138. -include $(OBJS_win64:%.o=%.d)
  139. # ---------------------------------------------------------------------------------------------------------------------