* When using the generic attribute emulation the Link actions does now
first remove the target and its attributes (if any). Before gcc would just unlink it and leak the attributes, which could lead to later mixups, if the file's inode ID was re-used. As reported by Rene this improves the attribute mixup situation, but doesn't solve it completely. So that status quo is still the same: When using the generic attribute emulation one has to build from the scratch to be sure all attributes are fine. * Got rid of superfluous whitespace. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27385 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -11,7 +11,7 @@ actions piecemeal together existing Clean
|
|||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Link rule/action are overwritten as they don't handle linking files who's name
|
# Link rule/action are overwritten as they don't handle linking files who's name
|
||||||
# contain spaces very well. Also adds resources and version to executable.
|
# contain spaces very well. Also adds resources and version to executable.
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
rule Link
|
rule Link
|
||||||
@@ -29,7 +29,7 @@ rule Link
|
|||||||
|
|
||||||
NEEDLIBS on $(1) = [ on $(1) return $(NEEDLIBS) ] ;
|
NEEDLIBS on $(1) = [ on $(1) return $(NEEDLIBS) ] ;
|
||||||
LINKLIBS on $(1) = [ on $(1) return $(LINKLIBS) ] ;
|
LINKLIBS on $(1) = [ on $(1) return $(LINKLIBS) ] ;
|
||||||
|
|
||||||
MODE on $(<) = $(EXEMODE) ;
|
MODE on $(<) = $(EXEMODE) ;
|
||||||
on $(1) XRes $(1) : $(RESFILES) ;
|
on $(1) XRes $(1) : $(RESFILES) ;
|
||||||
if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] {
|
if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] {
|
||||||
@@ -46,9 +46,24 @@ rule Link
|
|||||||
Chmod $(<) ;
|
Chmod $(<) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE
|
# When using "real" attributes (i.e. BeOS attributes or xattr/extattr) on the
|
||||||
{
|
# host platform, unlinking the main target by gcc will also automatically get
|
||||||
$(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(LINK_BEGIN_GLUE)" "$(2)" "$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" ;
|
# rid of the attributes. When using the generic attribute emulation, which
|
||||||
|
# uses separate files, we need to remove the target explicitely first, so that
|
||||||
|
# the attributes won't be "leaked".
|
||||||
|
if $(HOST_PLATFORM_BEOS_COMPATIBLE) || $(HAIKU_HOST_USE_XATTR) = 1 {
|
||||||
|
actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE
|
||||||
|
{
|
||||||
|
$(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(LINK_BEGIN_GLUE)" "$(2)" \
|
||||||
|
"$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" ;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE
|
||||||
|
{
|
||||||
|
$(RM) "$(1)"
|
||||||
|
$(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(LINK_BEGIN_GLUE)" "$(2)" \
|
||||||
|
"$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rule Object
|
rule Object
|
||||||
@@ -57,7 +72,7 @@ rule Object
|
|||||||
local headers ;
|
local headers ;
|
||||||
local sysHeaders ;
|
local sysHeaders ;
|
||||||
local defines ;
|
local defines ;
|
||||||
|
|
||||||
on $(1) { # use on $(1) variable values
|
on $(1) { # use on $(1) variable values
|
||||||
if ! $(PLATFORM) in $(SUPPORTED_PLATFORMS) {
|
if ! $(PLATFORM) in $(SUPPORTED_PLATFORMS) {
|
||||||
return ;
|
return ;
|
||||||
@@ -77,11 +92,11 @@ rule Object
|
|||||||
if $(PLATFORM) = host {
|
if $(PLATFORM) = host {
|
||||||
sysHeaders += $(HOST_HDRS) ;
|
sysHeaders += $(HOST_HDRS) ;
|
||||||
defines += $(HOST_DEFINES) ;
|
defines += $(HOST_DEFINES) ;
|
||||||
|
|
||||||
if $(USES_BE_API) {
|
if $(USES_BE_API) {
|
||||||
sysHeaders += $(HOST_BE_API_HEADERS) ;
|
sysHeaders += $(HOST_BE_API_HEADERS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sysHeaders += $(TARGET_HDRS) ;
|
sysHeaders += $(TARGET_HDRS) ;
|
||||||
defines += $(TARGET_DEFINES) ;
|
defines += $(TARGET_DEFINES) ;
|
||||||
@@ -102,12 +117,12 @@ rule Object
|
|||||||
# the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
|
# the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
|
||||||
# with the scanned file as the target and the found headers
|
# with the scanned file as the target and the found headers
|
||||||
# as the sources. HDRSEARCH is the value of SEARCH used for
|
# as the sources. HDRSEARCH is the value of SEARCH used for
|
||||||
# the found header files. Finally, if jam must deal with
|
# the found header files. Finally, if jam must deal with
|
||||||
# header files of the same name in different directories,
|
# header files of the same name in different directories,
|
||||||
# they can be distinguished with HDRGRIST.
|
# they can be distinguished with HDRGRIST.
|
||||||
|
|
||||||
# $(SEARCH_SOURCE:E) is where cc first looks for #include
|
# $(SEARCH_SOURCE:E) is where cc first looks for #include
|
||||||
# "foo.h" files. If the source file is in a distant directory,
|
# "foo.h" files. If the source file is in a distant directory,
|
||||||
# look there. Else, look in "" (the current directory).
|
# look there. Else, look in "" (the current directory).
|
||||||
|
|
||||||
HDRRULE on $(>) = HdrRule ;
|
HDRRULE on $(>) = HdrRule ;
|
||||||
@@ -162,7 +177,7 @@ rule As
|
|||||||
local systemIncludesOption ;
|
local systemIncludesOption ;
|
||||||
if [ on $(1) return $(PLATFORM) ] = host {
|
if [ on $(1) return $(PLATFORM) ] = host {
|
||||||
flags = [ on $(1) return $(HOST_ASFLAGS) $(ASFLAGS) ] ;
|
flags = [ on $(1) return $(HOST_ASFLAGS) $(ASFLAGS) ] ;
|
||||||
|
|
||||||
CC on $(1) = $(HOST_CC) ;
|
CC on $(1) = $(HOST_CC) ;
|
||||||
|
|
||||||
includesSeparator = $(HOST_INCLUDES_SEPARATOR) ;
|
includesSeparator = $(HOST_INCLUDES_SEPARATOR) ;
|
||||||
@@ -171,7 +186,7 @@ rule As
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
flags = [ on $(1) return $(TARGET_ASFLAGS) $(ASFLAGS) ] ;
|
flags = [ on $(1) return $(TARGET_ASFLAGS) $(ASFLAGS) ] ;
|
||||||
|
|
||||||
CC on $(1) = $(TARGET_CC) ;
|
CC on $(1) = $(TARGET_CC) ;
|
||||||
|
|
||||||
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
|
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
|
||||||
@@ -292,7 +307,7 @@ rule Cc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actions Cc
|
actions Cc
|
||||||
{
|
{
|
||||||
$(CC) $(CCFLAGS) -c "$(2)" $(CCDEFS) $(CCHDRS) -o "$(1)" ;
|
$(CC) $(CCFLAGS) -c "$(2)" $(CCDEFS) $(CCHDRS) -o "$(1)" ;
|
||||||
}
|
}
|
||||||
@@ -306,30 +321,30 @@ rule C++
|
|||||||
local includesSeparator ;
|
local includesSeparator ;
|
||||||
local localIncludesOption ;
|
local localIncludesOption ;
|
||||||
local systemIncludesOption ;
|
local systemIncludesOption ;
|
||||||
|
|
||||||
# optimization flags
|
# optimization flags
|
||||||
if $(DEBUG) = 0 {
|
if $(DEBUG) = 0 {
|
||||||
flags += $(OPTIM) ;
|
flags += $(OPTIM) ;
|
||||||
} else {
|
} else {
|
||||||
flags += -O0 ;
|
flags += -O0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(PLATFORM) = host {
|
if $(PLATFORM) = host {
|
||||||
# warning flags
|
# warning flags
|
||||||
if $(WARNINGS) != 0 {
|
if $(WARNINGS) != 0 {
|
||||||
flags += $(HOST_WARNING_C++FLAGS) ;
|
flags += $(HOST_WARNING_C++FLAGS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# debug and other flags
|
# debug and other flags
|
||||||
flags += $(HOST_C++FLAGS) $(HOST_DEBUG_$(DEBUG)_C++FLAGS)
|
flags += $(HOST_C++FLAGS) $(HOST_DEBUG_$(DEBUG)_C++FLAGS)
|
||||||
$(SUBDIRC++FLAGS) $(C++FLAGS) ;
|
$(SUBDIRC++FLAGS) $(C++FLAGS) ;
|
||||||
|
|
||||||
if $(USES_BE_API) {
|
if $(USES_BE_API) {
|
||||||
flags += $(HOST_BE_API_C++FLAGS) ;
|
flags += $(HOST_BE_API_C++FLAGS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
C++ on $(1) = $(HOST_C++) ;
|
C++ on $(1) = $(HOST_C++) ;
|
||||||
|
|
||||||
includesSeparator = $(HOST_INCLUDES_SEPARATOR) ;
|
includesSeparator = $(HOST_INCLUDES_SEPARATOR) ;
|
||||||
localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ;
|
localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ;
|
||||||
systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
|
systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
|
||||||
@@ -339,18 +354,18 @@ rule C++
|
|||||||
if $(WARNINGS) != 0 {
|
if $(WARNINGS) != 0 {
|
||||||
flags += $(TARGET_WARNING_C++FLAGS) ;
|
flags += $(TARGET_WARNING_C++FLAGS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# debug and other flags
|
# debug and other flags
|
||||||
flags += $(TARGET_C++FLAGS) $(TARGET_DEBUG_$(DEBUG)_C++FLAGS)
|
flags += $(TARGET_C++FLAGS) $(TARGET_DEBUG_$(DEBUG)_C++FLAGS)
|
||||||
$(SUBDIRC++FLAGS) $(C++FLAGS) ;
|
$(SUBDIRC++FLAGS) $(C++FLAGS) ;
|
||||||
|
|
||||||
C++ on $(1) = $(TARGET_C++) ;
|
C++ on $(1) = $(TARGET_C++) ;
|
||||||
|
|
||||||
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
|
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
|
||||||
localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
|
localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
|
||||||
systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
|
systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
C++FLAGS on $(<) = $(flags) ;
|
C++FLAGS on $(<) = $(flags) ;
|
||||||
CCHDRS on $(<) = [ FIncludes $(HDRS) : $(localIncludesOption) ]
|
CCHDRS on $(<) = [ FIncludes $(HDRS) : $(localIncludesOption) ]
|
||||||
$(includesSeparator)
|
$(includesSeparator)
|
||||||
@@ -403,21 +418,21 @@ rule LibraryFromObjects
|
|||||||
AR on $(_l) = $(TARGET_AR) $(TARGET_ARFLAGS) ;
|
AR on $(_l) = $(TARGET_AR) $(TARGET_ARFLAGS) ;
|
||||||
RANLIB on $(_l) = $(TARGET_RANLIB) ;
|
RANLIB on $(_l) = $(TARGET_RANLIB) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# library depends on its member objects
|
# library depends on its member objects
|
||||||
|
|
||||||
if $(KEEPOBJS)
|
if $(KEEPOBJS)
|
||||||
{
|
{
|
||||||
LocalDepends obj : $(_s) ;
|
LocalDepends obj : $(_s) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalDepends lib : $(_l) ;
|
LocalDepends lib : $(_l) ;
|
||||||
|
|
||||||
# Set LOCATE for the library and its contents. The bound
|
# Set LOCATE for the library and its contents. The bound
|
||||||
# value shows up as $(NEEDLIBS) on the Link actions.
|
# value shows up as $(NEEDLIBS) on the Link actions.
|
||||||
# For compatibility, we only do this if the library doesn't
|
# For compatibility, we only do this if the library doesn't
|
||||||
# already have a path.
|
# already have a path.
|
||||||
|
|
||||||
if ! $(_l:D)
|
if ! $(_l:D)
|
||||||
{
|
{
|
||||||
# locate the library only, if it hasn't been located yet
|
# locate the library only, if it hasn't been located yet
|
||||||
@@ -430,13 +445,13 @@ rule LibraryFromObjects
|
|||||||
}
|
}
|
||||||
MakeLocate $(_l)($(_s:BS)) : $(dir) ;
|
MakeLocate $(_l)($(_s:BS)) : $(dir) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $(NOARSCAN)
|
if $(NOARSCAN)
|
||||||
{
|
{
|
||||||
# If we can't scan the library to timestamp its contents,
|
# If we can't scan the library to timestamp its contents,
|
||||||
# we have to just make the library depend directly on the
|
# we have to just make the library depend directly on the
|
||||||
# on-disk object files.
|
# on-disk object files.
|
||||||
|
|
||||||
Depends $(_l) : $(_s) ;
|
Depends $(_l) : $(_s) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -444,26 +459,26 @@ rule LibraryFromObjects
|
|||||||
# If we can scan the library, we make the library depend
|
# If we can scan the library, we make the library depend
|
||||||
# on its members and each member depend on the on-disk
|
# on its members and each member depend on the on-disk
|
||||||
# object file.
|
# object file.
|
||||||
|
|
||||||
Depends $(_l) : $(_l)($(_s:BS)) ;
|
Depends $(_l) : $(_l)($(_s:BS)) ;
|
||||||
|
|
||||||
for _i in $(_s)
|
for _i in $(_s)
|
||||||
{
|
{
|
||||||
Depends $(_l)($(_i:BS)) : $(_i) ;
|
Depends $(_l)($(_i:BS)) : $(_i) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalClean clean : $(_l) ;
|
LocalClean clean : $(_l) ;
|
||||||
|
|
||||||
# bonefish: Not needed on the supported platforms. Maybe later...
|
# bonefish: Not needed on the supported platforms. Maybe later...
|
||||||
# if $(CRELIB) { CreLib $(_l) : $(_s[1]) ; }
|
# if $(CRELIB) { CreLib $(_l) : $(_s[1]) ; }
|
||||||
|
|
||||||
Archive $(_l) : $(_s) ;
|
Archive $(_l) : $(_s) ;
|
||||||
|
|
||||||
if $(RANLIB) { Ranlib $(_l) ; }
|
if $(RANLIB) { Ranlib $(_l) ; }
|
||||||
|
|
||||||
# If we can't scan the library, we have to leave the .o's around.
|
# If we can't scan the library, we have to leave the .o's around.
|
||||||
|
|
||||||
if ! ( $(KEEPOBJS) || $(NOARSCAN) || $(NOARUPDATE) ) {
|
if ! ( $(KEEPOBJS) || $(NOARSCAN) || $(NOARUPDATE) ) {
|
||||||
RmTemps $(_l) : $(_s) ;
|
RmTemps $(_l) : $(_s) ;
|
||||||
}
|
}
|
||||||
@@ -549,7 +564,7 @@ rule MkDir
|
|||||||
local s ;
|
local s ;
|
||||||
|
|
||||||
# Cheesy gate to prevent multiple invocations on same dir
|
# Cheesy gate to prevent multiple invocations on same dir
|
||||||
# MkDir1 has the actions
|
# MkDir1 has the actions
|
||||||
# Arrange for jam dirs
|
# Arrange for jam dirs
|
||||||
|
|
||||||
$(dir:G=)-mkdir = true ;
|
$(dir:G=)-mkdir = true ;
|
||||||
@@ -560,7 +575,7 @@ rule MkDir
|
|||||||
# $(dir:P) = $(dir)'s parent, & we recurse until root
|
# $(dir:P) = $(dir)'s parent, & we recurse until root
|
||||||
|
|
||||||
s = $(dir:P) ; # parent keeps grist
|
s = $(dir:P) ; # parent keeps grist
|
||||||
|
|
||||||
if $(s:G=) && $(s) != $(dir) {
|
if $(s:G=) && $(s) != $(dir) {
|
||||||
Depends $(dir) : $(s) ;
|
Depends $(dir) : $(s) ;
|
||||||
dir = $(s) ;
|
dir = $(s) ;
|
||||||
|
|||||||
Reference in New Issue
Block a user