-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
47 lines (34 loc) · 1.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
RACK_DIR ?= ../..
include $(RACK_DIR)/arch.mk
EXTRA_CMAKE :=
RACK_PLUGIN := plugin.so
ifdef ARCH_WIN
RACK_PLUGIN := plugin.dll
endif
ifdef ARCH_MAC
EXTRA_CMAKE := -DCMAKE_OSX_ARCHITECTURES="x86_64"
RACK_PLUGIN := plugin.dylib
ifdef ARCH_ARM64
EXTRA_CMAKE := -DCMAKE_OSX_ARCHITECTURES="arm64"
# Some older versions of rack arm beta added -arm64 to the plugin name
# RACK_PLUGIN := plugin-arm64.dylib
endif
endif
CMAKE_BUILD ?= dep/cmake-build
cmake_rack_plugin := $(CMAKE_BUILD)/$(RACK_PLUGIN)
$(info cmake_rack_plugin target is '$(cmake_rack_plugin)')
# create empty plugin lib to skip the make target execution
$(shell touch $(RACK_PLUGIN))
# trigger CMake build when running `make dep`
DEPS += $(cmake_rack_plugin)
$(cmake_rack_plugin): CMakeLists.txt
$(CMAKE) -B $(CMAKE_BUILD) -DRACK_SDK_DIR=$(RACK_DIR) -DBUILD_FOR_RACK_ONLY=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(CMAKE_BUILD)/dist -DBUILD_RACK_PLUGIN=TRUE $(EXTRA_CMAKE)
cmake --build $(CMAKE_BUILD) -- -j $(shell getconf _NPROCESSORS_ONLN)
cmake --install $(CMAKE_BUILD)
rack_plugin: $(cmake_rack_plugin)
cp -vf $(cmake_rack_plugin) .
# Add files to the ZIP package when running `make dist`
dist: rack_plugin res
DISTRIBUTABLES += $(wildcard LICENSE*) res README.md
# Include the VCV plugin Makefile framework
include $(RACK_DIR)/plugin.mk