-
Notifications
You must be signed in to change notification settings - Fork 151
/
Makefile
159 lines (134 loc) · 6.52 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
export SHELL = sh
PACKAGE = wubi
ICON = data/images/Wubi.ico
VERSION = $(shell head -n 1 debian/changelog | sed -e "s/^$(PACKAGE) (\(.*\)).*/\1/g" | cut -d r -f 1)
REVISION = $(shell head -n 1 debian/changelog | sed -e "s/^$(PACKAGE) (\(.*\)).*/\1/g" | cut -d r -f 2)
COPYRIGHTYEAR = 2009
AUTHOR = Agostino Russo
EMAIL = [email protected]
all: build check
build: wubi
wubi: wubi-pre-build
PYTHONPATH=src tools/pywine -OO src/pypack/pypack --verbose --bytecompile --outputdir=build/wubi src/main.py data build/bin build/version.py build/winboot build/translations
PYTHONPATH=src tools/pywine -OO build/pylauncher/pack.py build/wubi
mv build/application.exe build/wubi.exe
wubizip: wubi-pre-build
PYTHONPATH=src tools/pywine src/pypack/pypack --verbose --outputdir=build/wubi src/main.py data build/bin build/version.py build/winboot build/translations
cp wine/drive_c/Python27/python.exe build/wubi #TBD
cd build; zip -r wubi.zip wubi
wubi-pre-build: check_wine check_winboot pylauncher winboot2 src/main.py src/wubi/*.py cpuid version.py translations
rm -rf build/wubi
rm -rf build/bin
cp -a blobs build/bin
cp wine/drive_c/Python27/python27.dll build/pylauncher #TBD
cp build/cpuid/cpuid.dll build/bin
pot:
xgettext --default-domain="$(PACKAGE)" --output="po/$(PACKAGE).pot" $(shell find src/wubi -name "*.py" | sort)
sed -i 's/SOME DESCRIPTIVE TITLE/Translation template for $(PACKAGE)/' po/$(PACKAGE).pot
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/$(COPYRIGHTYEAR)/" po/$(PACKAGE).pot
sed -i 's/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR/$(AUTHOR) <$(EMAIL)>, $(COPYRIGHTYEAR)/' po/$(PACKAGE).pot
sed -i 's/Report-Msgid-Bugs-To: /Report-Msgid-Bugs-To: $(EMAIL)/' po/$(PACKAGE).pot
sed -i 's/CHARSET/UTF-8/' po/$(PACKAGE).pot
sed -i 's/PACKAGE VERSION/$(VERSION)-r$(REVISION)/' po/$(PACKAGE).pot
sed -i 's/PACKAGE/$(PACKAGE)/' po/$(PACKAGE).pot
update-po: pot
for i in po/*.po ;\
do \
mv $$i $${i}.old ; \
(msgmerge $${i}.old po/wubi.pot | msgattrib --no-obsolete > $$i) ; \
rm $${i}.old ; \
done
translations: po/*.po
mkdir -p build/translations/
@for po in $^; do \
language=`basename $$po`; \
language=$${language%%.po}; \
target="build/translations/$$language/LC_MESSAGES"; \
mkdir -p $$target; \
msgfmt --output=$$target/$(PACKAGE).mo $$po; \
done
version.py:
$(shell echo 'version = "$(VERSION)"' > build/version.py)
$(shell echo 'revision = $(REVISION)' >> build/version.py)
$(shell echo 'application_name = "$(PACKAGE)"' >> build/version.py)
pylauncher: 7z src/pylauncher/*
cp -rf src/pylauncher build
cp "$(ICON)" build/pylauncher/application.ico
sed -i 's/application_name/$(PACKAGE)/' build/pylauncher/pylauncher.exe.manifest
cd build/pylauncher; make
cpuid: src/cpuid/cpuid.c
cp -rf src/cpuid build
cd build/cpuid; make
winboot2:
mkdir -p build/winboot
cp -f data/wubildr.cfg data/wubildr-bootstrap.cfg build/winboot/
/usr/lib/grub/i386-pc/grub-ntldr-img --grub2 --boot-file=wubildr -o build/winboot/wubildr.mbr
cd build/winboot && tar cf wubildr.tar wubildr.cfg
mkdir -p build/grubutil
grub-mkimage -O i386-pc -c build/winboot/wubildr-bootstrap.cfg -m build/winboot/wubildr.tar -o build/grubutil/core.img \
loadenv biosdisk part_msdos part_gpt fat ntfs ext2 ntfscomp iso9660 loopback search linux boot minicmd cat cpuid chain halt help ls reboot \
echo test configfile gzio normal sleep memdisk tar font gfxterm gettext true vbe vga video_bochs video_cirrus probe
cat /usr/lib/grub/i386-pc/lnxboot.img build/grubutil/core.img > build/winboot/wubildr
mkdir -p build/winboot/EFI
grub-mkimage -O x86_64-efi -c build/winboot/wubildr-bootstrap.cfg -m build/winboot/wubildr.tar -o build/winboot/EFI/grubx64.efi \
loadenv part_msdos part_gpt fat ntfs ext2 ntfscomp iso9660 loopback search linux linuxefi boot minicmd cat cpuid chain halt help ls reboot \
echo test configfile gzio normal sleep memdisk tar font gfxterm gettext true efi_gop efi_uga video_bochs video_cirrus probe efifwsetup \
all_video gfxterm_background png gfxmenu
cp /usr/lib/shim/shim.efi.signed build/winboot/EFI/shimx64.efi 2>/dev/null || \
cp shim/shimx64.efi.signed build/winboot/EFI/shimx64.efi 2>/dev/null || \
cp /usr/lib/shim/shimx64.efi.signed build/winboot/EFI/shimx64.efi
cp /usr/lib/shim/MokManager.efi.signed build/winboot/EFI/MokManager.efi 2>/dev/null || \
cp shim/mmx64.efi build/winboot/EFI/mmx64.efi 2>/dev/null || \
cp /usr/lib/shim/mmx64.efi build/winboot/EFI/mmx64.efi
sbsign --key .key/*.key --cert .key/*.crt --output build/winboot/EFI/grubx64.efi build/winboot/EFI/grubx64.efi
grub-mkimage -O i386-efi -c build/winboot/wubildr-bootstrap.cfg -m build/winboot/wubildr.tar -o build/winboot/EFI/grubia32.efi \
loadenv part_msdos part_gpt fat ntfs ext2 ntfscomp iso9660 loopback search linux linuxefi boot minicmd cat cpuid chain halt help ls reboot \
echo test configfile gzio normal sleep memdisk tar font gfxterm gettext true efi_gop efi_uga video_bochs video_cirrus probe efifwsetup \
all_video gfxterm_background png gfxmenu
sbsign --key .key/*.key --cert .key/*.crt --output build/winboot/EFI/grubia32.efi build/winboot/EFI/grubia32.efi
cp .key/*.cer build/winboot/EFI/.
winboot: grub4dos grubutil
mkdir -p build/winboot
cp -f data/menu.winboot build/winboot/menu.lst
cp -f build/grub4dos/stage2/grldr build/winboot/wubildr
cp -f build/grub4dos/stage2/grub.exe build/winboot/wubildr.exe
dd if=build/winboot/wubildr of=build/winboot/wubildr.mbr bs=1 count=8192
cd build/winboot; ../grubutil/grubinst/grubinst -o -b=wubildr wubildr.mbr
grub4dos: src/grub4dos/*
cp -rf src/grub4dos build
cd build/grub4dos;./configure --enable-preset-menu=../../data/menu.winboot
cd build/grub4dos; make
grubutil: src/grubutil/grubinst/*
cp -rf src/grubutil build
cd build/grubutil/grubinst; make
# not compiling 7z at the moment, but source is used by pylauncher
7z: src/7z/C/*.c
mkdir -p build/7z
cp -rf src/7z build
runbin: wubi
rm -rf build/test
mkdir build/test
cd build/test; ../../tools/wine ../wubi.exe --test
check_wine: tools/check_wine
tools/check_wine
check_winboot: tools/check_winboot
tools/check_winboot
unittest:
tools/pywine tools/test
check: wubi
tests/run
runpy:
PYTHONPATH=src tools/pywine src/main.py --test
clean:
rm -rf dist/*
rm -rf build/*
distclean: clean
rm -rf wine
rm -rf tools/buildtest/*
find . -type f -name "*.pyo" -delete
find . -type f -name "*.pyc" -delete
rm -rf .key
rm -rf data/custom-installation/packages
rm -rf shim
.PHONY: all build test wubi wubizip wubi-pre-build pot runpy runbin check_wine check_winboot unittest
7z translations version.py pylauncher winboot winboot2 grubutil grub4dos clean distclean