-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile.mingw64.mk
175 lines (126 loc) · 4.2 KB
/
Makefile.mingw64.mk
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
include Common.mk
include Install-deps.mk
OS := windows
#
############################ ZynAddSubFX Rules ############################
#
#
# Fetch dependencies
#
# Downloading rules are in Install-deps.mk
#
copy_libwinpthread: prepare_workspace
mkdir -p $(PREFIX_PATH)/bin/
cp /mingw64/bin/libwinpthread* $(PREFIX_PATH)/bin/
#
# Build dependencies
#
build_fftw: $(DEPS_PATH)/fftw
cd $< ; \
./configure --prefix=$(PREFIX_PATH) --with-our-malloc --disable-mpi --enable-single
$(MAKE) -C $<
$(MAKE) -C $< install
build_libio: $(DEPS_PATH)/liblo
cd $< ; \
./configure --prefix=$(PREFIX_PATH) --disable-shared --enable-static
$(MAKE) -C $<
$(MAKE) -C $< install
build_mxml: $(DEPS_PATH)/mxml
cd $< ; \
./configure --prefix=$(PREFIX_PATH) --disable-shared --enable-static
$(MAKE) -C $< libmxml.a
$(MAKE) -C $< -i install TARGETS=""
build_portaudio: $(DEPS_PATH)/portaudio
cd $< ; \
./configure --prefix=$(PREFIX_PATH)
$(MAKE) -C $<
$(MAKE) -C $< install
build_zlib: $(DEPS_PATH)/zlib
cd $< ; \
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$(PREFIX_PATH)
$(MAKE) -C $<
$(MAKE) -C $< install
#
# Final make rule
#
build_zynaddsubfx_deps: build_fftw build_libio build_mxml build_portaudio build_zlib copy_libwinpthread
get_zynaddsubfx: fetch_zynaddsubfx build_zynaddsubfx_deps
build_zynaddsubfx:
$(info ========== Building ZynAddSubFX in $(MODE) mode ==========)
rm -rf $(ZYNADDSUBFX_BUILD_DIR)
mkdir -p $(ZYNADDSUBFX_BUILD_DIR)
env \
PATH=$(PREFIX_PATH):$(PATH) \
VERSION=$(VER) \
BUILD_MODE=$(MODE) \
cmake -S $(ZYNADDSUBFX_PATH) -B $(ZYNADDSUBFX_BUILD_DIR) \
-DCMAKE_TOOLCHAIN_FILE=$(TOP)/z/mingw64-build.cmake \
-G "MSYS Makefiles" \
-DOssEnable=False \
-DGuiModule=zest \
-DDemoMode=$(DEMO_MODE) \
-DCMAKE_INSTALL_PREFIX=/usr \
-DDefaultOutput=pa
$(MAKE) -C $(ZYNADDSUBFX_BUILD_DIR)
#
############################ Zest Rules ############################
#
apply_mruby_patches: fetch_zest
ifneq ($(ZEST_COMMIT), DIRTY)
cd $(ZEST_PATH)/mruby ; \
git checkout -- . ; \
patch -p1 -N < ../string-backtraces.diff
endif
#this patch is to fix a conflict between mingw and libuv.
# the conflict is fixed in later versions of libuv, but mruby-zest uses an earlier version currently.
cd $(ZEST_PATH)/deps/libuv ; \
git checkout -- . ; \
patch -p1 -N < $(TOP)/0001-build-fix-build-failures-with-MinGW-new-headers.patch
setup_zest: fetch_zest apply_mruby_patches setup_libuv
cd $(ZEST_PATH) ; \
ruby rebuild-fcache.rb
#
# Final Make rule
#
get_zest: fetch_zest apply_mruby_patches setup_zest
build_zest:
$(info ========== Building Zest in $(MODE) mode ==========)
$(MAKE) -C $(ZEST_PATH) clean
cd $(ZEST_PATH); \
rm -f package/qml/*.qml; \
ruby rebuild-fcache.rb
cd $(ZEST_PATH)/deps/mruby-file-stat/src; \
../configure
env \
VERSION=$(VER) BUILD_MODE=$(MODE) \
$(MAKE) \
-C $(ZEST_PATH) windows
#
############################ Packing Up Rules ############################
#
TARGET_ZIP_FILE := $(BUILD_PATH)/zyn-fusion-windows-64bit-$(VER)-$(MODE).zip
ZYN_FUSION_OUT := $(BUILD_PATH)/zyn-fusion-windows-64bit-$(VER)-$(MODE)
copy_zest_files:
rm -rf $(ZYN_FUSION_OUT)
mkdir -p $(ZYN_FUSION_OUT)
mkdir -p $(ZYN_FUSION_OUT)/qml
touch $(ZYN_FUSION_OUT)/qml/MainWindow.qml
mkdir -p $(ZYN_FUSION_OUT)/font
mkdir -p $(ZYN_FUSION_OUT)/schema
cp $(ZEST_PATH)/zest.exe $(ZYN_FUSION_OUT)/zyn-fusion.exe
cp $(ZEST_PATH)/libzest.dll $(ZYN_FUSION_OUT)/libzest.dll
cp $(shell find $(ZEST_PATH)/deps/nanovg -type f | grep ttf$$) $(ZYN_FUSION_OUT)/font/
cp $(ZEST_PATH)/src/osc-bridge/schema/test.json $(ZYN_FUSION_OUT)/schema/
cp $(ZYNADDSUBFX_BUILD_DIR)/src/Plugin/ZynAddSubFX/vst/ZynAddSubFX.dll $(ZYN_FUSION_OUT)/
cp $(ZYNADDSUBFX_BUILD_DIR)/src/zynaddsubfx.exe $(ZYN_FUSION_OUT)/
cp $(PREFIX_PATH)/bin/libportaudio-2.dll $(ZYN_FUSION_OUT)/
cp $(PREFIX_PATH)/bin/libwinpthread-1.dll $(ZYN_FUSION_OUT)/
cp -a $(ZYNADDSUBFX_PATH)/instruments/banks $(ZYN_FUSION_OUT)/
echo `date` > $(ZYN_FUSION_OUT)/VERSION
package: copy_zest_files
rm -f $(ZYN_FUSION_OUT)/qml/LocalPropTest.qml
rm -f $(ZYN_FUSION_OUT)/qml/FilterView.qml
rm -f -r $(TARGET_ZIP_FILE)
cd $(ZYN_FUSION_OUT)/../ ; \
zip -q -r $(TARGET_ZIP_FILE) ./$(shell basename $(ZYN_FUSION_OUT))/*
@echo "Finished! Made Package in $(MODE) Mode"