forked from AndreRH/hangover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.android
364 lines (303 loc) · 24 KB
/
Makefile.android
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# environment needs to be setup before the Makefile can run, e.g.:
#export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/ # Always use Java 8 here
#export PATH=/home/$USER/src/ndk/aarch64-linux-android/bin/:$PATH
#export ANDROID_HOME=/home/$USER/src/ANDROID/android-sdk-linux
#export NDK_SYSROOT=/home/$USER/src/ndk/aarch64-linux-android/sysroot
ifndef JAVA_HOME
$(error JAVA_HOME is not set)
endif
ifndef ANDROID_HOME
$(error ANDROID_HOME is not set)
endif
ifndef NDK_SYSROOT
$(error NDK_SYSROOT is not set)
endif
WINEDLLS = activeds adsldp adsldpc shcore dbghelp ole32 oleaut32 propsys rpcrt4 urlmon netapi32 dnsapi msimg32 dwmapi uxtheme setupapi wintrust wtsapi32 pdh avrt cryptnet imagehlp cryptui sensapi msvcp80 msvcp100 lz32 msi dplay dplayx dpwsockx dpnet dpnaddr dpnhpast dpnlobby dpvoice mpr oledlg shdocvw msacm32 mlang gdiplus shell32 shlwapi wininet comctl32 comdlg32 comsvcs d3d10core d3d10 d3d10_1 d3dcompiler_43 d3dcompiler_47 msxml msxml2 msxml3 msxml4 msxml6 shfolder d2d1 dwrite sspicli quartz msvfw32 amstream apphelp atl ieframe atl100 atl80 atlthunk scrrun mshtml inetcomm avifil32 browseui combase explorerframe credui d3dx10_43 d3dx9_43 d3dxof d3drm d3dx11_43 ddrawex devenum msdmo avicap32 dinput8 dispex dmband dmcompos dmime dmloader dmusic dmsynth hnetcfg dxdiagn evr faultrep fusion mscoree gameux hid hlink httpapi actxprxy inetmib1 snmpapi itss infosoft jscript jsproxy kernelbase mapi32 mf mfplat msctf mspatcha mswsock odbccp32 msrle32 vbscript mstask taskschd xmllite msvcirt msvcp110 msvcp120 msvcp140 msvcp60 msvcp90 netcfgx netprofm ninput ntdsapi ntprint oleacc packager psapi pstorec qcap qedit qmgr rasapi32 schannel serialui slc spoolss sti sxs twain_32 userenv vcomp version vulkan-1 winevulkan webservices winhttp wer windowscodecsext wlanapi wldap32 wmp wmphoto wmvcore wpc wsdapi wsnmp32 wuapi mssip32 msisip wbemprox powrprof
EXTDLLS = libcharset-1 libiconv-2 libxml2-2 libxslt-1
QEMU_DISABLES = --disable-bzip2 --disable-libusb --disable-sdl --disable-snappy --disable-virtfs --disable-opengl --disable-xen --disable-lzo --disable-qom-cast-debug --disable-vnc --disable-seccomp --disable-strip --disable-hax --disable-gnutls --disable-nettle --disable-replication --disable-tpm --disable-gtk --disable-gcrypt --disable-linux-aio --disable-system --disable-tools --disable-linux-user --disable-guest-agent --disable-fdt --disable-capstone --disable-werror --disable-virglrenderer --disable-vte --disable-auth-pam --disable-curses --disable-docs --disable-vde --disable-cap-ng --disable-spice --disable-rbd --disable-xfsctl --disable-smartcard --disable-usb-redir --disable-libiscsi --disable-libnfs --disable-glusterfs --disable-libssh
WINEDLL_TARGET32 = $(patsubst %,build/qemu/x86_64-windows-user/qemu_guest_dll32/%.dll,$(WINEDLLS))
WINEDLL_TARGET64 = $(patsubst %,build/qemu/x86_64-windows-user/qemu_guest_dll64/%.dll,$(WINEDLLS))
EXTDLL_TARGET32 = $(patsubst %,build/qemu/x86_64-windows-user/qemu_guest_dll32/%.dll,$(EXTDLLS))
DLLS = $(strip $(subst include,,$(notdir $(shell find dlls/ -maxdepth 1 -type d | grep -v opengl32 | grep -v "\.drv"))))
DRVS = $(strip $(subst include,,$(notdir $(shell find dlls/ -maxdepth 1 -type d | grep "\.drv"))))
DLL_GUEST = $(patsubst %,%.dll,$(DLLS))
DLL__HOST = $(patsubst %,qemu_%.dll.so,$(DLLS))
DLL___DIRS32 = $(patsubst %,build/dlls32/%/,$(DLLS))
DLL_TARGET32 = $(join $(DLL___DIRS32), $(DLL_GUEST)) $(join $(DLL___DIRS32), $(DLL__HOST))
DLL___DIRS64 = $(patsubst %,build/dlls64/%/,$(DLLS))
DLL_TARGET64 = $(join $(DLL___DIRS64), $(DLL_GUEST)) $(join $(DLL___DIRS64), $(DLL__HOST))
DRV__HOST = $(patsubst %,qemu_%.so,$(DRVS))
DRV___DIRS32 = $(patsubst %,build/dlls32/%/,$(DRVS))
DRV_TARGET32 = $(join $(DRV___DIRS32), $(DRVS)) $(join $(DRV___DIRS32), $(DRV__HOST))
DRV___DIRS64 = $(patsubst %,build/dlls64/%/,$(DRVS))
DRV_TARGET64 = $(join $(DRV___DIRS64), $(DRVS)) $(join $(DRV___DIRS64), $(DRV__HOST))
PREFIX = $(abspath build/wine-host/dlls/wineandroid.drv/assets/arm64-v8a)
WINE_SRC = $(abspath wine)
WINE_HOST = $(abspath build/wine-host)
TRIPLE = -b aarch64-linux-android
all: build/wine-host/dlls/wineandroid.drv/hangover-debug.apk
.PHONY: all
# Build libs
build/libpng/Makefile: libpng/configure
@mkdir -p $(@D)
cd $(@D) ; ../../libpng/configure --host=aarch64-linux-android --prefix=$(abspath build/aarch64-linux-android) CXX=aarch64-linux-android-clang++ CC=aarch64-linux-android-clang
build/aarch64-linux-android/lib/libpng16.so: build/libpng/Makefile
@mkdir -p $(@D)
+$(MAKE) -C build/libpng/ install
freetype/builds/unix/configure: freetype/autogen.sh
cd freetype ; NOCONFIGURE=1 ./autogen.sh
build/freetype/config.mk: freetype/builds/unix/configure build/aarch64-linux-android/lib/libpng16.so
@rm -rf build/freetype
@mkdir -p build/
cp -ra freetype build/
cd $(@D) ; ./configure --host=aarch64-linux-android --prefix=$(abspath build/aarch64-linux-android) --with-harfbuzz=no LIBPNG_CFLAGS="-I$(abspath build/aarch64-linux-android/include/libpng16)" LIBPNG_LIBS="-L$(abspath build/aarch64-linux-android/lib) -lpng16" CXX=aarch64-linux-android-clang++ CC=aarch64-linux-android-clang
build/aarch64-linux-android/lib/libfreetype.so: build/freetype/config.mk
@mkdir -p $(@D)
+$(MAKE) -C build/freetype/ install
glib/configure: glib/autogen.sh
cd $(@D) ; NOCONFIGURE=1 ./autogen.sh
build/glib/Makefile: glib/configure
@mkdir -p $(@D)
cd $(@D) ; ../../glib/configure --with-pcre=internal --host=aarch64-linux-android CXX=aarch64-linux-android-clang++ CC=aarch64-linux-android-clang --disable-libmount --prefix=$(abspath build/aarch64-linux-android)
build/aarch64-linux-android/lib/libglib-2.0.so: build/glib/Makefile
+$(MAKE) -C build/glib/ install
build/libiconv/Makefile: libiconv/configure
@mkdir -p $(@D)
cd $(@D) ; ../../libiconv/configure --host=i686-w64-mingw32 --prefix=$(abspath build/i686-w64-mingw32)
build/i686-w64-mingw32/bin/libcharset-1.dll: build/libiconv/Makefile
@mkdir -p $(@D)
+$(MAKE) -C build/libiconv/ install
libxml2/configure: libxml2/autogen.sh
cd $(@D) ; NOCONFIGURE=1 ./autogen.sh
build/libxml2/Makefile: libxml2/configure build/i686-w64-mingw32/bin/libcharset-1.dll
@mkdir -p $(@D)
cd $(@D) ; ../../libxml2/configure --host=i686-w64-mingw32 --enable-static=no --enable-shared=yes --without-python --without-zlib --without-lzma --with-iconv=$(abspath build/i686-w64-mingw32) --prefix=$(abspath build/i686-w64-mingw32)
build/i686-w64-mingw32/bin/libxml2-2.dll: build/libxml2/Makefile
@mkdir -p $(@D)
+$(MAKE) -C build/libxml2/ install
libxslt/configure: libxslt/autogen.sh
cd $(@D) ; NOCONFIGURE=1 ./autogen.sh
build/libxslt/Makefile: libxslt/configure build/i686-w64-mingw32/bin/libxml2-2.dll
@mkdir -p $(@D)
sed -i "s/WIN32_EXTRA_LDFLAGS/LIBXML_LIBS\) $$\(WIN32_EXTRA_LDFLAGS/" libxslt/libexslt/Makefile.am
cd $(@D) ; ../../libxslt/configure --host=i686-w64-mingw32 --enable-static=no --enable-shared=yes --without-python --without-plugins --without-crypto --prefix=$(abspath build/i686-w64-mingw32) PATH=$(abspath build/i686-w64-mingw32/bin):$(PATH) PKG_CONFIG_PATH=$(abspath build/i686-w64-mingw32/lib/pkgconfig)
build/i686-w64-mingw32/bin/libxslt-1.dll: build/libxslt/Makefile
@mkdir -p $(@D)
+$(MAKE) -C build/libxslt/ install
# Build the wine tools for crosscompilation
build/wine-tools/Makefile: wine/configure build/aarch64-linux-android/lib/libfreetype.so
@mkdir -p $(@D)
cd $(@D) ; ../../wine/configure --enable-win64 --with-freetype --with-gettext --disable-tests --disable-win16 --without-alsa --without-capi --without-cms --without-coreaudio --without-cups --without-curses --without-dbus --without-fontconfig --without-gphoto --without-glu --without-gnutls --without-gsm --without-gstreamer --without-hal --without-jpeg --without-krb5 --without-ldap --without-mpg123 --without-netapi --without-openal --without-opencl --without-opengl --without-osmesa --without-oss --without-pcap --without-pulse --without-png --without-sane --without-tiff --without-v4l2 --without-x --without-xcomposite --without-xcursor --without-xinerama --without-xinput --without-xinput2 --without-xml --without-xrandr --without-xrender --without-xshape --without-xshm --without-xslt --without-xxf86vm --without-zlib
build/wine-tools/.built: build/wine-tools/Makefile
+$(MAKE) -C build/wine-tools tools tools/sfnt2fon tools/widl tools/winebuild tools/winegcc tools/wmc tools/wrc
@touch build/wine-tools/.built
# Build the Host (e.g. arm64) wine
build/wine-host/Makefile: build/wine-tools/.built wine/configure
@mkdir -p $(@D)
cd $(@D) ; ../../wine/configure --host=aarch64-linux-android --with-wine-tools=../wine-tools --prefix=$(PREFIX) --with-freetype --with-png --bindir=$(PREFIX)/bin --libdir=$(PREFIX)/lib CXX=aarch64-linux-android-clang++ CC=aarch64-linux-android-clang PNG_CFLAGS="-I$(abspath build/aarch64-linux-android/include/libpng16)" PNG_LIBS="-L$(abspath build/aarch64-linux-android/lib) -lpng16" FREETYPE_CFLAGS="-I$(abspath build/aarch64-linux-android/include/freetype2)" FREETYPE_LIBS="-L$(abspath build/aarch64-linux-android/lib) -lm -lz -lpng16 -lfreetype" --disable-tests
wine-host build/wine-host/.built build/wine-host/dlls/wineandroid.drv/wine-debug.apk: build/wine-host/Makefile
+$(MAKE) -C build/wine-host
ln -sf ../wine-tools/tools build/wine-host/
@touch build/wine-host/.built
# Cross-Compile Wine for the guest platform to copy higher level DLLs from.
build/wine-guest/Makefile: build/wine-tools/.built wine/configure
@mkdir -p $(@D)
cd $(@D) ; ../../wine/configure --host=x86_64-w64-mingw32 --with-wine-tools=../wine-tools --without-freetype --disable-tests
wine-guest: build/wine-guest/Makefile
+$(MAKE) -C build/wine-guest/libs/port
+$(MAKE) -C build/wine-guest $(patsubst %,dlls/%,$(WINEDLLS))
# Cross-Compile Wine for the guest32 platform to copy higher level DLLs from.
build/wine-guest32/Makefile: build/wine-tools/.built wine/configure build/i686-w64-mingw32/bin/libxml2-2.dll build/i686-w64-mingw32/bin/libxslt-1.dll
@mkdir -p $(@D)
cd $(@D) ; ../../wine/configure --host=i686-w64-mingw32 --with-wine-tools=../wine-tools --without-freetype --disable-tests --with-xml --with-xslt XML2_CFLAGS="-I$(abspath build/i686-w64-mingw32/include/libxml2) -I$(abspath build/i686-w64-mingw32/include)" XML2_LIBS="-L$(abspath build/i686-w64-mingw32/lib) -lxml2 -liconv" XSLT_CFLAGS="-I$(abspath build/i686-w64-mingw32/include/libxml2) -I$(abspath build/i686-w64-mingw32/include)" XSLT_LIBS="-L$(abspath build/i686-w64-mingw32/lib) -lxslt -lxml2 -liconv" ac_cv_lib_soname_xslt="libxslt-1.dll"
wine-guest32: build/wine-guest32/Makefile
+$(MAKE) -C build/wine-guest32/libs/port
+$(MAKE) -C build/wine-guest32 $(patsubst %,dlls/%,$(WINEDLLS))
# Build qemu
build/qemu/Makefile: build/aarch64-linux-android/lib/libglib-2.0.so build/wine-tools/.built qemu/configure build/wine-host/.built
@mkdir -p $(@D)
+$(MAKE) -C build/glib/ install
rm -f build/aarch64-linux-android/lib/pkgconfig/gio-2.0.pc
cd $(@D) ; PKG_CONFIG_PATH=$(abspath build/aarch64-linux-android/lib/pkgconfig) CFLAGS="-fPIC $(CFLAGS)" CC="$(WINE_HOST)/tools/winegcc/winegcc -Wno-macro-redefined -D__ANDROID_API__=22 -I$(NDK_SYSROOT)/usr/include -L$(abspath build/aarch64-linux-android/lib) --sysroot=$(NDK_SYSROOT) -b aarch64-linux-android --winebuild $(WINE_HOST)/tools/winebuild/winebuild -I$(WINE_HOST)/include -I$(WINE_SRC)/include --wine-objdir $(WINE_HOST) -lwine -Wl,--no-as-needed -DMAP_ANONYMOUS=0x20 -DMAP_PRIVATE=2 -DMAP_SHARED=1 -DWINE_NOWINSOCK -U_WIN32 -UWIN64 -UWIN32 -DNOGDI" CXX="" ../../qemu/configure --python=/usr/bin/python3 --enable-windows-user --target-list=x86_64-windows-user $(QEMU_DISABLES); cd ../.. ; touch $@
build/qemu/x86_64-windows-user/qemu-x86_64.exe.so: build/qemu/Makefile
+$(MAKE) -C build/qemu
@mkdir -p build/qemu/x86_64-windows-user/qemu_guest_dll64
@mkdir -p build/qemu/x86_64-windows-user/qemu_host_dll64
@mkdir -p build/qemu/x86_64-windows-user/qemu_guest_dll32
@mkdir -p build/qemu/x86_64-windows-user/qemu_host_dll32
# Build the wrapper DLLs.
# with known dependencies (32-bit):
build/dlls32/gdi32/gdi32.dll: build/dlls32/ntdll/ntdll.dll
build/dlls32/comctl32/comctl32.dll: build/dlls32/shlwapi/shlwapi.dll build/dlls32/user32/user32.dll
build/dlls32/d3d9/d3d9.dll: build/dlls32/kernel32/kernel32.dll build/dlls32/msvcrt/msvcrt.dll
build/dlls32/ddraw/ddraw.dll: build/dlls32/msvcrt/msvcrt.dll build/dlls32/kernel32/kernel32.dll
build/dlls32/dinput/dinput.dll: build/dlls32/msvcrt/msvcrt.dll build/dlls32/kernel32/kernel32.dll
build/dlls32/dsound/dsound.dll: build/dlls32/msvcrt/msvcrt.dll
build/dlls32/gdi32/gdi32.dll: build/dlls32/ntdll/ntdll.dll
build/dlls32/kernel32/kernel32.dll: build/dlls32/ntdll/ntdll.dll
build/dlls32/msvcr100/msvcr100.dll: build/dlls32/kernel32/kernel32.dll build/dlls32/ntdll/ntdll.dll
build/dlls32/msvcr80/msvcr80.dll: build/dlls32/kernel32/kernel32.dll build/dlls32/ntdll/ntdll.dll
build/dlls32/msvcrt/msvcrt.dll: build/dlls32/kernel32/kernel32.dll build/dlls32/ntdll/ntdll.dll
build/dlls32/riched20/riched20.dll: build/dlls32/user32/user32.dll
build/dlls32/riched32/riched32.dll: build/dlls32/riched20/riched20.dll
build/dlls32/shcore/shcore.dll: build/dlls32/user32/user32.dll build/dlls32/gdi32/gdi32.dll
build/dlls32/user32/user32.dll: build/dlls32/ntdll/ntdll.dll
build/dlls32/winmm/winmm.dll: build/dlls32/user32/user32.dll
# with known dependencies (64-bit):
build/dlls64/gdi32/gdi32.dll: build/dlls64/ntdll/ntdll.dll
build/dlls64/comctl32/comctl32.dll: build/dlls64/shlwapi/shlwapi.dll build/dlls64/user32/user32.dll
build/dlls64/d3d9/d3d9.dll: build/dlls64/kernel32/kernel32.dll build/dlls64/msvcrt/msvcrt.dll
build/dlls64/ddraw/ddraw.dll: build/dlls64/msvcrt/msvcrt.dll build/dlls64/kernel32/kernel32.dll
build/dlls64/dinput/dinput.dll: build/dlls64/msvcrt/msvcrt.dll build/dlls64/kernel32/kernel32.dll
build/dlls64/dsound/dsound.dll: build/dlls64/msvcrt/msvcrt.dll
build/dlls64/gdi32/gdi32.dll: build/dlls64/ntdll/ntdll.dll
build/dlls64/kernel32/kernel32.dll: build/dlls64/ntdll/ntdll.dll
build/dlls64/msvcr100/msvcr100.dll: build/dlls64/kernel32/kernel32.dll build/dlls64/ntdll/ntdll.dll
build/dlls64/msvcr80/msvcr80.dll: build/dlls64/kernel32/kernel32.dll build/dlls64/ntdll/ntdll.dll
build/dlls64/msvcrt/msvcrt.dll: build/dlls64/kernel32/kernel32.dll build/dlls64/ntdll/ntdll.dll
build/dlls64/riched20/riched20.dll: build/dlls64/user32/user32.dll
build/dlls64/riched32/riched32.dll: build/dlls64/riched20/riched20.dll
build/dlls64/shcore/shcore.dll: build/dlls64/user32/user32.dll build/dlls64/gdi32/gdi32.dll
build/dlls64/user32/user32.dll: build/dlls64/ntdll/ntdll.dll
build/dlls64/winmm/winmm.dll: build/dlls64/user32/user32.dll
build/dlls64/%/Makefile:
mkdir -p $(@D)
$(eval DLL := $(lastword $(subst /, ,$(@D))))
echo "GUEST_CC=x86_64-w64-mingw32" > $@
echo "HOST_CC=$(TRIPLE)" >> $@
echo "SRCDIR=../../../dlls/$(DLL)" >> $@
echo "DESTDIR?=../../.." >> $@
echo "GUEST_BIT=64" >> $@
echo "HOST_BIT=64" >> $@
echo "WINE_DIR=wine-guest" >> $@
echo "EXTRALIBS=" >> $@
echo >> $@
echo "include ../../../dlls/$(DLL)/Makefile" >> $@
build/dlls32/%/Makefile:
mkdir -p $(@D)
$(eval DLL := $(lastword $(subst /, ,$(@D))))
echo "GUEST_CC=i686-w64-mingw32" > $@
echo "HOST_CC=$(TRIPLE)" >> $@
echo "SRCDIR=../../../dlls/$(DLL)" >> $@
echo "DESTDIR?=../../.." >> $@
echo "GUEST_BIT=32" >> $@
echo "HOST_BIT=64" >> $@
echo "WINE_DIR=wine-guest32" >> $@
echo "EXTRALIBS=" >> $@
echo >> $@
echo "include ../../../dlls/$(DLL)/Makefile" >> $@
define DLLS32_RULE_G
build/dlls32/$(1)/$(1).dll: build/dlls32/$(1)/Makefile build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
+$(MAKE) -C build/dlls32/$(1) $(1).dll
cp -lf build/dlls32/$(1)/$(1).dll build/qemu/x86_64-windows-user/qemu_guest_dll32/
endef
$(foreach mod,$(DLLS),$(eval $(call DLLS32_RULE_G,$(mod))))
define DLLS64_RULE_G
build/dlls64/$(1)/$(1).dll: build/dlls64/$(1)/Makefile build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
+$(MAKE) -C build/dlls64/$(1) $(1).dll
cp -lf build/dlls64/$(1)/$(1).dll build/qemu/x86_64-windows-user/qemu_guest_dll64/
endef
$(foreach mod,$(DLLS),$(eval $(call DLLS64_RULE_G,$(mod))))
define DRVS32_RULE_G
build/dlls32/$(1)/$(1): build/dlls32/$(1)/Makefile build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
+$(MAKE) -C build/dlls32/$(1) $(1)
cp -lf build/dlls32/$(1)/$(1) build/qemu/x86_64-windows-user/qemu_guest_dll32/
endef
$(foreach mod,$(DRVS),$(eval $(call DRVS32_RULE_G,$(mod))))
define DRVS64_RULE_G
build/dlls64/$(1)/$(1): build/dlls64/$(1)/Makefile build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
+$(MAKE) -C build/dlls64/$(1) $(1)
cp -lf build/dlls64/$(1)/$(1) build/qemu/x86_64-windows-user/qemu_guest_dll64/
endef
$(foreach mod,$(DRVS),$(eval $(call DRVS64_RULE_G,$(mod))))
define DLLS32_RULE_H
build/dlls32/$(1)/qemu_$(1).dll.so: build/dlls32/$(1)/Makefile build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
+$(MAKE) -C build/dlls32/$(1) WINEGCC="$(WINE_HOST)/tools/winegcc/winegcc -I$(NDK_SYSROOT)/usr/include -L$(PREFIX)/lib --sysroot=$(NDK_SYSROOT) -b aarch64-linux-android --winebuild $(WINE_HOST)/tools/winebuild/winebuild --wine-objdir $(WINE_HOST) -I$(WINE_HOST)/include -I$(WINE_SRC)/include" qemu_$(1).dll.so
cp -lf build/dlls32/$(1)/qemu_$(1).dll.so build/qemu/x86_64-windows-user/qemu_host_dll32/
endef
$(foreach mod,$(DLLS),$(eval $(call DLLS32_RULE_H,$(mod))))
define DLLS64_RULE_H
build/dlls64/$(1)/qemu_$(1).dll.so: build/dlls64/$(1)/Makefile build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
+$(MAKE) -C build/dlls64/$(1) WINEGCC="$(WINE_HOST)/tools/winegcc/winegcc -I$(NDK_SYSROOT)/usr/include -L$(PREFIX)/lib --sysroot=$(NDK_SYSROOT) -b aarch64-linux-android --winebuild $(WINE_HOST)/tools/winebuild/winebuild --wine-objdir $(WINE_HOST) -I$(WINE_HOST)/include -I$(WINE_SRC)/include" qemu_$(1).dll.so
cp -lf build/dlls64/$(1)/qemu_$(1).dll.so build/qemu/x86_64-windows-user/qemu_host_dll64/
endef
$(foreach mod,$(DLLS),$(eval $(call DLLS64_RULE_H,$(mod))))
define DRVS32_RULE_H
build/dlls32/$(1)/qemu_$(1).so: build/dlls32/$(1)/Makefile build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
+$(MAKE) -C build/dlls32/$(1) WINEGCC="$(WINE_HOST)/tools/winegcc/winegcc -I$(NDK_SYSROOT)/usr/include -L$(PREFIX)/lib --sysroot=$(NDK_SYSROOT) -b aarch64-linux-android --winebuild $(WINE_HOST)/tools/winebuild/winebuild --wine-objdir $(WINE_HOST) -I$(WINE_HOST)/include -I$(WINE_SRC)/include" qemu_$(1).so
cp -lf build/dlls32/$(1)/qemu_$(1).so build/qemu/x86_64-windows-user/qemu_host_dll32/
endef
$(foreach mod,$(DRVS),$(eval $(call DRVS32_RULE_H,$(mod))))
define DRVS64_RULE_H
build/dlls64/$(1)/qemu_$(1).so: build/dlls64/$(1)/Makefile build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
+$(MAKE) -C build/dlls64/$(1) WINEGCC="$(WINE_HOST)/tools/winegcc/winegcc -I$(NDK_SYSROOT)/usr/include -L$(PREFIX)/lib --sysroot=$(NDK_SYSROOT) -b aarch64-linux-android --winebuild $(WINE_HOST)/tools/winebuild/winebuild --wine-objdir $(WINE_HOST) --wine-objdir $(WINE_HOST) -I$(WINE_HOST)/include -I$(WINE_SRC)/include" qemu_$(1).so
cp -lf build/dlls64/$(1)/qemu_$(1).so build/qemu/x86_64-windows-user/qemu_host_dll64/
endef
$(foreach mod,$(DRVS),$(eval $(call DRVS64_RULE_H,$(mod))))
# Link Wine libraries.
define WINEDLLS_RULE
build/qemu/x86_64-windows-user/qemu_guest_dll32/$(1).dll build/qemu/x86_64-windows-user/qemu_guest_dll64/$(1).dll: wine-guest32 wine-guest build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
cp -lf build/wine-guest32/dlls/$(1)/$(1).dll build/qemu/x86_64-windows-user/qemu_guest_dll32/
cp -lf build/wine-guest/dlls/$(1)/$(1).dll build/qemu/x86_64-windows-user/qemu_guest_dll64/
endef
$(foreach mod,$(WINEDLLS),$(eval $(call WINEDLLS_RULE,$(mod))))
# Link external libraries.
define EXTDLLS_RULE
build/qemu/x86_64-windows-user/qemu_guest_dll32/$(1).dll: wine-guest32 build/qemu/x86_64-windows-user/qemu-x86_64.exe.so
cp -lf build/i686-w64-mingw32/bin/$(1).dll build/qemu/x86_64-windows-user/qemu_guest_dll32/
endef
$(foreach mod,$(EXTDLLS),$(eval $(call EXTDLLS_RULE,$(mod))))
# Resetup the apk with qemu
build/wine-host/dlls/wineandroid.drv/hangover-debug.apk: build/wine-host/.built build/qemu/x86_64-windows-user/qemu-x86_64.exe.so wine-guest wine-guest32 $(DLL_TARGET32) $(DLL_TARGET64) $(DRV_TARGET32) $(DRV_TARGET64) $(WINEDLL_TARGET32) $(WINEDLL_TARGET64) $(EXTDLL_TARGET32)
mkdir -p build/wine-host/dlls/wineandroid.drv/lib/arm64-v8a
mkdir -p build/wine-host/dlls/wineandroid.drv/assets/arm64-v8a/lib
cp -lf $(abspath build/aarch64-linux-android/lib)/lib*.so build/wine-host/dlls/wineandroid.drv/lib/arm64-v8a/
cp -lf $(abspath build/aarch64-linux-android/lib)/lib*.so build/wine-host/dlls/wineandroid.drv/assets/arm64-v8a/lib/
+$(MAKE) -C build/wine-host install
@mkdir -p build/npp
cd build/npp ; rm -rf * ; wget https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.x64.7z ; 7z x npp.7.5.6.bin.x64.7z ; rm -f npp.7.5.6.bin.x64.7z
rm -rf build/npp/themes/Bl* build/npp/themes/De* build/npp/themes/He* build/npp/themes/Mo* build/npp/themes/Pl* build/npp/themes/Ru* build/npp/themes/Vi* build/npp/themes/vi*
@mkdir -p build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c/x86
cp -rf build/npp build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c/x86/
cp -lf build/qemu/x86_64-windows-user/qemu-x86_64.exe.so build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c/x86/
cp -rf build/qemu/x86_64-windows-user/qemu_host* build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c/x86/
cp -rf build/qemu/x86_64-windows-user/qemu_guest* build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c/x86/
rm -rf $(PREFIX)/include
rm -rf build/wine-host/dlls/wineandroid.drv/assets/include
rm -f build/wine-host/dlls/wineandroid.drv/wine-debug.apk
@mkdir -p build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c
echo wineconsole.exe > build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c/winestart.cmd
echo "c:\ncd c:\\\\x86" >> build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c/winestart.cmd
echo "c:\\\\x86\\\\qemu-x86_64.exe.so c:\\\\x86\\\\npp\\\\notepad++.exe" >> build/wine-host/dlls/wineandroid.drv/assets/prefix/drive_c/winestart.cmd
+$(MAKE) -C build/wine-host/dlls/wineandroid.drv/
cp -f build/wine-host/dlls/wineandroid.drv/wine-debug.apk build/wine-host/dlls/wineandroid.drv/hangover-debug.apk
@echo "Hangover build complete."
# TODO:
#configure: OpenCL development files not found, OpenCL won't be supported.
#configure: pcap development files not found, wpcap won't be supported.
#configure: libdbus development files not found, no dynamic device support.
#configure: lib(n)curses development files not found, curses won't be supported.
#configure: libsane development files not found, scanners won't be supported.
#configure: libv4l2 development files not found.
#configure: libgphoto2 development files not found, digital cameras won't be supported.
#configure: libgphoto2_port development files not found, digital cameras won't be auto-detected.
#configure: liblcms2 development files not found, Color Management won't be supported.
#configure: gstreamer-1.0 base plugins development files not found, GStreamer won't be supported.
#configure: libudev development files not found, plug and play won't be supported.
#configure: libSDL2 development files not found, SDL2 won't be supported.
#configure: libcapi20 development files not found, ISDN won't be supported.
#configure: libcups development files not found, CUPS won't be supported.
#configure: fontconfig development files not found, fontconfig won't be supported.
#configure: libgsm development files not found, gsm 06.10 codec won't be supported.
#configure: libkrb5 development files not found, Kerberos won't be supported.
#configure: libgssapi_krb5 development files not found (or too old), no Kerberos SSP support.
#configure: libtiff development files not found, TIFF won't be supported.
#configure: libmpg123 development files not found (or too old), mp3 codec won't be supported.
#configure: libopenal development files not found (or too old), OpenAL won't be supported.
#configure: openal-soft development files not found (or too old), XAudio2 won't be supported.
#configure: libvulkan development files not found, Vulkan won't be supported.
#configure: libldap (OpenLDAP) development files not found, LDAP won't be supported.
#configure: WARNING: libxml2 development files not found (or too old), XML won't be supported.
#configure: WARNING: libxslt development files not found, xslt won't be supported.
#configure: WARNING: libgnutls development files not found, no schannel support.
#configure: WARNING: libjpeg development files not found, JPEG won't be supported.