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.

191 lines
4.9KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla plugin exports #
  3. # --------------------------------- #
  4. # Created by falkTX
  5. #
  6. include ../Makefile.mk
  7. BUILD_CXX_FLAGS += -I../backend -I../includes -I../utils -isystem ../modules
  8. # --------------------------------------------------------------
  9. ifeq ($(HAVE_AF_DEPS),true)
  10. BUILD_CXX_FLAGS += -DWANT_AUDIOFILE
  11. endif
  12. ifeq ($(HAVE_MF_DEPS),true)
  13. BUILD_CXX_FLAGS += -DWANT_MIDIFILE
  14. endif
  15. ifeq ($(HAVE_ZYN_DEPS),true)
  16. BUILD_CXX_FLAGS += -DWANT_ZYNADDSUBFX
  17. endif
  18. # --------------------------------------------------------------
  19. # Common
  20. LINK_FLAGS += $(LIBLO_LIBS)
  21. LINK_FLAGS += $(QTCORE_LIBS)
  22. LINK_FLAGS += $(QTXML_LIBS)
  23. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  24. # --------------------------------------------------------------
  25. # Engine
  26. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  27. # --------------------------------------------------------------
  28. # Plugin
  29. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  30. LINK_FLAGS += $(LILV_LIBS)
  31. endif
  32. ifeq ($(HAVE_FLUIDSYNTH),true)
  33. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  34. endif
  35. # ifeq ($(HAVE_LINUXSAMPLER),true)
  36. # LINK_FLAGS += $(shell pkg-config --libs linuxsampler)
  37. # ifeq ($(WIN32),true)
  38. # LINK_FLAGS += lrpcrt4
  39. # endif
  40. # endif
  41. # --------------------------------------------------------------
  42. # Coomon
  43. ifeq ($(HAVE_JUCE),true)
  44. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  45. LINK_FLAGS += $(JUCE_CORE_LIBS)
  46. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  47. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  48. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  49. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  50. endif
  51. ifeq ($(HAVE_OPENGL),true)
  52. LINK_FLAGS += $(DGL_LIBS)
  53. endif
  54. # --------------------------------------------------------------
  55. # Native
  56. ifeq ($(HAVE_AF_DEPS),true)
  57. LINK_FLAGS += $(shell pkg-config --libs sndfile)
  58. ifeq ($(HAVE_FFMPEG),true)
  59. LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat libavutil)
  60. endif
  61. endif
  62. ifeq ($(HAVE_MF_DEPS),true)
  63. LINK_FLAGS += $(shell pkg-config --libs smf)
  64. endif
  65. ifeq ($(HAVE_ZYN_DEPS),true)
  66. LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib)
  67. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  68. LINK_FLAGS += $(shell pkg-config --libs ntk_images ntk)
  69. endif
  70. endif
  71. # --------------------------------------------------------------
  72. # Libs
  73. LIBS += ../backend/carla_engine_plugin.a
  74. LIBS += ../backend/carla_plugin.a
  75. LIBS += ../modules/carla_native.a
  76. LIBS += ../modules/jackbridge.a
  77. LIBS += ../modules/rtmempool.a
  78. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  79. LIBS += ../modules/lilv.a
  80. endif
  81. ifeq ($(HAVE_JUCE),true)
  82. LIBS += ../modules/juce_audio_basics.a
  83. # LIBS += ../modules/juce_audio_devices.a
  84. LIBS += ../modules/juce_core.a
  85. LIBS += ../modules/juce_data_structures.a
  86. LIBS += ../modules/juce_events.a
  87. LIBS += ../modules/juce_graphics.a
  88. LIBS += ../modules/juce_gui_basics.a
  89. endif
  90. ifeq ($(HAVE_OPENGL),true)
  91. LIBS += ../modules/dgl.a
  92. endif
  93. # --------------------------------------------------------------
  94. ifeq ($(WIN32),true)
  95. TARGETS = carla-native-lv2-export.exe carla-native.lv2/carla-native.dll
  96. else
  97. ifeq ($(MACOS),true)
  98. TARGETS = carla-native-lv2-export carla-native.lv2/carla-native.dylib
  99. else
  100. TARGETS = carla-native-lv2-export carla-native.lv2/carla-native.so
  101. endif
  102. endif
  103. # --------------------------------------------------------------
  104. all: $(TARGETS)
  105. clean:
  106. $(RM) $(TARGETS) *.o
  107. $(RM) carla-native.lv2/*.*
  108. debug:
  109. $(MAKE) DEBUG=true
  110. # --------------------------------------------------------------
  111. carla-native-base.cpp.o: carla-native-base.cpp ../modules/CarlaNative.h
  112. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  113. carla-native-lv2.cpp.o: carla-native-lv2.cpp carla-native-base.cpp ../modules/CarlaNative.h
  114. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  115. carla-native-lv2-export.cpp.o: carla-native-lv2-export.cpp carla-native-base.cpp ../modules/CarlaNative.h
  116. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  117. # --------------------------------------------------------------
  118. carla-native-lv2-export: carla-native-lv2-export.cpp.o $(LIBS)
  119. $(CXX) $< -Wl,--start-group $(LIBS) -Wl,--end-group $(LINK_FLAGS) -o $@
  120. ./carla-native-lv2-export
  121. carla-native-lv2-export.exe: carla-native-lv2-export.cpp.o $(LIBS)
  122. $(CXX) $< -Wl,--start-group $(LIBS) -Wl,--end-group $(LINK_FLAGS) -o $@
  123. ./carla-native-lv2-export.exe
  124. # --------------------------------------------------------------
  125. carla-native.lv2/carla-native.dll: carla-native-lv2.cpp.o $(LIBS)
  126. $(CXX) $< -Wl,--start-group $(LIBS) -Wl,--end-group -shared $(LINK_FLAGS) -o $@
  127. carla-native.lv2/carla-native.dylib: carla-native-lv2.cpp.o $(LIBS)
  128. $(CXX) $< -Wl,--start-group $(LIBS) -Wl,--end-group -dynamiclib $(LINK_FLAGS) -o $@
  129. carla-native.lv2/carla-native.so: carla-native-lv2.cpp.o $(LIBS)
  130. $(CXX) $< -Wl,--start-group $(LIBS) -Wl,--end-group -shared $(LINK_FLAGS) -o $@
  131. # --------------------------------------------------------------
  132. .FORCE:
  133. .PHONY: .FORCE
  134. ../backend/carla_engine_plugin.a: .FORCE
  135. $(MAKE) -C ../backend/engine ../carla_engine_plugin.a
  136. ../backend/carla_plugin.a: .FORCE
  137. $(MAKE) -C ../backend/plugin ../carla_plugin.a
  138. ../modules/%.a: .FORCE
  139. $(MAKE) -C ../modules $*
  140. # --------------------------------------------------------------