From b0634f6510127dba0effc6d2c1bce5f6f83d6026 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 6 Aug 2006 12:38:30 +0000 Subject: [PATCH] Resource definition files (*.rdef) are now piped through the C preprocessor. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18413 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/BeOSRules | 26 ++++++++++++++++++++++++-- build/jam/MainBuildRules | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/build/jam/BeOSRules b/build/jam/BeOSRules index fab14cbed0..39b61c9ff1 100644 --- a/build/jam/BeOSRules +++ b/build/jam/BeOSRules @@ -139,6 +139,27 @@ rule ResComp # # and must be gristed. + # get compiler and defines for the platform + local cc ; + local defines ; + + on $(1) { # use on $(1) variable values + defines = $(DEFINES) ; + + if $(PLATFORM) = host { + defines += $(HOST_DEFINES) ; + cc = $(HOST_CC) ; + } else { + defines += $(TARGET_DEFINES) ; + cc = $(TARGET_CC) ; + } + } + + DEFINES on $(1) = $(defines) ; + CCDEFS on $(1) = [ FDefines $(defines) ] ; + CC on $(1) = $(cc) ; + + # set up other vars SEARCH on $(2) += $(SEARCH_SOURCE) ; MakeLocateArch $(1) ; Depends $(1) : $(2) rc ; @@ -146,9 +167,10 @@ rule ResComp ResComp1 $(1) : rc $(2) ; } +# Note: We pipe the file into the preprocessor, since *.rdef files are +# considered linker scripts. actions ResComp1 { $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) - $(2[1]) --auto-names -o $(1) $(2[2-]) + cat $(2[2]) | $(CC) -E $(CCDEFS) - | egrep -v '^#' | $(2[1]) --auto-names -o $(1) - } - diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules index 74bca36d27..00a4410909 100644 --- a/build/jam/MainBuildRules +++ b/build/jam/MainBuildRules @@ -400,6 +400,7 @@ rule AddResources file = $(rdef:S=.rsrc) ; ResComp $(file) : $(rdef) ; } + InheritPlatform $(file) : $(1) ; RESFILES on $(1) += $(file) ; } }