-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
159 lines (138 loc) · 5.13 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
CLUTTER_MAJOR_VERSION = 1.7
CLUTTER_VERSION = 1.7.14
COGL_MAJOR_VERSION = 1.7
COGL_VERSION = 1.7.8
MX_MAJOR_VERSION = 1.3
MX_VERSION = 1.3.1
PACKAGE_VERSION = $(CLUTTER_VERSION).1
CC = i686-pc-mingw32-gcc
CLUTTER_GIT_PATCH = http://git.gnome.org/browse/clutter/patch/?id=
COGL_GIT_PATCH = http://git.gnome.org/browse/cogl/patch/?id=
BUILD_TYPE = `uname -m`-unknown-linux-gnu
CFLAGS = "-O2 -mms-bitfields -I$(PWD)/deps-install/include"
LIB = WINEPREFIX="$(PWD)" wine lib.exe
CANDLE = WINEDLLOVERRIDES="msi=n" WINEPREFIX="$(PWD)" wine candle.exe
LIGHT = WINEDLLOVERRIDES="msi=n" WINEPREFIX="$(PWD)" wine light.exe
WIXOBJS = clutter.wixobj
all : clutter-$(PACKAGE_VERSION).msi
downloads/clutter-$(CLUTTER_VERSION).tar.bz2 :
mkdir -p downloads
wget -O $@ http://source.clutter-project.org/sources/clutter/$(CLUTTER_MAJOR_VERSION)/clutter-$(CLUTTER_VERSION).tar.bz2
downloads/mx-$(MX_VERSION).tar.bz2 :
mkdir -p downloads
wget -O $@ http://source.clutter-project.org/sources/mx/$(MX_MAJOR_VERSION)/mx-$(MX_VERSION).tar.bz2
downloads/cogl-$(COGL_VERSION).tar.bz2 :
mkdir -p downloads
wget -O $@ http://source.clutter-project.org/sources/cogl/$(COGL_MAJOR_VERSION)/cogl-$(COGL_VERSION).tar.bz2
clutter-source-stamp : downloads/clutter-$(CLUTTER_VERSION).tar.bz2
tar -jxf $<
if test "$(CLUTTER_VERSION)" = "1.7.14"; then \
( cd clutter-$(CLUTTER_VERSION) && wget -q -O - \
"$(CLUTTER_GIT_PATCH)c5cf8c5" \
| patch -p1 ); \
fi
touch $@
cogl-source-stamp : downloads/cogl-$(COGL_VERSION).tar.bz2
tar -jxf $<
touch $@
mx-source-stamp : downloads/mx-$(MX_VERSION).tar.bz2
tar -jxf $<
touch $@
deps-install-stamp : clutter-source-stamp
DOWNLOAD_PROG=$(PWD)/download-wrapper.sh \
ROOT_DIR=$(PWD)/deps-install \
DOWNLOAD_DIR=$(PWD)/downloads \
BUILD_DIR=$(PWD)/deps-build \
clutter-$(CLUTTER_VERSION)/build/mingw/mingw-fetch-dependencies.sh
$(LIB) /machine:i386 \
/def:$(PWD)/deps-build/json-glib-0.12.2/json-glib/.libs/libjson-glib-1.0-0.dll.def \
/out:$(PWD)/deps-install/lib/json-glib-1.0.lib \
/name:libjson-glib-1.0-0.dll
touch $@
cogl-install-stamp : cogl-source-stamp clutter-source-stamp deps-install-stamp
cd cogl-$(COGL_VERSION) && \
./configure --host="i686-pc-mingw32" \
--target="i686-pc-mingw32" \
--build="$(BUILD_TYPE)" \
--disable-glx \
--enable-wgl \
--prefix="$(PWD)/cogl-install" \
CFLAGS=$(CFLAGS) \
PKG_CONFIG="$(PWD)/deps-build/run-pkg-config.sh"
make -C cogl-$(COGL_VERSION) all install
$(LIB) /machine:i386 \
/def:cogl-$(COGL_VERSION)/cogl/.libs/libcogl-2.dll.def \
/out:$(PWD)/cogl-install/lib/cogl.lib \
/name:libcogl-2.dll
$(LIB) /machine:i386 \
/def:cogl-$(COGL_VERSION)/cogl-pango/.libs/libcogl-pango-0.dll.def \
/out:$(PWD)/cogl-install/lib/cogl-pango.lib \
/name:libcogl-pango-0.dll
touch $@
clutter-install-stamp : clutter-source-stamp deps-install-stamp cogl-install-stamp
cd clutter-$(CLUTTER_VERSION) && \
./configure --host="i686-pc-mingw32" \
--target="i686-pc-mingw32" \
--build="$(BUILD_TYPE)" \
--with-flavour=win32 \
--prefix="$(PWD)/clutter-install" \
CFLAGS=$(CFLAGS) \
PKG_CONFIG="$(PWD)/deps-build/run-pkg-config.sh" \
PKG_CONFIG_PATH="$(PWD)/cogl-install/lib/pkgconfig"
make -C clutter-$(CLUTTER_VERSION) all install
$(LIB) /machine:i386 \
/def:clutter-$(CLUTTER_VERSION)/clutter/.libs/libclutter-win32-1.0-0.dll.def \
/out:$(PWD)/clutter-install/lib/clutter-win32-1.0.lib \
/name:libclutter-win32-1.0-0.dll
touch $@
mx-install-stamp : mx-source-stamp clutter-install-stamp
cd mx-$(MX_VERSION) && \
gnome-autogen.sh --host="i686-pc-mingw32" \
--target="i686-pc-mingw32" \
--build="$(BUILD_TYPE)" \
--disable-gtk-widgets \
--with-winsys=none \
--prefix="$(PWD)/mx-install" \
CFLAGS=$(CFLAGS) \
PKG_CONFIG="$(PWD)/deps-build/run-pkg-config.sh" \
PKG_CONFIG_PATH="$(PWD)/cogl-install/lib/pkgconfig:$(PWD)/clutter-install/lib/pkgconfig"
make -C mx-$(MX_VERSION) all install
$(LIB) /machine:i386 \
/def:mx-$(MX_VERSION)/mx/.libs/libmx-1.0-2.dll.def \
/out:$(PWD)/mx-install/lib/mx-1.0.lib \
/name:libmx-1.0-2.dll
touch $@
fixprefix.exe : fixprefix.c
$(CC) -Wall -O2 -o $@ $<
clutter.wxs : generate-msi.pl deps-install-stamp cogl-install-stamp clutter-install-stamp mx-install-stamp clutter.wxs.in
perl generate-msi.pl \
--packageversion="$(PACKAGE_VERSION)" \
"Clutter dependencies:deps-install" \
"Cogl:cogl-install" \
"Clutter:clutter-install" \
"Mx:mx-install" \
> $@
%.wixobj : %.wxs
$(CANDLE) $<
clutter-$(PACKAGE_VERSION).msi : $(WIXOBJS) fixprefix.exe
rm -rf cab-cache
mkdir -p cab-cache
$(LIGHT) -cc cab-cache -out $@ $(WIXOBJS)
@cabextract -p -F TestFileA 'cab-cache/#clutter.cab' > test-result-a
@cabextract -p -F TestFileB 'cab-cache/#clutter.cab' > test-result-b
@if cmp -s test-result-{a,b}; then \
echo; \
echo "***ERROR***"; \
echo; \
echo "You have hit a bug where light.exe is combining files that "; \
echo "have the same size. The resulting .msi will not work. If "; \
echo "you are using WiX 3.5 under Wine you may want to try "; \
echo "3.0 instead."; \
echo; \
rm -f "$@"; \
exit 1; \
fi
clean :
rm -rf *.msi *.wixobj clutter.wxs \
{deps,cogl,clutter,mx}-{source,install}{-stamp,}
.PHONY : all clean