forked from roblillack/monoberry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
168 lines (143 loc) · 6.34 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
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
TARGET=target
MONOSRC=mono
PREFIX=/usr/local
SYSTEM:=$(shell uname)
BASE:=$(shell pwd)
ARCH_ARM:=arm-unknown-nto-qnx8.0.0eabi
ARCH_X86:=i486-pc-nto-qnx8.0.0
ifeq (${SYSTEM}, Darwin)
DESTDIR=/Developer/SDKs/MonoBerry
NDK=/Applications/bbndk
else
DESTDIR=/usr/local/share/monoberry
NDK=/opt/bbndk
endif
all: cli mono libs
cli: ${TARGET}/tool/monoberry.exe
${TARGET}/tool/monoberry.sh: tooling/monoberry.sh
cp $< $@
target/tool/monoberry.exe: tooling/tool.csproj tooling/*.cs
@rm -rf tooling/bin/Release
@echo Building MonoBerry CLI tool ...
@xbuild $< /p:Configuration=Release > /dev/null
@mkdir -p target/tool
@cp tooling/bin/Release/*.exe tooling/bin/Release/*.dll tooling/monoberry.sh ${TARGET}/tool
clean:
@rm -rf tooling/bin/ target/ libblackberry/bin
@rm -f ${PREFIX}/bin/monoberry
install:
@mkdir -p ${DESTDIR}
@cp -r ${TARGET}/* ${DESTDIR}
@printf '#!/bin/sh\nmono '${DESTDIR}'/tool/monoberry.exe $$@\n' > ${PREFIX}/bin/monoberry
@chmod a+rx ${PREFIX}/bin/monoberry
libs: ${TARGET}/lib/mono/4.0/libblackberry.dll ${TARGET}/lib/mono/4.0/libappdesc.dll
${TARGET}/lib/mono/4.0/libappdesc.dll: libappdesc/libappdesc.csproj libappdesc/*.cs
@echo Building libappdesc ...
@xbuild $< /p:Configuration=Release > /dev/null
@mkdir -p ${TARGET}/lib/mono/4.0
@cp libappdesc/bin/Release/*.dll target/lib/mono/4.0
${TARGET}/lib/mono/4.0/libblackberry.dll: libblackberry/libblackberry.csproj libblackberry/*.cs
@echo Building libblackberry ...
@xbuild $< /p:Configuration=Release > /dev/null
@mkdir -p ${TARGET}/lib/mono/4.0
@cp libblackberry/bin/Release/*.dll target/lib/mono/4.0
#helloworld: helloworld/*.cs helloworld/*.xml
# @xbuild helloworld/helloworld.csproj /p:Configuration=Release
mono: ${TARGET}/lib/mono/2.0/mscorlib.dll ${TARGET}/lib/mono/4.0/mscorlib.dll ${TARGET}/target/armle-v7/bin/mono ${TARGET}/target/armle-v7/lib/libgdiplus.so.0 ${TARGET}/target/x86/bin/mono
${TARGET}/target/x86/bin/mono: ${MONOSRC}/autogen.sh
echo "SKIPPING X86 BUILD -- NO SIMULATOR SUPPORT RIGHT NOW."
#cd ${MONOSRC} && . ${NDK}/bbndk-env.sh && env LDFLAGS="-L${NDK}/target/qnx6/x86/lib -L${NDK}/target/qnx6/x86/usr/lib" ./autogen.sh --host=i486-pc-nto-qnx8.0.0 --with-xen-opt=no --with-large-heap=no --disable-mcs-build --enable-small-config=yes && make clean && make
#mkdir -p `dirname $@`
#install ${MONOSRC}/mono/mini/mono $@
libffi-arm: libffi/${ARCH_ARM}/.libs/libffi.a
libffi/${ARCH_ARM}/.libs/libffi.a: libffi/configure
cd libffi &&\
. ${NDK}/bbndk-env.sh &&\
env LDFLAGS="-L${NDK}/target/qnx6/armle-v7/lib -L${NDK}/target/qnx6/armle-v7/usr/lib" \
./configure --host=${ARCH_ARM} && make
libffi-x86: libffi/${ARCH_X86}/.libs/libffi.a
libffi/${ARCH_X86}/.libs/libffi.a: libffi/configure
cd libffi &&\
. ${NDK}/bbndk-env.sh &&\
env LDFLAGS="-L${NDK}/target/qnx6/x86/lib -L${NDK}/target/qnx6/x86/usr/lib" \
./configure --host=${ARCH_X86} && make
glib-x86: tmp/glib-x86
tmp/glib-x86: glib/autogen.sh libffi/${ARCH_X86}/.libs/libffi.a
cp glib.cache glib/config.cache
cd glib &&\
. ${NDK}/bbndk-env.sh &&\
env LDFLAGS="-lsocket"\
CFLAGS="-DSA_RESTART=0 -D_QNX_SOURCE"\
LIBFFI_CFLAGS="-I${BASE}/libffi/${ARCH_X86}/include"\
LIBFFI_LIBS="${BASE}/libffi/${ARCH_X86}/libffi.la"\
./autogen.sh --host=${ARCH_X86} --enable-static=yes --enable-shared=yes\
--cache-file=config.cache &&\
make clean &&\
cd glib &&\
make -k || test -r .libs/libglib-2.0.a
install -d $@
cp -r glib/glib/*.lo glib/glib/.libs glib/glib/pcre/*.lo glib/glib/pcre/.libs $@
glib-arm: tmp/glib-arm
tmp/glib-arm: glib/autogen.sh libffi/${ARCH_ARM}/.libs/libffi.a
cp glib.cache glib/config.cache
cd glib &&\
. ${NDK}/bbndk-env.sh &&\
env LDFLAGS="-lsocket"\
CFLAGS="-DSA_RESTART=0 -D_QNX_SOURCE"\
LIBFFI_CFLAGS="-I${BASE}/libffi/${ARCH_ARM}/include"\
LIBFFI_LIBS="${BASE}/libffi/${ARCH_ARM}/libffi.la"\
./autogen.sh --host=${ARCH_ARM} --enable-static=yes --enable-shared=yes\
--cache-file=config.cache &&\
make clean &&\
cd glib &&\
make -k || test -r .libs/libglib-2.0.a
install -d $@
cp -r glib/glib/*.lo glib/glib/.libs glib/glib/pcre/*.lo glib/glib/pcre/.libs $@
libgdiplus-arm: ${TARGET}/target/armle-v7/lib/libgdiplus.so.0
${TARGET}/target/armle-v7/lib/libgdiplus.so.0: libgdiplus/autogen.sh glib-arm
cd libgdiplus &&\
. ${NDK}/bbndk-env.sh &&\
env CFLAGS="-I$$QNX_TARGET/usr/include/freetype2 -I../cairo/src -I${BASE}/glib -I${BASE}/glib/glib"\
./autogen.sh --enable-static=no --enable-shared=yes --host=${ARCH_ARM} &&\
make clean &&\
make
cd libgdiplus/src &&\
. ${NDK}/bbndk-env.sh &&\
/bin/bash ../libtool --tag=CC --mode=link ${ARCH_ARM}-gcc\
-o libgdiplus.la -rpath /usr/local/lib *.lo -lfontconfig\
../cairo/src/libcairo.la ${BASE}/tmp/glib-arm/*.lo -lpng -ljpeg
mkdir -p `dirname $@`
install libgdiplus/src/.libs/libgdiplus.so.0 $@
libgdiplus-x86: ${TARGET}/target/x86/lib/libgdiplus.so.0
${TARGET}/target/x86/lib/libgdiplus.so.0: libgdiplus/autogen.sh glib-x86
cd libgdiplus &&\
. ${NDK}/bbndk-env.sh &&\
env CFLAGS="-I$$QNX_TARGET/usr/include/freetype2 -I../cairo/src -I${BASE}/glib -I${BASE}/glib/glib"\
./autogen.sh --enable-static=no --enable-shared=yes --host=${ARCH_X86} &&\
make clean &&\
make
cd libgdiplus/src &&\
. ${NDK}/bbndk-env.sh &&\
/bin/bash ../libtool --tag=CC --mode=link ${ARCH_X86}-gcc\
-o libgdiplus.la -rpath /usr/local/lib *.lo -lfontconfig\
../cairo/src/libcairo.la ${BASE}/tmp/glib-x86/*.lo -lpng -ljpeg
mkdir -p `dirname $@`
install libgdiplus/src/.libs/libgdiplus.so.0 $@
${TARGET}/target/armle-v7/bin/mono: ${MONOSRC}/autogen.sh
cd ${MONOSRC} && . ${NDK}/bbndk-env.sh && env LDFLAGS="-L${NDK}/target/qnx6/armle-v7/lib -L${NDK}/target/qnx6/armle-v7/usr/lib" ./autogen.sh --host=${ARCH_ARM} --with-xen-opt=no --with-large-heap=no --disable-mcs-build --enable-small-config=yes && make clean && make
mkdir -p `dirname $@`
install ${MONOSRC}/mono/mini/mono $@
${TARGET}/lib/mono/2.0/mscorlib.dll: ${MONOSRC}/autogen.sh
cd ${MONOSRC} && ./autogen.sh && make
mkdir -p `dirname $@`
install ${MONOSRC}/mcs/class/lib/net_2_0/mscorlib.dll $@
${TARGET}/lib/mono/4.0/mscorlib.dll: ${TARGET}/lib/mono/2.0/mscorlib.dll
mkdir -p `dirname $@`
install ${MONOSRC}/mcs/class/lib/net_4_0/mscorlib.dll $@
${MONOSRC}/autogen.sh: submodules
glib/autogen.sh: submodules
libffi/configure: submodules
libgdiplus/autogen.sh: submodules
submodules: .gitmodules
git submodule update --init --recursive
.PHONY: clean all install glib-arm glib-x86 libgdiplus-arm libgdiplus-x86