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.dist.mk 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. #!/usr/bin/make -f
  2. # Makefile for Carla #
  3. # ------------------ #
  4. # Created by falkTX
  5. #
  6. # NOTE to be imported from main Makefile
  7. # ----------------------------------------------------------------------------------------------------------------------------
  8. PYTHON = $(EXE_WRAPPER) $(shell which python3$(APP_EXT))
  9. ifeq ($(WIN32),true)
  10. QT5_DLL_EXT = .dll
  11. QT5_DLL_V = 5
  12. endif
  13. ifeq ($(MACOS),true)
  14. QT5_LIB_PREFIX = lib
  15. endif
  16. QT5_PREFIX = $(shell pkg-config --variable=prefix Qt5OpenGLExtensions)
  17. # ----------------------------------------------------------------------------------------------------------------------------
  18. _PLUGIN_UIS = \
  19. carla-plugin \
  20. bigmeter-ui \
  21. midipattern-ui \
  22. notes-ui \
  23. xycontroller-ui
  24. _QT5_DLLS = \
  25. Qt$(QT5_DLL_V)Core$(QT5_DLL_EXT) \
  26. Qt$(QT5_DLL_V)Gui$(QT5_DLL_EXT) \
  27. Qt$(QT5_DLL_V)OpenGL$(QT5_DLL_EXT) \
  28. Qt$(QT5_DLL_V)PrintSupport$(QT5_DLL_EXT) \
  29. Qt$(QT5_DLL_V)Svg$(QT5_DLL_EXT) \
  30. Qt$(QT5_DLL_V)Widgets$(QT5_DLL_EXT)
  31. _QT5_PLUGINS = \
  32. iconengines/$(QT5_LIB_PREFIX)qsvgicon$(LIB_EXT) \
  33. imageformats/$(QT5_LIB_PREFIX)qjpeg$(LIB_EXT) \
  34. imageformats/$(QT5_LIB_PREFIX)qsvg$(LIB_EXT)
  35. ifeq ($(MACOS),true)
  36. _QT5_PLUGINS += \
  37. platforms/$(QT5_LIB_PREFIX)qcocoa$(LIB_EXT)
  38. else ifeq ($(WIN32),true)
  39. _QT5_PLUGINS += \
  40. platforms/$(QT5_LIB_PREFIX)qwindows$(LIB_EXT)
  41. endif
  42. # NOTE this has to be hardcoded for now. oh well
  43. ifeq ($(WIN32),true)
  44. _PYTHON_FILES = \
  45. libpython3.8.dll
  46. endif
  47. _THEME_FILES = \
  48. styles/carlastyle.json \
  49. styles/carlastyle$(LIB_EXT)
  50. _CARLA_HOST_FILES = \
  51. carla-bridge-lv2$(LIB_EXT) \
  52. carla-bridge-native$(APP_EXT) \
  53. carla-discovery-native$(APP_EXT) \
  54. libcarla_utils$(LIB_EXT)
  55. ifeq ($(MACOS),true)
  56. _CARLA_HOST_FILES += \
  57. $(_PLUGIN_UIS:%=resources/%$(APP_EXT)) \
  58. resources/carla-plugin-patchbay$(APP_EXT) \
  59. carla-bridge-lv2-cocoa$(APP_EXT)
  60. else ifeq ($(WIN32),true)
  61. _CARLA_HOST_FILES += \
  62. $(_PLUGIN_UIS:%=resources/%$(APP_EXT)) \
  63. resources/carla-plugin-patchbay$(APP_EXT) \
  64. carla-bridge-lv2-windows$(APP_EXT)
  65. endif
  66. _CARLA_APP_FILES = \
  67. Carla$(APP_EXT) \
  68. libcarla_standalone2$(LIB_EXT) \
  69. $(_CARLA_HOST_FILES) \
  70. $(_QT5_DLLS) \
  71. $(_QT5_PLUGINS) \
  72. $(_PYTHON_FILES) \
  73. $(_THEME_FILES)
  74. _CARLA_CONTROL_APP_FILES = \
  75. Carla-Control$(APP_EXT) \
  76. libcarla_utils$(LIB_EXT) \
  77. $(_QT5_DLLS) \
  78. $(_QT5_PLUGINS) \
  79. $(_PYTHON_FILES) \
  80. $(_THEME_FILES)
  81. _CARLA_LV2_PLUGIN_FILES = \
  82. carla.lv2/carla$(LIB_EXT) \
  83. carla.lv2/manifest.ttl \
  84. carla.lv2/resources/carla-plugin-patchbay$(APP_EXT) \
  85. carla.lv2/resources/lib/library.zip \
  86. $(_CARLA_HOST_FILES:%=carla.lv2/%) \
  87. $(_QT5_DLLS:%=carla.lv2/resources/%) \
  88. $(_QT5_PLUGINS:%=carla.lv2/resources/%) \
  89. $(_THEME_FILES:%=carla.lv2/resources/%)
  90. ifeq ($(MACOS),true)
  91. _CARLA_VST2FX_PLUGIN_FILES = \
  92. carlafx.vst/Contents/MacOS/CarlaVstFxShell \
  93. carlafx.vst/Contents/MacOS/resources/carla-plugin-patchbay$(APP_EXT) \
  94. carlafx.vst/Contents/MacOS/resources/lib/library.zip \
  95. $(_CARLA_HOST_FILES:%=carlafx.vst/Contents/MacOS/%) \
  96. $(_QT5_DLLS:%=carlafx.vst/Contents/MacOS/resources/%) \
  97. $(_QT5_PLUGINS:%=carlafx.vst/Contents/MacOS/resources/%) \
  98. $(_THEME_FILES:%=carlafx.vst/Contents/MacOS/resources/%)
  99. _CARLA_VST2SYN_PLUGIN_FILES = \
  100. carla.vst/Contents/MacOS/CarlaVstShell \
  101. carla.vst/Contents/MacOS/resources/carla-plugin-patchbay$(APP_EXT) \
  102. carla.vst/Contents/MacOS/resources/lib/library.zip \
  103. $(_CARLA_HOST_FILES:%=carla.vst/Contents/MacOS/%) \
  104. $(_QT5_DLLS:%=carla.vst/Contents/MacOS/resources/%) \
  105. $(_QT5_PLUGINS:%=carla.vst/Contents/MacOS/resources/%) \
  106. $(_THEME_FILES:%=carla.vst/Contents/MacOS/resources/%)
  107. else ifeq ($(WIN32),true)
  108. _CARLA_VST2_PLUGIN_FILES = \
  109. carla.vst/CarlaVstShell.dll \
  110. carla.vst/CarlaVstFxShell.dll \
  111. carla.vst/resources/carla-plugin-patchbay.exe \
  112. carla.vst/resources/lib/library.zip \
  113. $(_CARLA_HOST_FILES:%=carla.vst/%) \
  114. $(_PYTHON_FILES:%=carla.vst/resources/%) \
  115. $(_QT5_DLLS:%=carla.vst/resources/%) \
  116. $(_QT5_PLUGINS:%=carla.vst/resources/%) \
  117. $(_THEME_FILES:%=carla.vst/resources/%)
  118. endif
  119. ifeq ($(WIN32),true)
  120. CARLA_APP_FILES = $(_CARLA_APP_FILES:%=build/Carla/%)
  121. CARLA_APP_ZIPS = $(_PLUGIN_UIS:%=build/%-resources/lib/library.zip)
  122. CARLA_CONTROL_APP_FILES = $(_CARLA_CONTROL_APP_FILES:%=build/Carla-Control/%)
  123. else
  124. CARLA_APP_FILES = $(_CARLA_APP_FILES:%=build/Carla.app/Contents/MacOS/%)
  125. CARLA_APP_ZIPS = $(_PLUGIN_UIS:%=build/%.app/Contents/MacOS/lib/library.zip)
  126. CARLA_CONTROL_APP_FILES = $(_CARLA_CONTROL_APP_FILES:%=build/Carla-Control.app/Contents/MacOS/%)
  127. endif
  128. # ----------------------------------------------------------------------------------------------------------------------------
  129. # entry point
  130. ifeq ($(WIN64),true)
  131. TARGETS = Carla-$(VERSION)-win64.zip
  132. else ifeq ($(WIN32),true)
  133. TARGETS = Carla-$(VERSION)-win32.zip
  134. else
  135. TARGETS = Carla-$(VERSION)-macOS.dmg
  136. endif
  137. dist: $(TARGETS)
  138. # ----------------------------------------------------------------------------------------------------------------------------
  139. # create final file
  140. Carla-$(VERSION)-macOS.dmg: build/Carla.app/Contents/Info.plist build/Carla-Control.app/Contents/Info.plist build/Carla-Plugins.pkg
  141. rm -rf build/macos-pkg $@
  142. mkdir build/macos-pkg
  143. cp -r build/Carla.app build/Carla-Control.app build/Carla-Plugins.pkg data/macos/README build/macos-pkg/
  144. hdiutil create $@ -srcfolder build/macos-pkg -volname "Carla-$(VERSION)" -fs HFS+ -ov
  145. rm -rf build/macos-pkg
  146. Carla-$(VERSION)-win64.zip: $(CARLA_APP_FILES) $(CARLA_CONTROL_APP_FILES) $(_CARLA_LV2_PLUGIN_FILES:%=build/%) $(_CARLA_VST2_PLUGIN_FILES:%=build/%)
  147. echo TODO
  148. # ----------------------------------------------------------------------------------------------------------------------------
  149. # macOS final cleanup, after everything is in place
  150. define PATCH_QT_DEPENDENCIES
  151. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore ${1} && \
  152. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui ${1} && \
  153. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL ${1} && \
  154. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport ${1} && \
  155. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg ${1} && \
  156. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets ${1} && \
  157. install_name_tool -change "@rpath/QtMacExtras.framework/Versions/5/QtMacExtras" @executable_path/QtMacExtras ${1}
  158. endef
  159. ifeq ($(MACOS),true)
  160. define CLEANUP_AND_PATCH_CXFREEZE_FILES
  161. # cleanup
  162. find build/${1}.app/Contents/MacOS/ -type f -name "*.py" -delete
  163. find build/${1}.app/Contents/MacOS/ -type f -name "*.pyi" -delete
  164. find build/${1}.app/Contents/MacOS/ -type f -name "pylupdate.so" -delete
  165. find build/${1}.app/Contents/MacOS/ -type f -name "pyrcc.so" -delete
  166. find build/${1}.app/Contents/MacOS/ -type f -name "QtMacExtras*" -delete
  167. find build/${1}.app/Contents/MacOS/ -type f -name "QtNetwork*" -delete
  168. find build/${1}.app/Contents/MacOS/ -type f -name "QtSql*" -delete
  169. find build/${1}.app/Contents/MacOS/ -type f -name "QtTest*" -delete
  170. find build/${1}.app/Contents/MacOS/ -type f -name "QtXml*" -delete
  171. #find build/${1}.app/Contents/MacOS/ -type f -name "*.pyc" -delete
  172. rm -rf build/${1}.app/Contents/MacOS/lib/PyQt5/uic
  173. # adjust binaries
  174. (cd build/${1}.app/Contents/MacOS && \
  175. for f in `find . -type f | grep -e /Qt -e QOpenGL -e libq -e carlastyle.dylib -e sip.so`; do \
  176. $(call PATCH_QT_DEPENDENCIES,$$f); \
  177. done)
  178. endef
  179. else ifeq ($(WIN32),true)
  180. define CLEANUP_AND_PATCH_CXFREEZE_FILES
  181. # cleanup
  182. find build/${1}/ -type f -name "*.py" -delete
  183. find build/${1}/ -type f -name "*.pyi" -delete
  184. find build/${1}/ -type f -name "pylupdate.so" -delete
  185. find build/${1}/ -type f -name "pyrcc.so" -delete
  186. find build/${1}/ -type f -name "QtMacExtras*" -delete
  187. find build/${1}/ -type f -name "QtNetwork*" -delete
  188. find build/${1}/ -type f -name "QtSql*" -delete
  189. find build/${1}/ -type f -name "QtTest*" -delete
  190. find build/${1}/ -type f -name "QtXml*" -delete
  191. #find build/${1}/ -type f -name "*.pyc" -delete
  192. rm -rf build/${1}/lib/PyQt5/uic
  193. endef
  194. endif
  195. build/Carla.app/Contents/Info.plist: $(CARLA_APP_FILES)
  196. $(call CLEANUP_AND_PATCH_CXFREEZE_FILES,Carla)
  197. # extra step for standalone, symlink resources used in plugin UIs
  198. mkdir -p build/Carla.app/Contents/MacOS/resources
  199. (cd build/Carla.app/Contents/MacOS/resources && \
  200. ln -sf ../Qt* ../lib ../iconengines ../imageformats ../platforms ../styles . && \
  201. ln -sf carla-plugin$(APP_EXT) carla-plugin-patchbay$(APP_EXT))
  202. # mark as done
  203. touch $@
  204. build/Carla-Control.app/Contents/Info.plist: $(CARLA_CONTROL_APP_FILES)
  205. $(call CLEANUP_AND_PATCH_CXFREEZE_FILES,Carla-Control)
  206. # mark as done
  207. touch $@
  208. # ----------------------------------------------------------------------------------------------------------------------------
  209. # application bundle, depends on cxfreeze library.zip
  210. ifeq ($(WIN32),true)
  211. define GENERATE_LIBRARY_ZIP
  212. env PYTHONPATH=$(CURDIR)/source/frontend SCRIPT_NAME=${1} $(PYTHON) ./data/windows/app-gui.py build_exe
  213. endef
  214. else
  215. define GENERATE_LIBRARY_ZIP
  216. env PYTHONPATH=$(CURDIR)/source/frontend SCRIPT_NAME=${1} $(PYTHON) ./data/macos/bundle.py bdist_mac --bundle-name=${1}
  217. endef
  218. endif
  219. # ----------------------------------------------------------------------------------------------------------------------------
  220. build/Carla.app/Contents/MacOS/Carla: build/Carla.app/Contents/MacOS/lib/library.zip
  221. build/Carla.app/Contents/MacOS/lib/library.zip: $(CARLA_APP_ZIPS) data/macos/bundle.py data/macos/Carla.plist source/frontend/*
  222. $(call GENERATE_LIBRARY_ZIP,Carla)
  223. # merge all zips into 1
  224. rm -rf build/Carla.app/Contents/MacOS/lib/_lib
  225. mkdir build/Carla.app/Contents/MacOS/lib/_lib
  226. (cd build/Carla.app/Contents/MacOS/lib/_lib && \
  227. mv ../library.zip ../library-main.zip && \
  228. $(_PLUGIN_UIS:%=unzip -n $(CURDIR)/build/%.app/Contents/MacOS/lib/library.zip &&) \
  229. unzip -o ../library-main.zip && \
  230. zip -r -9 ../library.zip *)
  231. rm -rf build/Carla.app/Contents/MacOS/lib/_lib
  232. rm -rf build/Carla.app/Contents/MacOS/lib/library-main.zip
  233. # ----------------------------------------------------------------------------------------------------------------------------
  234. build/Carla-Control.app/Contents/MacOS/Carla-Control: build/Carla-Control.app/Contents/MacOS/lib/library.zip
  235. build/Carla-Control.app/Contents/MacOS/lib/library.zip: data/macos/bundle.py data/macos/Carla-Control.plist source/frontend/*
  236. $(call GENERATE_LIBRARY_ZIP,Carla-Control)
  237. # ----------------------------------------------------------------------------------------------------------------------------
  238. # macOS plugin UIs (stored in resources, depend on their respective startup script and generation of matching library.zip)
  239. build/Carla.app/Contents/MacOS/resources/%: build/%.app/Contents/MacOS/lib/library.zip
  240. -@mkdir -p $(shell dirname $@)
  241. @cp -v build/$*.app/Contents/MacOS/$* $@
  242. build/%.app/Contents/MacOS/lib/library.zip: data/macos/bundle.py source/frontend/%
  243. $(call GENERATE_LIBRARY_ZIP,$*)
  244. # ----------------------------------------------------------------------------------------------------------------------------
  245. build/Carla/Carla.exe: build/Carla/lib/library.zip
  246. $(call CLEANUP_AND_PATCH_CXFREEZE_FILES,Carla)
  247. touch $@
  248. build/Carla/lib/library.zip: $(CARLA_APP_ZIPS) data/windows/app-gui.py source/frontend/*
  249. $(call GENERATE_LIBRARY_ZIP,Carla)
  250. # merge all zips into 1
  251. rm -rf build/Carla/lib/_lib
  252. mkdir build/Carla/lib/_lib
  253. (cd build/Carla/lib/_lib && \
  254. mv ../library.zip ../library-main.zip && \
  255. $(_PLUGIN_UIS:%=unzip -n $(CURDIR)/build/%-resources/lib/library.zip &&) \
  256. unzip -o ../library-main.zip && \
  257. zip -r -9 ../library.zip *)
  258. rm -rf build/Carla/lib/_lib
  259. rm -rf build/Carla/lib/library-main.zip
  260. build/Carla/resources/%.exe: build/%-resources/lib/library.zip
  261. -@mkdir -p $(shell dirname $@)
  262. @cp -v build/$*-resources/$*.exe $@
  263. build/%-resources/lib/library.zip: data/windows/app-gui.py source/frontend/%
  264. $(call GENERATE_LIBRARY_ZIP,$*)
  265. # ----------------------------------------------------------------------------------------------------------------------------
  266. build/Carla-Control/Carla-Control.exe: build/Carla-Control/lib/library.zip
  267. $(call CLEANUP_AND_PATCH_CXFREEZE_FILES,Carla-Control)
  268. touch $@
  269. build/Carla-Control/lib/library.zip: data/windows/app-gui.py source/frontend/*
  270. $(call GENERATE_LIBRARY_ZIP,Carla-Control)
  271. # ----------------------------------------------------------------------------------------------------------------------------
  272. # macOS generic bundle files (either Qt or Carla binaries)
  273. build/Carla.app/Contents/MacOS/Qt% build/Carla-Control.app/Contents/MacOS/Qt%: $(QT5_PREFIX)/lib/Qt%.framework
  274. -@mkdir -p $(shell dirname $@)
  275. @cp -v $</Versions/5/Qt$* $@
  276. $(call PATCH_QT_DEPENDENCIES,$@)
  277. build/Carla.app/Contents/MacOS/iconengines/% build/Carla-Control.app/Contents/MacOS/iconengines/%: $(QT5_PREFIX)/lib/qt5/plugins/iconengines/%
  278. -@mkdir -p $(shell dirname $@)
  279. @cp -v $< $@
  280. $(call PATCH_QT_DEPENDENCIES,$@)
  281. build/Carla.app/Contents/MacOS/imageformats/% build/Carla-Control.app/Contents/MacOS/imageformats/%: $(QT5_PREFIX)/lib/qt5/plugins/imageformats/%
  282. -@mkdir -p $(shell dirname $@)
  283. @cp -v $< $@
  284. $(call PATCH_QT_DEPENDENCIES,$@)
  285. build/Carla.app/Contents/MacOS/platforms/% build/Carla-Control.app/Contents/MacOS/platforms/%: $(QT5_PREFIX)/lib/qt5/plugins/platforms/%
  286. -@mkdir -p $(shell dirname $@)
  287. @cp -v $< $@
  288. $(call PATCH_QT_DEPENDENCIES,$@)
  289. build/Carla.app/Contents/MacOS/styles/%.dylib build/Carla-Control.app/Contents/MacOS/styles/%.dylib: bin/styles/%.dylib
  290. -@mkdir -p $(shell dirname $@)
  291. @cp -v $< $@
  292. $(call PATCH_QT_DEPENDENCIES,$@)
  293. build/Carla.app/Contents/MacOS/% build/Carla-Control.app/Contents/MacOS/%: bin/%
  294. -@mkdir -p $(shell dirname $@)
  295. @cp -v $< $@
  296. # ----------------------------------------------------------------------------------------------------------------------------
  297. # win32 generic bundle files (either Qt or Carla binaries)
  298. build/Carla/libpython3% build/Carla-Control/libpython3%: $(QT5_PREFIX)/bin/libpython3%
  299. -@mkdir -p $(shell dirname $@)
  300. @cp -v $< $@
  301. build/Carla/Qt5% build/Carla-Control/Qt5%: $(QT5_PREFIX)/bin/Qt5%
  302. -@mkdir -p $(shell dirname $@)
  303. @cp -v $< $@
  304. build/Carla/iconengines/% build/Carla-Control/iconengines/%: $(QT5_PREFIX)/lib/qt5/plugins/iconengines/%
  305. -@mkdir -p $(shell dirname $@)
  306. @cp -v $< $@
  307. build/Carla/imageformats/% build/Carla-Control/imageformats/%: $(QT5_PREFIX)/lib/qt5/plugins/imageformats/%
  308. -@mkdir -p $(shell dirname $@)
  309. @cp -v $< $@
  310. build/Carla/platforms/% build/Carla-Control/platforms/%: $(QT5_PREFIX)/lib/qt5/plugins/platforms/%
  311. -@mkdir -p $(shell dirname $@)
  312. @cp -v $< $@
  313. build/Carla/% build/Carla-Control/%: bin/%
  314. -@mkdir -p $(shell dirname $@)
  315. @cp -v $< $@
  316. # ----------------------------------------------------------------------------------------------------------------------------
  317. # Plugin rules
  318. MACOS_PACKAGE_EXP = -e 's/version="0"/version="$(VERSION)"/'
  319. ifeq ($(CPU_ARM64),true)
  320. MACOS_PACKAGE_EXP += -e 's/hostArchitectures="x86_64"/hostArchitectures="arm64,x86_64"/'
  321. endif
  322. build/Carla-Plugins.pkg: build/carla-lv2.pkg build/carla-vst2fx.pkg build/carla-vst2syn.pkg build/package.xml
  323. productbuild \
  324. --distribution build/package.xml \
  325. --identifier studio.kx.carla \
  326. --package-path "build" \
  327. --version "$(VERSION)" \
  328. "$@"
  329. build/package.xml: data/macos/package.xml
  330. sed $(MACOS_PACKAGE_EXP) $< > $@
  331. build/carla-lv2.pkg: $(_CARLA_LV2_PLUGIN_FILES:%=build/%)
  332. pkgbuild \
  333. --identifier "studio.kx.carla.lv2" \
  334. --install-location "/Library/Audio/Plug-Ins/LV2/carla.lv2/" \
  335. --root "build/carla.lv2/" \
  336. "$@"
  337. build/carla-vst2fx.pkg: $(_CARLA_VST2FX_PLUGIN_FILES:%=build/%)
  338. pkgbuild \
  339. --identifier "studio.kx.carla.vst2fx" \
  340. --install-location "/Library/Audio/Plug-Ins/VST/carlafx.vst/" \
  341. --root "build/carlafx.vst/" \
  342. "$@"
  343. build/carla-vst2syn.pkg: $(_CARLA_VST2SYN_PLUGIN_FILES:%=build/%)
  344. pkgbuild \
  345. --identifier "studio.kx.carla.vst2syn" \
  346. --install-location "/Library/Audio/Plug-Ins/VST/carla.vst/" \
  347. --root "build/carla.vst/" \
  348. "$@"
  349. # ----------------------------------------------------------------------------------------------------------------------------
  350. # LV2 specific files
  351. build/carla.lv2/%$(LIB_EXT): bin/carla.lv2/%$(LIB_EXT)
  352. -@mkdir -p $(shell dirname $@)
  353. @cp -v $< $@
  354. build/carla.lv2/manifest.ttl: bin/carla.lv2/manifest.ttl
  355. -@mkdir -p $(shell dirname $@)
  356. @cp -v bin/carla.lv2/*.ttl build/carla.lv2/
  357. # ----------------------------------------------------------------------------------------------------------------------------
  358. # VST2 specific files
  359. _MACVST_FILES = Contents/Info.plist Contents/PkgInfo Contents/Resources/empty.lproj
  360. build/carla.vst/Contents/MacOS/CarlaVstShell: bin/CarlaVstShell.dylib $(_MACVST_FILES:%=build/carla.vst/%)
  361. -@mkdir -p $(shell dirname $@)
  362. @cp -v $< $@
  363. build/carlafx.vst/Contents/MacOS/CarlaVstFxShell: bin/CarlaVstFxShell.dylib $(_MACVST_FILES:%=build/carlafx.vst/%)
  364. -@mkdir -p $(shell dirname $@)
  365. @cp -v $< $@
  366. # ----------------------------------------------------------------------------------------------------------------------------
  367. build/carla.vst/Contents/Info.plist: data/macos/CarlaVstShell.plist
  368. -@mkdir -p $(shell dirname $@)
  369. @cp -v $< $@
  370. build/carlafx.vst/Contents/Info.plist: data/macos/CarlaVstFxShell.plist
  371. -@mkdir -p $(shell dirname $@)
  372. @cp -v $< $@
  373. build/%.vst/Contents/PkgInfo:
  374. -@mkdir -p $(shell dirname $@)
  375. @echo "BNDL????" > $@
  376. build/%.vst/Contents/Resources/empty.lproj:
  377. -@mkdir -p $(shell dirname $@)
  378. @touch $@
  379. # ----------------------------------------------------------------------------------------------------------------------------
  380. # Generic plugin rules
  381. build/Carla/resources/carla-plugin-patchbay.exe: build/Carla/resources/carla-plugin.exe
  382. @ln -sfv carla-plugin.exe $@
  383. build/carla%/resources/carla-plugin-patchbay$(APP_EXT): build/carla%/resources/carla-plugin$(APP_EXT)
  384. -@mkdir -p $(shell dirname $@)
  385. @ln -sfv carla-plugin$(APP_EXT) $@
  386. # ----------------------------------------------------------------------------------------------------------------------------
  387. ifeq ($(MACOS),true)
  388. build/carla.lv2/resources/% build/carla.vst/Contents/MacOS/resources/% build/carlafx.vst/Contents/MacOS/resources/%: build/Carla.app/Contents/MacOS/resources/%
  389. -@mkdir -p $(shell dirname $@)
  390. @cp -v $< $@
  391. build/carla.lv2/resources/lib/library.zip build/carla.vst/Contents/MacOS/resources/lib/library.zip build/carlafx.vst/Contents/MacOS/resources/lib/library.zip: build/Carla.app/Contents/MacOS/resources/lib/library.zip
  392. -@mkdir -p $(shell dirname $@)
  393. @cp -rv build/Carla.app/Contents/MacOS/resources/lib/* $(shell dirname $@)/
  394. build/carla.lv2/% build/carla.vst/Contents/MacOS/% build/carlafx.vst/Contents/MacOS/%: build/Carla.app/Contents/MacOS/%
  395. -@mkdir -p $(shell dirname $@)
  396. @cp -v $< $@
  397. else
  398. build/carla.lv2/resources/libpython3% build/carla.vst/resources/libpython3%: build/Carla/libpython3%
  399. -@mkdir -p $(shell dirname $@)
  400. @cp -v $< $@
  401. build/carla.lv2/resources/% build/carla.vst/resources/%: build/Carla/resources/%
  402. -@mkdir -p $(shell dirname $@)
  403. @cp -v $< $@
  404. build/carla.lv2/resources/lib/library.zip build/carla.vst/resources/lib/library.zip: build/Carla/resources/lib/library.zip
  405. -@mkdir -p $(shell dirname $@)
  406. @cp -rv build/Carla/resources/lib/* $(shell dirname $@)/
  407. build/carla.lv2/% build/carla.vst/%: build/Carla/%
  408. -@mkdir -p $(shell dirname $@)
  409. @cp -v $< $@
  410. endif
  411. # ----------------------------------------------------------------------------------------------------------------------------