summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/buildzip.pl41
-rwxr-xr-xtools/configure4
2 files changed, 27 insertions, 18 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index 8fd0e6592d..4db1f5e4bb 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -1,5 +1,20 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3$ROOT="..";
4
5if($ARGV[0] eq "-r") {
6 $ROOT=$ARGV[1];
7 shift @ARGV;
8 shift @ARGV;
9}
10
11my $verbose;
12if($ARGV[0] eq "-v") {
13 $verbose =1;
14 shift @ARGV;
15}
16
17
3sub filesize { 18sub filesize {
4 my ($filename)=@_; 19 my ($filename)=@_;
5 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, 20 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
@@ -10,7 +25,7 @@ sub filesize {
10 25
11sub buildlangs { 26sub buildlangs {
12 my ($outputlang)=@_; 27 my ($outputlang)=@_;
13 my $dir = "../apps/lang"; 28 my $dir = "$ROOT/apps/lang";
14 opendir(DIR, $dir); 29 opendir(DIR, $dir);
15 my @files = grep { /\.lang$/ } readdir(DIR); 30 my @files = grep { /\.lang$/ } readdir(DIR);
16 closedir(DIR); 31 closedir(DIR);
@@ -19,7 +34,7 @@ sub buildlangs {
19 my $output = $_; 34 my $output = $_;
20 $output =~ s/(.*)\.lang/$1.lng/; 35 $output =~ s/(.*)\.lang/$1.lng/;
21 print "lang $_\n" if($verbose); 36 print "lang $_\n" if($verbose);
22 system ("../tools/binlang $dir/english.lang $dir/$_ $outputlang/$output >/dev/null 2>&1"); 37 system ("$ROOT/tools/binlang $dir/english.lang $dir/$_ $outputlang/$output >/dev/null 2>&1");
23 } 38 }
24} 39}
25 40
@@ -34,7 +49,7 @@ sub buildzip {
34 mkdir ".rockbox/rocks", 0777; 49 mkdir ".rockbox/rocks", 0777;
35 `find . -name "*.rock" ! -empty | xargs --replace=foo cp foo .rockbox/rocks/`; 50 `find . -name "*.rock" ! -empty | xargs --replace=foo cp foo .rockbox/rocks/`;
36 51
37 open VIEWERS, "../apps/plugins/viewers.config" or 52 open VIEWERS, "$ROOT/apps/plugins/viewers.config" or
38 die "can't open viewers.config"; 53 die "can't open viewers.config";
39 @viewers = <VIEWERS>; 54 @viewers = <VIEWERS>;
40 close VIEWERS; 55 close VIEWERS;
@@ -53,17 +68,17 @@ sub buildzip {
53 close VIEWERS; 68 close VIEWERS;
54 69
55 if($notplayer) { 70 if($notplayer) {
56 `cp ../apps/plugins/sokoban.levels .rockbox/`; # sokoban levels 71 `cp $ROOT/apps/plugins/sokoban.levels .rockbox/`; # sokoban levels
57 `cp ../apps/plugins/snake2.levels .rockbox/`; # snake2 levels 72 `cp $ROOT/apps/plugins/snake2.levels .rockbox/`; # snake2 levels
58 73
59 mkdir ".rockbox/fonts", 0777; 74 mkdir ".rockbox/fonts", 0777;
60 75
61 opendir(DIR, "../fonts") || die "can't open dir fonts"; 76 opendir(DIR, "$ROOT/fonts") || die "can't open dir fonts";
62 my @fonts = grep { /\.bdf$/ && -f "../fonts/$_" } readdir(DIR); 77 my @fonts = grep { /\.bdf$/ && -f "$ROOT/fonts/$_" } readdir(DIR);
63 closedir DIR; 78 closedir DIR;
64 79
65 my $maxfont; 80 my $maxfont;
66 open(HEADER, "<../firmware/export/font.h"); 81 open(HEADER, "<$ROOT/firmware/export/font.h");
67 while(<HEADER>) { 82 while(<HEADER>) {
68 if(/^\#define MAX_FONT_SIZE[ \t]*(\d+)/) { 83 if(/^\#define MAX_FONT_SIZE[ \t]*(\d+)/) {
69 $maxfont = $1; 84 $maxfont = $1;
@@ -78,7 +93,7 @@ sub buildzip {
78 print "FONT: $f\n" if($verbose); 93 print "FONT: $f\n" if($verbose);
79 my $o = $f; 94 my $o = $f;
80 $o =~ s/\.bdf/\.fnt/; 95 $o =~ s/\.bdf/\.fnt/;
81 my $cmd ="../tools/convbdf -s 32 -l 255 -f -o \".rockbox/fonts/$o\" \"../fonts/$f\" >/dev/null 2>&1"; 96 my $cmd ="$ROOT/tools/convbdf -s 32 -l 255 -f -o \".rockbox/fonts/$o\" \"$ROOT/fonts/$f\" >/dev/null 2>&1";
82 print "CMD: $cmd\n" if($verbose); 97 print "CMD: $cmd\n" if($verbose);
83 `$cmd`; 98 `$cmd`;
84 99
@@ -102,7 +117,7 @@ sub buildzip {
102 "FAQ", 117 "FAQ",
103 "NODO", 118 "NODO",
104 "TECH")) { 119 "TECH")) {
105 `cp ../docs/$_ .rockbox/docs/$_.txt`; 120 `cp $ROOT/docs/$_ .rockbox/docs/$_.txt`;
106 } 121 }
107 122
108 # now copy the file made for reading on the unit: 123 # now copy the file made for reading on the unit:
@@ -134,12 +149,6 @@ $year+=1900;
134$date=sprintf("%04d%02d%02d", $year,$mon, $mday); 149$date=sprintf("%04d%02d%02d", $year,$mon, $mday);
135$shortdate=sprintf("%02d%02d%02d", $year%100,$mon, $mday); 150$shortdate=sprintf("%02d%02d%02d", $year%100,$mon, $mday);
136 151
137my $verbose;
138if($ARGV[0] eq "-v") {
139 $verbose =1;
140 shift @ARGV;
141}
142
143# made once for all targets 152# made once for all targets
144sub runone { 153sub runone {
145 my ($type, $target)=@_; 154 my ($type, $target)=@_;
diff --git a/tools/configure b/tools/configure
index ea88c782b6..0a8b96dc75 100755
--- a/tools/configure
+++ b/tools/configure
@@ -86,7 +86,7 @@ tags:
86 make -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) tags 86 make -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) tags
87 87
88zip: 88zip:
89 \$(TOOLSDIR)/buildzip.pl sim\$(TARGET) 89 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" sim\$(TARGET)
90 90
91install: 91install:
92 @echo "installing a full setup in your archos dir" 92 @echo "installing a full setup in your archos dir"
@@ -423,7 +423,7 @@ tags:
423 \$(MAKE) tags-firmware tags-apps 423 \$(MAKE) tags-firmware tags-apps
424 424
425zip: 425zip:
426 \$(TOOLSDIR)/buildzip.pl \$(TARGET) 426 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET)
427EOF 427EOF
428 428
429echo "Created Makefile" 429echo "Created Makefile"