Added the symlinkinstall make target. See #11825

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28915 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Stummvoll 2010-12-28 10:30:46 +00:00
parent 3c43503283
commit 1f06ca41e8
2 changed files with 50 additions and 30 deletions

View File

@ -13,6 +13,7 @@ use strict;
use File::Copy; # For move() and copy()
use File::Find; # For find()
use File::Path qw(mkpath rmtree); # For rmtree()
use Cwd;
use Cwd 'abs_path';
use Getopt::Long qw(:config pass_through); # pass_through so not confused by -DTYPE_STUFF
@ -29,6 +30,7 @@ my $incfonts;
my $target_id; # passed in, not currently used
my $rbdir; # can be non-.rockbox for special builds
my $app;
my $mklinks;
sub glob_mkdir {
my ($dir) = @_;
@ -81,10 +83,16 @@ sub find_copyfile {
print "find_copyfile: $pattern -> $destination\n" if $verbose;
return sub {
my $path = $_;
my $source = getcwd();
if ($path =~ $pattern && filesize($path) > 0 && !($path =~ /$rbdir/)) {
copy($path, $destination);
print "cp $path $destination\n" if $verbose;
chmod(0755, $destination.'/'.$path);
if($mklinks) {
print "link $path $destination\n" if $verbose;
symlink($source.'/'.$path, $destination.'/'.$path);
} else {
print "cp $path $destination\n" if $verbose;
copy($path, $destination);
chmod(0755, $destination.'/'.$path);
}
}
}
}
@ -205,6 +213,7 @@ GetOptions ( 'r|root=s' => \$ROOT,
'v|verbose' => \$verbose,
'install=s' => \$install, # install destination
'rbdir:s' => \$rbdir, # If we want to put in a different directory
'l|link' => \$mklinks, # If we want to create links instead of copying files
);
# GetOptions() doesn't remove the params from @ARGV if their value was ""
@ -695,9 +704,15 @@ sub runone {
}
if($install) {
make_install(".rockbox", $install) or die "MKDIRFAILED\n";
rmtree(".rockbox");
print "rm .rockbox\n" if $verbose;
if($mklinks) {
my $cwd = getcwd();
symlink("$cwd/.rockbox", "$install/.rockbox");
print "link .rockbox $install\n" if $verbose;
} else {
make_install(".rockbox", $install) or die "MKDIRFAILED\n";
rmtree(".rockbox");
print "rm .rockbox\n" if $verbose;
}
}
else {
unless (".rockbox" eq $rbdir) {

View File

@ -307,33 +307,38 @@ fullinstall:
@echo "Installing a full setup in your '$(RBPREFIX)' dir"
$(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 2 $(TARGET) $(BINARY)
symlinkinstall:
@echo "Installing a full setup with links in your '$(RBPREFIX)' dir"
$(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 2 $(TARGET) $(BINARY) -l
help:
@echo "A few helpful make targets"
@echo ""
@echo "all - builds a full Rockbox (default), including tools"
@echo "bin - builds only the Rockbox.<target name> file"
@echo "rocks - builds only plugins"
@echo "codecs - builds only codecs"
@echo "dep - regenerates make dependency database"
@echo "clean - cleans a build directory (not tools)"
@echo "veryclean - cleans the build and tools directories"
@echo "manual - builds a manual (pdf)"
@echo "manual-html - HTML manual"
@echo "manual-zip - HTML manual (zipped)"
@echo "manual-txt - txt manual"
@echo "fullzip - creates a rockbox.zip of your build with fonts"
@echo "zip - creates a rockbox.zip of your build (no fonts)"
@echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
@echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
@echo "7zip - creates a rockbox.7z of your build (no fonts)"
@echo "fontzip - creates rockbox-fonts.zip"
@echo "mapzip - creates rockbox-maps.zip with all .map files"
@echo "tools - builds the tools only"
@echo "voice - creates the voice clips (voice builds only)"
@echo "voicetools - builds the voice tools only"
@echo "install - installs your build (at PREFIX, defaults to simdisk/ for simulators (no fonts))"
@echo "fullinstall - installs your build (like install, but with fonts)"
@echo "reconf - rerun configure with the same selection"
@echo "all - builds a full Rockbox (default), including tools"
@echo "bin - builds only the Rockbox.<target name> file"
@echo "rocks - builds only plugins"
@echo "codecs - builds only codecs"
@echo "dep - regenerates make dependency database"
@echo "clean - cleans a build directory (not tools)"
@echo "veryclean - cleans the build and tools directories"
@echo "manual - builds a manual (pdf)"
@echo "manual-html - HTML manual"
@echo "manual-zip - HTML manual (zipped)"
@echo "manual-txt - txt manual"
@echo "fullzip - creates a rockbox.zip of your build with fonts"
@echo "zip - creates a rockbox.zip of your build (no fonts)"
@echo "gzip - creates a rockbox.tar.gz of your build (no fonts)"
@echo "bzip2 - creates a rockbox.tar.bz2 of your build (no fonts)"
@echo "7zip - creates a rockbox.7z of your build (no fonts)"
@echo "fontzip - creates rockbox-fonts.zip"
@echo "mapzip - creates rockbox-maps.zip with all .map files"
@echo "tools - builds the tools only"
@echo "voice - creates the voice clips (voice builds only)"
@echo "voicetools - builds the voice tools only"
@echo "install - installs your build (at PREFIX, defaults to simdisk/ for simulators (no fonts))"
@echo "fullinstall - installs your build (like install, but with fonts)"
@echo "symlinkinstall - like fullinstall, but with links instead of copying files. (Good for developing on simulator)"
@echo "reconf - rerun configure with the same selection"
### general compile rules: