-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
71 lines (53 loc) · 1.99 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
RACK_DIR ?= ../..
include $(RACK_DIR)/arch.mk
EXTRA_CMAKE :=
RACK_PLUGIN_NAME := plugin
RACK_PLUGIN_EXT := so
ifdef ARCH_WIN
RACK_PLUGIN_EXT := dll
endif
ifdef ARCH_MAC
EXTRA_CMAKE := -DCMAKE_OSX_ARCHITECTURES="x86_64"
RACK_PLUGIN_EXT := dylib
ifdef ARCH_ARM64
EXTRA_CMAKE := -DCMAKE_OSX_ARCHITECTURES="arm64"
endif
endif
RACK_PLUGIN := $(RACK_PLUGIN_NAME).$(RACK_PLUGIN_EXT)
CMAKE_BUILD ?= dep/cmake-build
cmake_rack_plugin := $(CMAKE_BUILD)/$(RACK_PLUGIN)
# create empty plugin lib to skip the make target execution
$(shell touch $(RACK_PLUGIN))
$(info cmake_rack_plugin target is '$(cmake_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) -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(CMAKE_BUILD)/dist $(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 build/surge-data res
build/surge-data:
mkdir -p build/surge-data
cp surge/resources/surge-shared/windows.wt build/surge-data
cp surge/resources/surge-shared/configuration.xml build/surge-data
cp -R surge/resources/data/wavetables build/surge-data/wavetables
cp -R surge/resources/data/fx_presets build/surge-data/fx_presets
cp -R res/surge_extra_data/fx_presets build/surge-data
DISTRIBUTABLES += $(wildcard LICENSE*) res docs README.md build/surge-data
# Include the VCV plugin Makefile framework
include $(RACK_DIR)/plugin.mk
COMMUNITY_ISSUE=https://github.com/VCVRack/community/issues/745
community:
open $(COMMUNITY_ISSUE)
issue_blurb: dist
git diff --exit-code
git diff --cached --exit-code
@echo
@echo "Paste this into github issue " $(COMMUNITY_ISSUE)
@echo
@echo "* Version: v$(VERSION)"
@echo "* Transaction: " `git rev-parse HEAD`
@echo "* Branch: " `git rev-parse --abbrev-ref HEAD`