Added a new flag to the parameters of the *SymLink rules specifying
whether or not the symlink shall be made a dependency of the pseudo target `files' (i.e. will be made by default) and shall be removed upon `jam clean'. Fixed the symlink installation rules to always pass `false' for this param. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5538 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
20c9a9dc8b
commit
7669b69fd4
61
Jamrules
61
Jamrules
@ -1240,12 +1240,25 @@ rule PrependObjectHdrs
|
|||||||
|
|
||||||
rule SymLink
|
rule SymLink
|
||||||
{
|
{
|
||||||
# SymLink <target> : <source> ;
|
# SymLink <target> : <source> : <makeDefaultDependencies> ;
|
||||||
# Links <target> to <source>.
|
# Links <target> to <source>.
|
||||||
# <source> is the exact link contents. No binding is done.
|
# <source> is the exact link contents. No binding is done.
|
||||||
LINKCONTENTS on $(1) = $(2) ;
|
# <makeDefaultDependencies> If true, <target> will be made a dependency
|
||||||
SymLink1 $(1) ;
|
# of the `all' pseudo target, i.e. it will be made by default, and removed
|
||||||
LocalDepends all : $(target) ;
|
# on `jam clean'.
|
||||||
|
|
||||||
|
local target = $(1) ;
|
||||||
|
local source = $(2) ;
|
||||||
|
local makeDefaultDependencies = $(3) ;
|
||||||
|
if ! $(makeDefaultDependencies) {
|
||||||
|
makeDefaultDependencies = true ;
|
||||||
|
}
|
||||||
|
LINKCONTENTS on $(target) = $(source) ;
|
||||||
|
SymLink1 $(target) ;
|
||||||
|
if $(makeDefaultDependencies) = true {
|
||||||
|
LocalDepends files : $(target) ;
|
||||||
|
LocalClean clean : $(target) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actions SymLink1
|
actions SymLink1
|
||||||
@ -1255,14 +1268,18 @@ actions SymLink1
|
|||||||
|
|
||||||
rule RelSymLink
|
rule RelSymLink
|
||||||
{
|
{
|
||||||
# RelSymLink <link> : <link target>
|
# RelSymLink <link> : <link target> : <makeDefaultDependencies> ;
|
||||||
# Creates a relative symbolic link from <link> to <link target>.
|
# Creates a relative symbolic link from <link> to <link target>.
|
||||||
# <link> and <link target> can be usual targets. They may have a grist
|
# <link> and <link target> can be usual targets. They may have a grist
|
||||||
# and don't need to have any dirname. Their LOCATE variables are used to
|
# and don't need to have any dirname. Their LOCATE variables are used to
|
||||||
# find their locations.
|
# find their locations.
|
||||||
|
# <makeDefaultDependencies> If true (which is the default), <link> will be
|
||||||
|
# made a dependency of the `files' pseudo target, i.e. it will be made by
|
||||||
|
# default, and removed on `jam clean'.
|
||||||
|
|
||||||
local target = $(1) ;
|
local target = $(1) ;
|
||||||
local source = $(2) ;
|
local source = $(2) ;
|
||||||
|
local makeDefaultDependencies = $(3) ;
|
||||||
local targetDir = [ on $(target) FDirName $(LOCATE[1]) $(target:D) ] ;
|
local targetDir = [ on $(target) FDirName $(LOCATE[1]) $(target:D) ] ;
|
||||||
local sourceDir = [ on $(source) FDirName $(LOCATE[1]) $(source:D) ] ;
|
local sourceDir = [ on $(source) FDirName $(LOCATE[1]) $(source:D) ] ;
|
||||||
local sourcePath = $(source:G=) ;
|
local sourcePath = $(source:G=) ;
|
||||||
@ -1271,26 +1288,37 @@ rule RelSymLink
|
|||||||
local sourceComponents = [ SplitPath $(sourcePath) ] ;
|
local sourceComponents = [ SplitPath $(sourcePath) ] ;
|
||||||
|
|
||||||
SymLink $(target)
|
SymLink $(target)
|
||||||
: [ FRelPath $(targetDirComponents) : $(sourceComponents) ] ;
|
: [ FRelPath $(targetDirComponents) : $(sourceComponents) ]
|
||||||
|
: $(makeDefaultDependencies) ;
|
||||||
NOUPDATE $(target) ;
|
NOUPDATE $(target) ;
|
||||||
Depends $(target) : $(source) ;
|
Depends $(target) : $(source) ;
|
||||||
LocalClean clean : $(target) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rule AbsSymLink
|
rule AbsSymLink
|
||||||
{
|
{
|
||||||
# AbsSymLink <link> : <link target> : <link dir>
|
# AbsSymLink <link> : <link target> : <link dir>
|
||||||
|
# : <makeDefaultDependencies> ;
|
||||||
# Creates an absolute symbolic link from <link> to <link target>.
|
# Creates an absolute symbolic link from <link> to <link target>.
|
||||||
# <link> and <link target> must be usual targets. If <link dir> is
|
# <link> and <link target> must be usual targets. If <link dir> is
|
||||||
# given, then it is set as LOCATE directory on <link>.
|
# given, then it is set as LOCATE directory on <link>.
|
||||||
|
# <makeDefaultDependencies> If true (which is the default), <link> will be
|
||||||
|
# made a dependency of the `files' pseudo target, i.e. it will be made by
|
||||||
|
# default, and removed on `jam clean'.
|
||||||
|
|
||||||
|
local makeDefaultDependencies = $(4) ;
|
||||||
|
if ! $(makeDefaultDependencies) {
|
||||||
|
makeDefaultDependencies = true ;
|
||||||
|
}
|
||||||
|
|
||||||
LocalDepends files : $(1) ;
|
|
||||||
Depends $(1) : $(2) ;
|
Depends $(1) : $(2) ;
|
||||||
if $(3) {
|
if $(3) {
|
||||||
MakeLocate $(1) : $(3) ;
|
MakeLocate $(1) : $(3) ;
|
||||||
}
|
}
|
||||||
SEARCH on $(2) += $(SEARCH_SOURCE) ;
|
SEARCH on $(2) += $(SEARCH_SOURCE) ;
|
||||||
LocalClean clean : $(1) ;
|
if $(makeDefaultDependencies) = true {
|
||||||
|
LocalDepends files : $(1) ;
|
||||||
|
LocalClean clean : $(1) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actions AbsSymLink
|
actions AbsSymLink
|
||||||
@ -1349,12 +1377,21 @@ rule OBOSInstall
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rule InstallAbsSymLinkAdapter
|
||||||
|
{
|
||||||
|
# InstallAbsSymLinkAdapter <link> : <link target>
|
||||||
|
if ! [ on $(2) return $(TARGET) ] {
|
||||||
|
TARGET on $(2) = [ on $(2) return $(SEARCH) ] ;
|
||||||
|
}
|
||||||
|
AbsSymLink $(1) : $(2) : : false ;
|
||||||
|
}
|
||||||
|
|
||||||
rule OBOSInstallAbsSymLink
|
rule OBOSInstallAbsSymLink
|
||||||
{
|
{
|
||||||
# Usage: OBOSInstallAbsSymLink <[ install [ and uninstall ] pseudotarget ]>
|
# Usage: OBOSInstallAbsSymLink <[ install [ and uninstall ] pseudotarget ]>
|
||||||
# : <directory> : <sources to install>
|
# : <directory> : <sources to install>
|
||||||
# : [ <installgrist> ] ;
|
# : [ <installgrist> ] ;
|
||||||
OBOSInstall $(1) : $(2) : $(3) : $(4) : AbsSymLink ;
|
OBOSInstall $(1) : $(2) : $(3) : $(4) : InstallAbsSymLinkAdapter ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule InstallRelSymLinkAdapter
|
rule InstallRelSymLinkAdapter
|
||||||
@ -1363,7 +1400,7 @@ rule InstallRelSymLinkAdapter
|
|||||||
if ! [ on $(2) return $(TARGET) ] {
|
if ! [ on $(2) return $(TARGET) ] {
|
||||||
TARGET on $(2) = [ on $(2) return $(SEARCH) ] ;
|
TARGET on $(2) = [ on $(2) return $(SEARCH) ] ;
|
||||||
}
|
}
|
||||||
RelSymLink $(1) : $(2) ;
|
RelSymLink $(1) : $(2) : false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule OBOSInstallRelSymLink
|
rule OBOSInstallRelSymLink
|
||||||
|
Loading…
Reference in New Issue
Block a user