summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/buildzip.pl91
-rwxr-xr-xtools/configure16
2 files changed, 67 insertions, 40 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index 353318770e..016e151c8e 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -10,14 +10,13 @@
10 10
11$ROOT=".."; 11$ROOT="..";
12 12
13
14
15my $ziptool="zip"; 13my $ziptool="zip";
16my $output="rockbox.zip"; 14my $output="rockbox.zip";
17my $verbose; 15my $verbose;
18my $exe; 16my $exe;
19my $target; 17my $target;
20my $archos; 18my $archos;
19my $incfonts;
21 20
22while(1) { 21while(1) {
23 if($ARGV[0] eq "-r") { 22 if($ARGV[0] eq "-r") {
@@ -43,6 +42,11 @@ while(1) {
43 shift @ARGV; 42 shift @ARGV;
44 shift @ARGV; 43 shift @ARGV;
45 } 44 }
45 elsif($ARGV[0] eq "-f") {
46 $incfonts=$ARGV[1]; # 0 - no fonts, 1 - fonts only 2 - fonts and package
47 shift @ARGV;
48 shift @ARGV;
49 }
46 50
47 elsif($ARGV[0] eq "-v") { 51 elsif($ARGV[0] eq "-v") {
48 $verbose =1; 52 $verbose =1;
@@ -85,12 +89,37 @@ sub buildlangs {
85} 89}
86 90
87sub buildzip { 91sub buildzip {
88 my ($zip, $image, $notplayer)=@_; 92 my ($zip, $image, $notplayer, $fonts)=@_;
89 93
90 # remove old traces 94 # remove old traces
91 `rm -rf .rockbox`; 95 `rm -rf .rockbox`;
92 96
93 mkdir ".rockbox", 0777; 97 mkdir ".rockbox", 0777;
98
99 if($fonts) {
100 mkdir ".rockbox/fonts", 0777;
101
102 opendir(DIR, "$ROOT/fonts") || die "can't open dir fonts";
103 my @fonts = grep { /\.bdf$/ && -f "$ROOT/fonts/$_" } readdir(DIR);
104 closedir DIR;
105
106 for(@fonts) {
107 my $f = $_;
108
109 print "FONT: $f\n" if($verbose);
110 my $o = $f;
111 $o =~ s/\.bdf/\.fnt/;
112 my $cmd ="$ROOT/tools/convbdf -f -o \".rockbox/fonts/$o\" \"$ROOT/fonts/$f\" >/dev/null 2>&1";
113 print "CMD: $cmd\n" if($verbose);
114 `$cmd`;
115
116 }
117 if($fonts < 2) {
118 # fonts-only package, return
119 return;
120 }
121 }
122
94 mkdir ".rockbox/langs", 0777; 123 mkdir ".rockbox/langs", 0777;
95 mkdir ".rockbox/rocks", 0777; 124 mkdir ".rockbox/rocks", 0777;
96 if($notplayer) { 125 if($notplayer) {
@@ -175,25 +204,6 @@ sub buildzip {
175 if($notplayer) { 204 if($notplayer) {
176 `cp $ROOT/apps/plugins/sokoban.levels .rockbox/rocks/`; # sokoban levels 205 `cp $ROOT/apps/plugins/sokoban.levels .rockbox/rocks/`; # sokoban levels
177 `cp $ROOT/apps/plugins/snake2.levels .rockbox/rocks/`; # snake2 levels 206 `cp $ROOT/apps/plugins/snake2.levels .rockbox/rocks/`; # snake2 levels
178
179 mkdir ".rockbox/fonts", 0777;
180
181 opendir(DIR, "$ROOT/fonts") || die "can't open dir fonts";
182 my @fonts = grep { /\.bdf$/ && -f "$ROOT/fonts/$_" } readdir(DIR);
183 closedir DIR;
184
185 for(@fonts) {
186 my $f = $_;
187
188 print "FONT: $f\n" if($verbose);
189 my $o = $f;
190 $o =~ s/\.bdf/\.fnt/;
191 my $cmd ="$ROOT/tools/convbdf -f -o \".rockbox/fonts/$o\" \"$ROOT/fonts/$f\" >/dev/null 2>&1";
192 print "CMD: $cmd\n" if($verbose);
193 `$cmd`;
194
195 }
196
197 } 207 }
198 208
199 if($image) { 209 if($image) {
@@ -231,15 +241,6 @@ sub buildzip {
231 241
232 buildlangs(".rockbox/langs"); 242 buildlangs(".rockbox/langs");
233 243
234 `rm -f $zip`;
235 `find .rockbox | xargs $ziptool $zip >/dev/null`;
236
237 if($image) {
238 `$ziptool $zip $image`;
239 }
240
241 # remove the .rockbox afterwards
242 `rm -rf .rockbox`;
243} 244}
244 245
245my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 246my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
@@ -253,11 +254,29 @@ $shortdate=sprintf("%02d%02d%02d", $year%100,$mon, $mday);
253 254
254# made once for all targets 255# made once for all targets
255sub runone { 256sub runone {
256 my ($type, $target)=@_; 257 my ($type, $target, $fonts)=@_;
257 258
258 # build a full install zip file 259 # build a full install .rockbox directory
259 buildzip($output, $target, 260 buildzip($output, $target,
260 ($type eq "player")?0:1); 261 ($type eq "player")?0:1, $fonts);
262
263 # create a zip file from the .rockbox dfir
264
265 `rm -f $output`;
266 if($verbose) {
267 print "find .rockbox | xargs $ziptool $output >/dev/null\n";
268 }
269 `find .rockbox | xargs $ziptool $output >/dev/null`;
270
271 if($target && ($fonts > 1)) {
272 if($verbose) {
273 print "$ziptool $output $target\n";
274 }
275 `$ziptool $output $target`;
276 }
277
278 # remove the .rockbox afterwards
279 `rm -rf .rockbox`;
261}; 280};
262 281
263if(!$exe) { 282if(!$exe) {
@@ -281,9 +300,9 @@ elsif($exe =~ /rockboxui/) {
281} 300}
282 301
283if($target =~ /player/i) { 302if($target =~ /player/i) {
284 runone("player", $exe); 303 runone("player", $exe, 0);
285} 304}
286else { 305else {
287 runone("recorder", $exe); 306 runone("recorder", $exe, $incfonts);
288} 307}
289 308
diff --git a/tools/configure b/tools/configure
index 6779139deb..557ceff4e8 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1277,9 +1277,15 @@ tags:
1277 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags 1277 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins tags
1278 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags 1278 \$(SILENT)\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
1279 1279
1280fontzip:
1281 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 1 -o rockbox-fonts.zip \$(TARGET) \$(BINARY)
1282
1280zip: 1283zip:
1281 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY) 1284 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1282 1285
1286fullzip:
1287 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -r "\$(ROOTDIR)" -f 2 -o rockbox-full.zip \$(TARGET) \$(BINARY)
1288
12837zip: 12897zip:
1284 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY) 1290 \$(SILENT)\$(TOOLSDIR)/buildzip.pl \$(VERBOSEOPT) -t \"\$(ARCHOS)\" -o "rockbox.7z" -z "7za a" -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
1285 1291
@@ -1303,10 +1309,12 @@ help:
1303 @echo "clean - cleans a build directory (not tools)" 1309 @echo "clean - cleans a build directory (not tools)"
1304 @echo "veryclean - cleans the build and tools directories" 1310 @echo "veryclean - cleans the build and tools directories"
1305 @echo "manual - builds a manual" 1311 @echo "manual - builds a manual"
1306 @echo "zip - creates a rockbox.zip of your build" 1312 @echo "fullzip - creates a rockbox.zip of your build with fonts"
1307 @echo "gzip - creates a rockbox.tar.gz of your build" 1313 @echo "zip - creates a rockbox.zip of your build (no fonts)"
1308 @echo "bzip2 - creates a rockbox.tar.bz2 of your build" 1314 @echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
1309 @echo "7zip - creates a rockbox.7z of your build" 1315 @echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
1316 @echo "7zip - creates a rockbox.7z of your build (no fonts)"
1317 @echo "fontzip - creates rockbox-fonts.zip"
1310 @echo "tools - builds the tools only" 1318 @echo "tools - builds the tools only"
1311 @echo "install - installs your build (for simulator builds only)" 1319 @echo "install - installs your build (for simulator builds only)"
1312 1320