Define two pseudo targets for the target and build platform.
* The main build rules now cause their targets to depend on the platform such that global per-platform intializations can be set up by making the platform pseudo target depend on the target returned by the initialization rule.
This commit is contained in:
@@ -861,6 +861,15 @@ PLATFORM = $(TARGET_PLATFORM) ;
|
|||||||
SUPPORTED_PLATFORMS = haiku ;
|
SUPPORTED_PLATFORMS = haiku ;
|
||||||
|
|
||||||
|
|
||||||
|
# Define two pseudo targets for the target and buildhost platform. The main
|
||||||
|
# build rules (Cc, C++, As, ...) depend on these pseude targets such that global
|
||||||
|
# initializations that are required before anything is built for a specific
|
||||||
|
# platform can be forced by depending the pseudo target for the platform on the
|
||||||
|
# initializations.
|
||||||
|
NotFile $(TARGET_PLATFORM) ;
|
||||||
|
NotFile host ;
|
||||||
|
|
||||||
|
|
||||||
# Instructs the Library rule to not make its object files temporary.
|
# Instructs the Library rule to not make its object files temporary.
|
||||||
# This is needed as some objects are used in a static library and for an
|
# This is needed as some objects are used in a static library and for an
|
||||||
# executable.
|
# executable.
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ rule StaticLibraryFromObjects
|
|||||||
|
|
||||||
rule AssembleNasm
|
rule AssembleNasm
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) [ on $(<) return $(PLATFORM) ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions AssembleNasm
|
actions AssembleNasm
|
||||||
@@ -343,7 +343,7 @@ rule CreateAsmStructOffsetsHeader header : source
|
|||||||
|
|
||||||
# locate object, search for source, and set on target variables
|
# locate object, search for source, and set on target variables
|
||||||
|
|
||||||
Depends $(header) : $(source) ;
|
Depends $(header) : $(source) $(PLATFORM) ;
|
||||||
SEARCH on $(source) += $(SEARCH_SOURCE) ;
|
SEARCH on $(source) += $(SEARCH_SOURCE) ;
|
||||||
MakeLocateArch $(header) ;
|
MakeLocateArch $(header) ;
|
||||||
LocalClean clean : $(header) ;
|
LocalClean clean : $(header) ;
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ rule As
|
|||||||
= $(TARGET_SYSTEM_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
|
= $(TARGET_SYSTEM_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) [ on $(1) return $(PLATFORM) ] ;
|
||||||
ASFLAGS on $(<) += $(flags) $(SUBDIRASFLAGS) ;
|
ASFLAGS on $(<) += $(flags) $(SUBDIRASFLAGS) ;
|
||||||
ASHDRS on $(<) = [ on $(<) FIncludes $(HDRS) : $(localIncludesOption) ]
|
ASHDRS on $(<) = [ on $(<) FIncludes $(HDRS) : $(localIncludesOption) ]
|
||||||
$(includesSeparator)
|
$(includesSeparator)
|
||||||
@@ -227,7 +227,7 @@ actions As
|
|||||||
|
|
||||||
rule Lex
|
rule Lex
|
||||||
{
|
{
|
||||||
Depends $(1) : $(2) ;
|
Depends $(1) : $(2) [ on $(1) return $(PLATFORM) ] ;
|
||||||
MakeLocateArch $(1) ;
|
MakeLocateArch $(1) ;
|
||||||
LocalClean clean : $(1) ;
|
LocalClean clean : $(1) ;
|
||||||
}
|
}
|
||||||
@@ -245,7 +245,8 @@ rule Yacc
|
|||||||
|
|
||||||
MakeLocateArch $(source) $(header) ;
|
MakeLocateArch $(source) $(header) ;
|
||||||
|
|
||||||
Depends $(source) $(header) : $(yaccSource) ;
|
Depends $(source) $(header)
|
||||||
|
: $(yaccSource) [ on $(source) return $(PLATFORM) ] ;
|
||||||
Yacc1 $(source) $(header) : $(yaccSource) ;
|
Yacc1 $(source) $(header) : $(yaccSource) ;
|
||||||
LocalClean clean : $(source) $(header) ;
|
LocalClean clean : $(source) $(header) ;
|
||||||
|
|
||||||
@@ -263,7 +264,7 @@ actions Yacc1
|
|||||||
|
|
||||||
rule Cc
|
rule Cc
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) [ on $(1) return $(PLATFORM) ] ;
|
||||||
|
|
||||||
on $(1) {
|
on $(1) {
|
||||||
local flags ;
|
local flags ;
|
||||||
@@ -341,7 +342,7 @@ actions Cc
|
|||||||
|
|
||||||
rule C++
|
rule C++
|
||||||
{
|
{
|
||||||
Depends $(<) : $(>) ;
|
Depends $(<) : $(>) [ on $(1) return $(PLATFORM) ] ;
|
||||||
|
|
||||||
on $(1) {
|
on $(1) {
|
||||||
local flags ;
|
local flags ;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ rule PreprocessSyscalls preprocessedHeader : header : architecture
|
|||||||
{
|
{
|
||||||
# PreprocessSyscalls <preprocessedHeader> : <header> : <architecture> ;
|
# PreprocessSyscalls <preprocessedHeader> : <header> : <architecture> ;
|
||||||
|
|
||||||
Depends $(preprocessedHeader) : $(header) ;
|
Depends $(preprocessedHeader) : $(header) $(PLATFORM) ;
|
||||||
|
|
||||||
local headers = [ on $(preprocessedHeader)
|
local headers = [ on $(preprocessedHeader)
|
||||||
return $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ] ;
|
return $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ] ;
|
||||||
|
|||||||
Reference in New Issue
Block a user