Second try for make install for normal builds. Now differentiate better between "PREFIX not set" and "PREFIX not set, but also not needed". Also, recreate the PREFIX when running make reconf.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20694 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-04-12 01:28:33 +00:00
parent 725733ca92
commit 7ed1a5f120
3 changed files with 30 additions and 15 deletions

View file

@ -21,7 +21,7 @@ my $ROOT="..";
my $ziptool="zip -r9"; my $ziptool="zip -r9";
my $output="rockbox.zip"; my $output="rockbox.zip";
my $verbose; my $verbose;
my $sim; my $install=0;
my $exe; my $exe;
my $target; my $target;
my $modelname; my $modelname;
@ -75,7 +75,7 @@ GetOptions ( 'r|root=s' => \$ROOT,
'o|output=s' => \$output, 'o|output=s' => \$output,
'f|fonts=s' => \$incfonts, # 0 - no fonts, 1 - fonts only 2 - fonts and package 'f|fonts=s' => \$incfonts, # 0 - no fonts, 1 - fonts only 2 - fonts and package
'v|verbose' => \$verbose, 'v|verbose' => \$verbose,
's|sim' => \$sim, 'install=s' => \$install, # install destination
'rbdir=s' => \$rbdir, # If we want to put in a different directory 'rbdir=s' => \$rbdir, # If we want to put in a different directory
); );
@ -438,8 +438,11 @@ sub runone {
print "$ziptool $output $rbdir $target >/dev/null\n"; print "$ziptool $output $rbdir $target >/dev/null\n";
} }
if($sim) { if($install) {
system("cp -r $rbdir simdisk/ >/dev/null"); if ($install =~ /\/dev\/null/) {
die "ERROR: No PREFIX given\n"
}
system("cp -r $rbdir \"$install\" >/dev/null");
} }
else { else {
system("$ziptool $output $rbdir $target >/dev/null"); system("$ziptool $output $rbdir $target >/dev/null");

2
tools/configure vendored
View file

@ -2526,6 +2526,7 @@ sed > Makefile \
-e "s,@LANGS@,${buildlangs},g" \ -e "s,@LANGS@,${buildlangs},g" \
-e "s,@USE_ELF@,${USE_ELF},g" \ -e "s,@USE_ELF@,${USE_ELF},g" \
-e "s,@RBDIR@,${rbdir},g" \ -e "s,@RBDIR@,${rbdir},g" \
-e "s,@PREFIX@,$PREFIX,g" \
-e "s,@CMDLINE@,$cmdline,g" \ -e "s,@CMDLINE@,$cmdline,g" \
<<EOF <<EOF
## Automatically generated. http://www.rockbox.org/ ## Automatically generated. http://www.rockbox.org/
@ -2572,6 +2573,7 @@ export WINDRES=@WINDRES@
export DLLTOOL=@DLLTOOL@ export DLLTOOL=@DLLTOOL@
export DLLWRAP=@DLLWRAP@ export DLLWRAP=@DLLWRAP@
export RANLIB=@RANLIB@ export RANLIB=@RANLIB@
export PREFIX=@PREFIX@
export PROFILE_OPTS=@PROFILE_OPTS@ export PROFILE_OPTS=@PROFILE_OPTS@
export SIMVER=@SIMVER@ export SIMVER=@SIMVER@
export SIMDIR=\$(ROOTDIR)/uisimulator/sdl export SIMDIR=\$(ROOTDIR)/uisimulator/sdl

View file

@ -22,6 +22,20 @@ TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \
$(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \ $(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \
$(TOOLSDIR)/uclpack $(TOOLSDIR)/mktccboot $(TOOLSDIR)/mkboot $(TOOLSDIR)/uclpack $(TOOLSDIR)/mktccboot $(TOOLSDIR)/mkboot
ifeq (,$(PREFIX))
ifdef SIMVER
# for sims, set simdisk/ as default
PREFIX = simdisk
INSTALL = --install="$(PREFIX)"
else
# /dev/null as magic to tell it wasn't set, error out later in buildzip.pl
INSTALL = --install=/dev/null
endif
else
INSTALL = --install="$(PREFIX)"
endif
RBINFO = $(BUILDDIR)/rockbox-info.txt RBINFO = $(BUILDDIR)/rockbox-info.txt
# list suffixes to be understood by $* # list suffixes to be understood by $*
@ -254,19 +268,15 @@ voice: voicetools features
endif endif
ifdef SIMVER
install: install:
@echo "Installing your build in your 'simdisk' dir" @echo "Installing your build in your '$(PREFIX)' dir"
$(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \
$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -s -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 0 $(TARGET) $(BINARY) $(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 0 $(TARGET) $(BINARY)
fullinstall: fullinstall:
@echo "Installing a full setup in your 'simdisk' dir" @echo "Installing a full setup in your '$(PREFIX)' dir"
$(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \
$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -s -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 2 $(TARGET) $(BINARY) $(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) -m "$(MODELNAME)" -i "$(TARGET_ID)" $(INSTALL) -z "zip -r0" -r "$(ROOTDIR)" --rbdir="$(RBDIR)" -f 2 $(TARGET) $(BINARY)
endif
help: help:
@echo "A few helpful make targets" @echo "A few helpful make targets"
@ -292,8 +302,8 @@ help:
@echo "tools - builds the tools only" @echo "tools - builds the tools only"
@echo "voice - creates the voice clips (voice builds only)" @echo "voice - creates the voice clips (voice builds only)"
@echo "voicetools - builds the voice tools only" @echo "voicetools - builds the voice tools only"
@echo "install - installs your build (for simulator builds only, no fonts)" @echo "install - installs your build (at PREFIX, defaults to simdisk/ for simulators (no fonts))"
@echo "fullinstall - installs your build (for simulator builds only, with fonts)" @echo "fullinstall - installs your build (like install, but with fonts)"
@echo "reconf - rerun configure with the same selection" @echo "reconf - rerun configure with the same selection"
### general compile rules: ### general compile rules:
@ -320,4 +330,4 @@ Makefile: $(TOOLSDIR)/configure
$(SILENT)echo "*** tools/configure is newer than Makefile. You should run 'make reconf'." $(SILENT)echo "*** tools/configure is newer than Makefile. You should run 'make reconf'."
reconf: reconf:
$(SILENT)$(TOOLSDIR)/configure $(CONFIGURE_OPTIONS) $(SILENT$)PREFIX=$(PREFIX) $(TOOLSDIR)/configure $(CONFIGURE_OPTIONS)