From a07cdb6e9f8e484b6ba9f209fbeb144e906d3405 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 31 Jul 2014 14:13:01 +0200 Subject: [PATCH] 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. --- build/jam/BuildSetup | 9 +++++++++ build/jam/MainBuildRules | 4 ++-- build/jam/OverriddenJamRules | 11 ++++++----- src/tools/gensyscalls/Jamfile | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 6cef465e1c..099489aae5 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -861,6 +861,15 @@ PLATFORM = $(TARGET_PLATFORM) ; 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. # This is needed as some objects are used in a static library and for an # executable. diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules index f8c40bae10..317dd61ee9 100644 --- a/build/jam/MainBuildRules +++ b/build/jam/MainBuildRules @@ -168,7 +168,7 @@ rule StaticLibraryFromObjects rule AssembleNasm { - Depends $(<) : $(>) ; + Depends $(<) : $(>) [ on $(<) return $(PLATFORM) ] ; } actions AssembleNasm @@ -343,7 +343,7 @@ rule CreateAsmStructOffsetsHeader header : source # locate object, search for source, and set on target variables - Depends $(header) : $(source) ; + Depends $(header) : $(source) $(PLATFORM) ; SEARCH on $(source) += $(SEARCH_SOURCE) ; MakeLocateArch $(header) ; LocalClean clean : $(header) ; diff --git a/build/jam/OverriddenJamRules b/build/jam/OverriddenJamRules index 4911114af2..43f426780c 100644 --- a/build/jam/OverriddenJamRules +++ b/build/jam/OverriddenJamRules @@ -210,7 +210,7 @@ rule As = $(TARGET_SYSTEM_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ; } - Depends $(<) : $(>) ; + Depends $(<) : $(>) [ on $(1) return $(PLATFORM) ] ; ASFLAGS on $(<) += $(flags) $(SUBDIRASFLAGS) ; ASHDRS on $(<) = [ on $(<) FIncludes $(HDRS) : $(localIncludesOption) ] $(includesSeparator) @@ -227,7 +227,7 @@ actions As rule Lex { - Depends $(1) : $(2) ; + Depends $(1) : $(2) [ on $(1) return $(PLATFORM) ] ; MakeLocateArch $(1) ; LocalClean clean : $(1) ; } @@ -245,7 +245,8 @@ rule Yacc MakeLocateArch $(source) $(header) ; - Depends $(source) $(header) : $(yaccSource) ; + Depends $(source) $(header) + : $(yaccSource) [ on $(source) return $(PLATFORM) ] ; Yacc1 $(source) $(header) : $(yaccSource) ; LocalClean clean : $(source) $(header) ; @@ -263,7 +264,7 @@ actions Yacc1 rule Cc { - Depends $(<) : $(>) ; + Depends $(<) : $(>) [ on $(1) return $(PLATFORM) ] ; on $(1) { local flags ; @@ -341,7 +342,7 @@ actions Cc rule C++ { - Depends $(<) : $(>) ; + Depends $(<) : $(>) [ on $(1) return $(PLATFORM) ] ; on $(1) { local flags ; diff --git a/src/tools/gensyscalls/Jamfile b/src/tools/gensyscalls/Jamfile index 512d0b0757..58a8870541 100644 --- a/src/tools/gensyscalls/Jamfile +++ b/src/tools/gensyscalls/Jamfile @@ -35,7 +35,7 @@ rule PreprocessSyscalls preprocessedHeader : header : architecture { # PreprocessSyscalls :
: ; - Depends $(preprocessedHeader) : $(header) ; + Depends $(preprocessedHeader) : $(header) $(PLATFORM) ; local headers = [ on $(preprocessedHeader) return $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ] ;